Skip to content

Commit

Permalink
chore: remove .coveragerc as it is in pyproject.toml now
Browse files Browse the repository at this point in the history
  • Loading branch information
dhdaines committed Apr 3, 2024
1 parent ad461a7 commit 7288bfa
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 40 deletions.
7 changes: 0 additions & 7 deletions .coveragerc

This file was deleted.

8 changes: 0 additions & 8 deletions .pylintrc

This file was deleted.

74 changes: 49 additions & 25 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test = [
dev = [
"g2p[test]",
"black>=23; python_version < '3.8'",
"black>24.2; python_version >= '3.8'",
"black~=24.3; python_version >= '3.8'",
"gitlint>=0.17.0",
"isort>=5.10.1",
"mypy>=1; python_version < '3.8'",
Expand Down Expand Up @@ -119,26 +119,31 @@ requires = [
[tool.hatch.envs.api]
features = [ "api" ]

[tool.hatch.envs.api.scripts]
serve = "flask --app g2p.app run"
routes = "flask --app g2p.app routes"

[tool.hatch.envs.prod]
template = "api"
type = "pip-compile"
python = "3.10"
lock-filename = "requirements.txt"
features = [ "prod" ]

[tool.hatch.envs.prod.scripts]
serve = "gunicorn --worker-class eventlet -w 1 g2p.app:APP --no-sendfile"

[tool.hatch.envs.test]
features = [ "test" ]

[tool.hatch.envs.dev]
features = [ "dev" ]
post-install-commands = [
"pre-commit install",
"gitlint install-hook || true",
"mypy --install-types --non-interactive g2p",
]
[[tool.hatch.envs.test.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

[tool.hatch.envs.dev.scripts]
check = "mypy --non-interactive {args:g2p}"
[tool.hatch.envs.test.scripts]
serve-cov = "coverage run -m flask --app g2p.app run"
test = "python run_tests.py dev"
test-cov = "coverage run run_tests.py dev"
test-studio = "python g2p/tests/test_studio.py"
cov-report = [
"- coverage combine",
"coverage report",
Expand All @@ -148,29 +153,24 @@ cov = [
"cov-report",
]

[tool.hatch.envs.api.scripts]
serve = "flask --app g2p.app run"
routes = "flask --app g2p.app routes"

[tool.hatch.envs.prod.scripts]
serve = "gunicorn --worker-class eventlet -w 1 g2p.app:APP --no-sendfile"

[[tool.hatch.envs.test.matrix]]
python = ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
[tool.hatch.envs.dev]
features = [ "dev" ]
post-install-commands = [
"pre-commit install",
"gitlint install-hook || true",
"mypy --install-types --non-interactive g2p",
]

[tool.hatch.envs.test.scripts]
serve-cov = "coverage run -m flask --app g2p.app run"
test = "python run_tests.py dev"
test-cov = "coverage run run_tests.py dev"
test-studio = "python g2p/tests/test_studio.py"
[tool.hatch.envs.dev.scripts]
check = "mypy --non-interactive {args:g2p}"

[tool.coverage.run]
source_pkgs = ["g2p"]
branch = true
parallel = true
omit = [
"g2p/_version.py",
"g2p/tests",
"g2p/tests/**/*.py",
]

[tool.coverage.report]
Expand All @@ -181,3 +181,27 @@ plugins = ["pydantic.mypy"]

[tool.isort]
profile = "black"

[tool.pylint.main]
# Unsure how to make pylint recursively ignore
ignore = [
"g2p/tests",
"g2p/tests/public",
"g2p/tests/public/data",
]

[tool.pylint.messages_control]
# This is TOO LONG but the code is that way for the moment
max-line-length = 120
good-names = [
# We use single letter e for exception, f for file handles
"e", "f",
]
disable = [
# We do this to speed loading time, sorry pylint but not sorry
"import-outside-toplevel",
# We use isort for sorting our imports, so nevermind what pylint thinks
"wrong-import-order",
# I find the "unnecessary" else makes code more readable
"no-else-return",
]

0 comments on commit 7288bfa

Please sign in to comment.