Skip to content

Commit 30d6c4f

Browse files
committed
Merge branch 'master' into remove-flake8-mention-from-CONTRIBUTING
2 parents b2b5c2f + 7f1a552 commit 30d6c4f

File tree

130 files changed

+5311
-1488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

130 files changed

+5311
-1488
lines changed

.coveragerc

-4
This file was deleted.

.flake8

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[flake8]
22
max-line-length = 88
3-
max-complexity = 25
3+
# max-complexity should be 10
4+
max-complexity = 19
45
extend-ignore =
5-
A003 # Class attribute is shadowing a python builtin
66
# Formatting style for `black`
77
E203 # Whitespace before ':'
88
W503 # Line break occurred before a binary operator

.github/pull_request_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
* [ ] All functions and variable names follow Python naming conventions.
1717
* [ ] All function parameters and return values are annotated with Python [type hints](https://docs.python.org/3/library/typing.html).
1818
* [ ] All functions have [doctests](https://docs.python.org/3/library/doctest.html) that pass the automated testing.
19-
* [ ] All new algorithms have a URL in its comments that points to Wikipedia or other similar explanation.
19+
* [ ] All new algorithms include at least one URL that points to Wikipedia or another similar explanation.
2020
* [ ] If this pull request resolves one or more open issues then the commit message contains `Fixes: #{$ISSUE_NO}`.

.github/workflows/build.yml

+10-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
- uses: actions/checkout@v3
1313
- uses: actions/setup-python@v4
1414
with:
15-
python-version: 3.x
15+
python-version: 3.11
1616
- uses: actions/cache@v3
1717
with:
1818
path: ~/.cache/pip
@@ -22,6 +22,14 @@ jobs:
2222
python -m pip install --upgrade pip setuptools six wheel
2323
python -m pip install pytest-cov -r requirements.txt
2424
- name: Run tests
25-
run: pytest --doctest-modules --ignore=project_euler/ --ignore=scripts/validate_solutions.py --cov-report=term-missing:skip-covered --cov=. .
25+
# See: #6591 for re-enabling tests on Python v3.11
26+
run: pytest
27+
--ignore=computer_vision/cnn_classification.py
28+
--ignore=machine_learning/lstm/lstm_prediction.py
29+
--ignore=quantum/
30+
--ignore=project_euler/
31+
--ignore=scripts/validate_solutions.py
32+
--cov-report=term-missing:skip-covered
33+
--cov=. .
2634
- if: ${{ success() }}
2735
run: scripts/build_directory_md.py 2>&1 | tee DIRECTORY.md

.pre-commit-config.yaml

+14-7
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ repos:
77
- id: end-of-file-fixer
88
types: [python]
99
- id: trailing-whitespace
10-
exclude: |
11-
(?x)^(
12-
data_structures/heap/binomial_heap.py
13-
)$
1410
- id: requirements-txt-fixer
1511

12+
- repo: https://github.com/MarcoGorelli/auto-walrus
13+
rev: v0.2.1
14+
hooks:
15+
- id: auto-walrus
16+
1617
- repo: https://github.com/psf/black
1718
rev: 22.10.0
1819
hooks:
@@ -26,7 +27,7 @@ repos:
2627
- --profile=black
2728

2829
- repo: https://github.com/asottile/pyupgrade
29-
rev: v3.1.0
30+
rev: v3.2.0
3031
hooks:
3132
- id: pyupgrade
3233
args:
@@ -36,13 +37,19 @@ repos:
3637
rev: 5.0.4
3738
hooks:
3839
- id: flake8 # See .flake8 for args
39-
additional_dependencies:
40+
additional_dependencies: &flake8-plugins
4041
- flake8-bugbear
4142
- flake8-builtins
4243
- flake8-broken-line
4344
- flake8-comprehensions
4445
- pep8-naming
45-
- yesqa
46+
47+
- repo: https://github.com/asottile/yesqa
48+
rev: v1.4.0
49+
hooks:
50+
- id: yesqa
51+
additional_dependencies:
52+
*flake8-plugins
4653

4754
- repo: https://github.com/pre-commit/mirrors-mypy
4855
rev: v0.982

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Welcome to [TheAlgorithms/Python](https://github.com/TheAlgorithms/Python)! Befo
88

99
### Contributor
1010

11-
We are very happy that you consider implementing algorithms and data structures for others! This repository is referenced and used by learners from all over the globe. Being one of our contributors, you agree and confirm that:
11+
We are very happy that you are considering implementing algorithms and data structures for others! This repository is referenced and used by learners from all over the globe. Being one of our contributors, you agree and confirm that:
1212

1313
- You did your work - no plagiarism allowed
1414
- Any plagiarized work will not be merged.
@@ -66,7 +66,7 @@ pre-commit run --all-files --show-diff-on-failure
6666

6767
We want your work to be readable by others; therefore, we encourage you to note the following:
6868

69-
- Please write in Python 3.9+. For instance: `print()` is a function in Python 3 so `print "Hello"` will *not* work but `print("Hello")` will.
69+
- Please write in Python 3.11+. For instance: `print()` is a function in Python 3 so `print "Hello"` will *not* work but `print("Hello")` will.
7070
- Please focus hard on the naming of functions, classes, and variables. Help your reader by using __descriptive names__ that can help you to remove redundant comments.
7171
- Single letter variable names are *old school* so please avoid them unless their life only spans a few lines.
7272
- Expand acronyms because `gcd()` is hard to understand but `greatest_common_divisor()` is not.

0 commit comments

Comments
 (0)