-
Notifications
You must be signed in to change notification settings - Fork 137
[Housekeeping] Update Python & third party packages. Add ruff
.
#395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 7 commits
433bc47
1d9511f
df748b4
21837db
326c072
66430ab
939b33d
1090f60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,12 @@ | ||
default_language_version: | ||
python: python3.12.0 | ||
repos: | ||
- repo: https://github.com/pycqa/flake8 | ||
rev: 6.0.0 | ||
hooks: | ||
- id: flake8 | ||
name: flake8 | ||
|
||
- repo: https://github.com/pycqa/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
name: isort | ||
args: [--check] | ||
|
||
- repo: https://github.com/psf/black | ||
rev: 23.1.0 | ||
hooks: | ||
- id: black | ||
name: black | ||
args: [--check] | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.2.2 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [ --fix ] | ||
# Run the formatter. | ||
- id: ruff-format |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: "3.9" | ||
version: "3.12.0" | ||
|
||
services: | ||
db: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,66 @@ | ||
[tool.black] | ||
line-length = 120 | ||
# By default, `black` will ignore skip configuration when paths are explicitly provided. | ||
# In order for `pre-commit` to respect this configuration, `force-exclude` needs to be explicitly set. | ||
force-exclude = 'migrations' | ||
|
||
[tool.isort] | ||
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#isort | ||
profile = "black" | ||
# By default, `isort` will ignore skip configuration when paths are explicitly provided. | ||
# In order for `pre-commit` to respect this configuration, `filter_files` needs to be set to true. | ||
# https://jugmac00.github.io/blog/isort-and-pre-commit-a-friendship-with-obstacles/ | ||
filter_files = true | ||
skip_glob = ["*/migrations/*", "config/*"] | ||
[tool.ruff] | ||
# Exclude a variety of commonly ignored directories. | ||
exclude = [ | ||
"migrations", | ||
".bzr", | ||
".direnv", | ||
".eggs", | ||
".git", | ||
".git-rewrite", | ||
".hg", | ||
".ipynb_checkpoints", | ||
".mypy_cache", | ||
".nox", | ||
".pants.d", | ||
".pyenv", | ||
".pytest_cache", | ||
".pytype", | ||
".ruff_cache", | ||
".svn", | ||
".tox", | ||
".venv", | ||
".vscode", | ||
"__pypackages__", | ||
"_build", | ||
"buck-out", | ||
"build", | ||
"dist", | ||
"node_modules", | ||
"site-packages", | ||
"venv", | ||
] | ||
|
||
# Same as Black. | ||
line-length = 88 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When we use default length we do not need to add to pyproject.toml. If you choose some custom length (120 for example) it will make sense There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Lets just continue using 120 and we are good to go. |
||
indent-width = 4 | ||
|
||
# Assume Python 3.12 | ||
target-version = "py312" | ||
|
||
[tool.ruff.lint] | ||
# Enable Pyflakes (`F`) and a subset of the pycodestyle (`E`) codes by default. | ||
select = ["E4", "E7", "E9", "F", "I"] | ||
ignore = ["E722"] | ||
|
||
# Allow fix for all enabled rules (when `--fix`) is provided. | ||
fixable = ["ALL"] | ||
unfixable = [] | ||
|
||
# Allow unused variables when underscore-prefixed. | ||
dummy-variable-rgx = "^(_+|(_+[a-zA-Z0-9_]*[a-zA-Z0-9]+?))$" | ||
|
||
[tool.ruff.format] | ||
# Like Black, use double quotes for strings. | ||
quote-style = "double" | ||
|
||
# Like Black, indent with spaces, rather than tabs. | ||
indent-style = "space" | ||
|
||
# Like Black, respect magic trailing commas. | ||
skip-magic-trailing-comma = false | ||
|
||
# Like Black, automatically detect the appropriate line ending. | ||
line-ending = "auto" | ||
|
||
[tool.ruff.lint.isort] | ||
case-sensitive = true |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,21 @@ | ||
-r base.txt | ||
|
||
pytest==7.4.0 | ||
pytest-django==4.5.2 | ||
pytest==8.0.1 | ||
pytest-django==4.8.0 | ||
|
||
factory-boy==3.2.1 | ||
Faker==18.6.0 | ||
factory-boy==3.3.0 | ||
Faker==23.2.1 | ||
|
||
ipdb==0.13.13 | ||
ipython==8.10.0 | ||
|
||
django-debug-toolbar==3.8.1 | ||
django-debug-toolbar==4.3.0 | ||
|
||
mypy==1.2.0 | ||
mypy==1.8.0 | ||
|
||
django-stubs==1.14.0 | ||
djangorestframework-stubs==1.8.0 | ||
boto3-stubs==1.26.81 | ||
django-stubs==4.2.7 | ||
djangorestframework-stubs==3.14.5 | ||
boto3-stubs==1.34.48 | ||
|
||
flake8==6.0.0 | ||
isort==5.12.0 | ||
black==23.3.0 | ||
pre-commit==3.2.2 | ||
ruff==0.2.2 | ||
pre-commit==3.6.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
python-3.10.8 | ||
python-3.12.0 |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.