-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move tool config to pyproject.toml (GSI-544) (#187)
Moved config for: - ruff - mypy - pytest - coverage
- Loading branch information
1 parent
19c6048
commit d27da9d
Showing
10 changed files
with
299 additions
and
54 deletions.
There are no files selected for viewing
This file was deleted.
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,16 @@ | ||
name: Check if the config schema and the example are up to date. | ||
|
||
on: push | ||
|
||
jobs: | ||
static-code-analysis: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- id: common | ||
uses: ghga-de/gh-action-common@v4 | ||
|
||
- name: Check pyproject.toml | ||
run: | | ||
./scripts/update_pyproject.py --check |
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,19 @@ | ||
[project] | ||
# please adapt to package name | ||
name = "my_microservice" | ||
version = "0.1.0" | ||
description = "My-Microservice - a short description" | ||
dependencies = [ | ||
"typer >= 0.9.0", | ||
"ghga-service-commons[api] >= 1.2.0", | ||
"ghga-event-schemas >= 1.0.0", | ||
"hexkit[akafka,s3,mongodb] >= 1.1.0" | ||
] | ||
|
||
[project.urls] | ||
# please adapt to package name | ||
Repository = "https://github.com/ghga-de/my-microservice" | ||
|
||
[project.scripts] | ||
# please adapt to package name | ||
my-microservice = "my_microservice.__main__:run" |
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 |
---|---|---|
@@ -1,11 +1,37 @@ | ||
[build-system] | ||
requires = ["setuptools>=67.7.2"] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "German Human Genome Phenome Archive (GHGA)", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.9" | ||
license = { text = "Apache 2.0" } | ||
classifiers = [ | ||
"Development Status :: 1 - Planning", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", | ||
"Topic :: Software Development :: Libraries", | ||
"Intended Audience :: Developers", | ||
] | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
|
||
[tool.ruff] | ||
exclude = [ | ||
".git", | ||
".devcontainer", | ||
"__pycache__", | ||
"build", | ||
"dist", | ||
] | ||
|
||
ignore = [ | ||
"E", # pycodestyle errors | ||
"W", # pycodestyle warnings - pycodestyle covered by black | ||
|
@@ -23,9 +49,7 @@ ignore = [ | |
"D206", # indent-with-spaces (ignored for formatter) | ||
"D300", # triple-single-quotes (ignored for formatter) | ||
] | ||
|
||
line-length = 88 | ||
|
||
select = [ | ||
"C90", # McCabe Complexity | ||
"F", # pyflakes codes | ||
|
@@ -39,26 +63,45 @@ select = [ | |
"SIM", # flake8-simplify | ||
"D", # pydocstyle | ||
] | ||
|
||
fixable = [ | ||
"UP", # e.g. List -> list | ||
"I", # sort imports | ||
"D", # pydocstyle | ||
] | ||
|
||
src = ["src", "tests", "examples", "scripts"] | ||
|
||
target-version = "py39" | ||
|
||
[mccabe] | ||
[tool.ruff.mccabe] | ||
max-complexity = 10 | ||
|
||
[per-file-ignores] | ||
[tool.ruff.per-file-ignores] | ||
"scripts/*" = ["PL", "S", "SIM", "D"] | ||
"tests/*" = ["S", "SIM", "PLR", "B011"] | ||
".devcontainer/*" = ["S", "SIM", "D"] | ||
"examples/*" = ["S", "D"] | ||
"__init__.py" = ["D"] | ||
|
||
[pydocstyle] | ||
[tool.ruff.pydocstyle] | ||
convention = "pep257" | ||
|
||
[tool.mypy] | ||
disable_error_code = "import" | ||
show_error_codes = true | ||
exclude = [ | ||
'build/lib/', | ||
] | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
check_untyped_defs = true | ||
no_site_packages = false | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.1" | ||
asyncio_mode = "strict" | ||
|
||
[tool.coverage.paths] | ||
source = [ | ||
"src", | ||
"/workspace/src", | ||
"**/lib/python*/site-packages", | ||
] |
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 |
---|---|---|
@@ -1,43 +1,133 @@ | ||
[build-system] | ||
requires = ["setuptools>=67.7.2"] | ||
requires = [ | ||
"setuptools>=67.7.2", | ||
] | ||
build-backend = "setuptools.build_meta" | ||
|
||
[project] | ||
# please adapt to package name | ||
name = "my_microservice" | ||
version = "0.1.0" | ||
description = "My-Microservice - a short description" | ||
readme = "README.md" | ||
authors = [ | ||
{ name = "German Human Genome Phenome Archive (GHGA)", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.9" | ||
license = { text = "Apache 2.0" } | ||
classifiers = [ | ||
"Development Status :: 1 - Planning", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Topic :: Internet :: WWW/HTTP :: HTTP Servers", | ||
"Topic :: Software Development :: Libraries", | ||
"Intended Audience :: Developers", | ||
] | ||
dependencies = [ | ||
"typer >= 0.9.0", | ||
"ghga-service-commons[api] >= 1.2.0", | ||
"ghga-event-schemas >= 1.0.0", | ||
"hexkit[akafka,s3,mongodb] >= 1.1.0" | ||
"hexkit[akafka,s3,mongodb] >= 1.1.0", | ||
] | ||
|
||
[project.urls] | ||
# please adapt to package name | ||
Repository = "https://github.com/ghga-de/my-microservice" | ||
|
||
[project.scripts] | ||
# please adapt to package name | ||
my-microservice = "my_microservice.__main__:run" | ||
|
||
[tool.setuptools.packages.find] | ||
where = ["src"] | ||
where = [ | ||
"src", | ||
] | ||
|
||
[tool.ruff] | ||
exclude = [ | ||
".git", | ||
".devcontainer", | ||
"__pycache__", | ||
"build", | ||
"dist", | ||
] | ||
ignore = [ | ||
"E", | ||
"W", | ||
"PLW", | ||
"RUF001", | ||
"RUF010", | ||
"RUF012", | ||
"N818", | ||
"B008", | ||
"PLR2004", | ||
"D205", | ||
"D400", | ||
"D401", | ||
"D107", | ||
"D206", | ||
"D300", | ||
] | ||
line-length = 88 | ||
select = [ | ||
"C90", | ||
"F", | ||
"I", | ||
"S", | ||
"B", | ||
"N", | ||
"UP", | ||
"PL", | ||
"RUF", | ||
"SIM", | ||
"D", | ||
] | ||
fixable = [ | ||
"UP", | ||
"I", | ||
"D", | ||
] | ||
src = [ | ||
"src", | ||
"tests", | ||
"examples", | ||
"scripts", | ||
] | ||
target-version = "py39" | ||
|
||
[tool.ruff.mccabe] | ||
max-complexity = 10 | ||
|
||
[tool.ruff.per-file-ignores] | ||
"scripts/*" = [ | ||
"PL", | ||
"S", | ||
"SIM", | ||
"D", | ||
] | ||
"tests/*" = [ | ||
"S", | ||
"SIM", | ||
"PLR", | ||
"B011", | ||
] | ||
".devcontainer/*" = [ | ||
"S", | ||
"SIM", | ||
"D", | ||
] | ||
"examples/*" = [ | ||
"S", | ||
"D", | ||
] | ||
"__init__.py" = [ | ||
"D", | ||
] | ||
|
||
[tool.ruff.pydocstyle] | ||
convention = "pep257" | ||
|
||
[tool.mypy] | ||
disable_error_code = "import" | ||
show_error_codes = true | ||
exclude = [ | ||
"build/lib/", | ||
] | ||
warn_redundant_casts = true | ||
warn_unused_ignores = true | ||
check_untyped_defs = true | ||
no_site_packages = false | ||
|
||
[tool.pytest.ini_options] | ||
minversion = "7.1" | ||
asyncio_mode = "strict" | ||
|
||
[tool.coverage.paths] | ||
source = [ | ||
"src", | ||
"/workspace/src", | ||
"**/lib/python*/site-packages", | ||
] |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.