-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: update project structure to 79dbc2cb
- Loading branch information
Showing
14 changed files
with
233 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
diff a/.github/workflows/test.yml b/.github/workflows/test.yml (rejected hunks) | ||
@@ -38,10 +38,17 @@ jobs: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
- python-version: ["3.7", "3.8", "3.9", "3.10"] | ||
+ python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] | ||
steps: | ||
- - uses: actions/checkout@v2 | ||
+ - uses: actions/checkout@v4 | ||
- uses: ./.github/actions/python-poetry-env | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
- run: poetry run pytest | ||
+ | ||
+ docs: | ||
+ runs-on: ubuntu-latest | ||
+ steps: | ||
+ - uses: actions/checkout@v4 | ||
+ - uses: ./.github/actions/python-poetry-env | ||
+ - run: poetry run mkdocs build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
diff a/.pre-commit-config.yaml b/.pre-commit-config.yaml (rejected hunks) | ||
@@ -15,26 +15,19 @@ repos: | ||
- id: mixed-line-ending | ||
- repo: local | ||
hooks: | ||
- - id: autoflake | ||
- name: autoflake | ||
- entry: poetry run autoflake -r -i --remove-all-unused-imports --remove-unused-variables | ||
+ - id: ruff-format | ||
+ name: ruff-format | ||
+ entry: poetry run ruff format | ||
+ require_serial: true | ||
language: system | ||
types: [ python ] | ||
- - id: isort | ||
- name: isort | ||
- entry: poetry run isort | ||
- language: system | ||
- types: [python] | ||
- - id: black | ||
- name: black | ||
- entry: poetry run black | ||
- language: system | ||
- types: [python] | ||
- - id: pyupgrade | ||
- name: pyupgrade | ||
- entry: poetry run pyupgrade --py37-plus | ||
+ - id: ruff | ||
+ name: ruff | ||
+ # Add --fix, in case you want it to autofix when this hook runs | ||
+ entry: poetry run ruff check --force-exclude | ||
+ require_serial: true | ||
language: system | ||
- types: [python] | ||
+ types: [ python ] | ||
- id: mypy | ||
name: mypy | ||
entry: poetry run mypy . | ||
@@ -42,11 +35,6 @@ repos: | ||
language: system | ||
types: [python] | ||
pass_filenames: false | ||
- - id: flake8 | ||
- name: flake8 | ||
- entry: poetry run flake8 | ||
- language: system | ||
- types: [python] | ||
- id: kacl-verify | ||
name: kacl-verify | ||
entry: poetry run kacl-cli verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
diff a/README.md b/README.md (rejected hunks) | ||
@@ -66,7 +65,7 @@ Find the draft release from the | ||
|
||
### Pre-commit | ||
|
||
-Pre-commit hooks run all the auto-formatters (e.g. `black`, `isort`), linters (e.g. `mypy`, `flake8`), and other quality | ||
+Pre-commit hooks run all the auto-formatting (`ruff format`), linters (e.g. `ruff` and `mypy`), and other quality | ||
checks to make sure the changeset is in good shape before a commit/push happens. | ||
|
||
You can install the hooks with (runs for each commit): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
diff a/pyproject.toml b/pyproject.toml (rejected hunks) | ||
@@ -18,9 +18,11 @@ classifiers = [ | ||
"Operating System :: OS Independent", | ||
"Programming Language :: Python", | ||
"Programming Language :: Python :: 3", | ||
- "Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
+ "Programming Language :: Python :: 3.10", | ||
+ "Programming Language :: Python :: 3.11", | ||
+ "Programming Language :: Python :: 3.12", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
"Typing :: Typed", | ||
] | ||
@@ -30,43 +32,54 @@ packages = [ | ||
] | ||
|
||
[tool.poetry.dependencies] | ||
-python = ">=3.7.1, <4.0" | ||
- | ||
-[tool.poetry.dev-dependencies] | ||
-autoflake = "*" | ||
-black = "*" | ||
-flake8 = "*" | ||
-flake8-bugbear = "*" | ||
-flake8-builtins = "*" | ||
-flake8-comprehensions = "*" | ||
-flake8-debugger = "*" | ||
-flake8-eradicate = "*" | ||
-flake8-logging-format = "*" | ||
-isort = "*" | ||
-mkdocstrings = {version = ">=0.18", extras = ["python"]} | ||
+python = ">=3.8.1, <4.0" | ||
+ | ||
+[tool.poetry.group.dev.dependencies] | ||
+mkdocstrings = {version = ">=0.23", extras = ["python"]} | ||
mkdocs-material = "*" | ||
mypy = "*" | ||
-pep8-naming = "*" | ||
pre-commit = "*" | ||
pymdown-extensions = "*" | ||
pytest = "*" | ||
pytest-github-actions-annotate-failures = "*" | ||
pytest-cov = "*" | ||
python-kacl = "*" | ||
-pyupgrade = "*" | ||
-tryceratops = "*" | ||
+ruff = ">=0.2.0" | ||
|
||
[build-system] | ||
requires = ["poetry-core>=1.0.0"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
-[tool.isort] | ||
-profile = "black" | ||
-src_paths = ["src", "tests"] | ||
+[tool.ruff] | ||
+target-version = "py38" # The lowest supported version | ||
+ | ||
+[tool.ruff.lint] | ||
+# By default, enable all the lint rules. | ||
+# Add to the ignore list below if you don't want some rules. | ||
+# If you need some ignores for certain modules, see tool.ruff.lint.per-file-ignores below. | ||
+# For individual ignore cases, prefer inline `# noqa`s within the code. | ||
+select = ["ALL"] | ||
+ignore = [ | ||
+ "ANN", # Type hints related, let mypy handle these. | ||
+ "D", # Docstrings related, way too strict to our taste | ||
+ ] | ||
+ | ||
+[tool.ruff.lint.per-file-ignores] | ||
+"tests/**" = [ | ||
+ "S101", # "Use of `assert` detected" | ||
+ "ARG", # "Unused function argument". Fixtures are often unused. | ||
+ "S105", # "Possible hardcoded password". | ||
+] | ||
+ | ||
+[tool.ruff.lint.mccabe] | ||
+max-complexity = 10 | ||
|
||
-[tool.black] | ||
-target-version = ["py37", "py38", "py39"] | ||
-include = '\.pyi?$' | ||
+[tool.ruff.lint.pep8-naming] | ||
+classmethod-decorators = [ | ||
+ "classmethod", | ||
+ "pydantic.validator", | ||
+ "pydantic.root_validator", | ||
+] | ||
|
||
[tool.pytest.ini_options] | ||
addopts = """\ | ||
@@ -84,12 +97,23 @@ exclude_lines = [ | ||
] | ||
|
||
[tool.mypy] | ||
+# This is the global mypy configuration. | ||
+# Avoid changing this! | ||
+strict = true # See all the enabled flags `mypy --help | grep -A 10 'Strict mode'` | ||
disallow_any_unimported = true | ||
-disallow_untyped_defs = true | ||
-no_implicit_optional = true | ||
-strict_equality = true | ||
-warn_unused_ignores = true | ||
-warn_redundant_casts = true | ||
-warn_return_any = true | ||
-check_untyped_defs = true | ||
-show_error_codes = true | ||
+ | ||
+# If you need to ignore something for some specific module, | ||
+# add overrides for them. Avoid changing the global config! | ||
+# For example: | ||
+# [[tool.mypy.overrides]] | ||
+# module = [ | ||
+# "my_unpyted_dependency1.*", | ||
+# "my_unpyted_dependency2.*" | ||
+# ] | ||
+# ignore_missing_imports = true | ||
+ | ||
+# [[tool.mypy.overrides]] | ||
+# module = [ | ||
+# "tests/my_thing/test_my_thing", | ||
+# ] | ||
+# disallow_untyped_defs = false |