Skip to content

Commit

Permalink
Update project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
ziima committed May 13, 2024
1 parent c2c9ee2 commit 600744f
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 28 deletions.
23 changes: 23 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,26 @@
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"

[tool.ruff]
target-version = "py38"
line-length = 120

[tool.ruff.lint]
select = ["E", "W", "F", "C", "I", "D", "S", "UP", "B", "ISC", "G", "RSE"]
ignore = ["D105", "D106", "D107", "UP032"]

[tool.ruff.lint.per-file-ignores]
"tests.py" = ["D1", "S101", "S105", "S106", "S107", "B015", "B018"]

[tool.ruff.lint.isort]
combine-as-imports = true

[tool.ruff.lint.mccabe]
max-complexity = 10

[tool.ruff.lint.pycodestyle]
max-doc-length = 120

[tool.ruff.lint.pydocstyle]
convention = "google"
18 changes: 1 addition & 17 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -37,25 +37,14 @@ tox =

[options.extras_require]
quality =
bandit
doc8
flake8
isort
mypy
pydocstyle
ruff

[doc8]
max-line-length = 120
allow-long-titles = true

[flake8]
max-line-length = 120
max-complexity = 10

[isort]
line_length = 120
combine_as_imports = true

[mypy]
ignore_missing_imports = true
disallow_untyped_defs = true
Expand All @@ -67,8 +56,3 @@ warn_unused_ignores = false

[mypy-tests]
disallow_untyped_defs = false

[pydocstyle]
convention = google
add_ignore = D105,D106,D107
add_select = D204,D400,D401
2 changes: 1 addition & 1 deletion tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def test_other_env(self):
class ToxAddEnvConfigTest(TestCase):
def _test(self, env_name: str, initial_deps: str, result: List[str]) -> None:
root = Path(__file__).parent
source = IniSource(Path('/tmp/does/not/exist'), '') # nosec
source = IniSource(Path('/tmp/does/not/exist'), '') # noqa: S108
parsed = Parsed(override=(), root_dir=root, work_dir=root)
state = State(Options(parsed, None, source, sentinel.cmd_handlers, sentinel.tox_handler), [])

Expand Down
17 changes: 7 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
isolated_build = true
minversion = 4.4.0
envlist =
clear-coverage
quality
Expand All @@ -20,13 +20,15 @@ deps =
tox3: tox == 3.*
tox414: tox == 4.*,<4.15
tox4: tox == 4.*
skip_install =
coverage: true
commands =
coverage run --parallel-mode --include=tox_ipdb.py,tests.py --branch -m unittest {posargs:discover}
constrain_package_deps = true
use_frozen_constraints = true

[testenv:clear-coverage]
depends =
# Use single virtualenv for both coverage envs.
envdir = {toxworkdir}/coverage
commands =
coverage erase

Expand All @@ -37,8 +39,6 @@ depends =
py310-tox{3,414,4}
py311-tox{3,414,4}
py312-tox{3,414,4}
# Use single virtualenv for both coverage envs.
envdir = {toxworkdir}/coverage
parallel_show_output = true
commands =
coverage combine
Expand All @@ -51,9 +51,6 @@ extras =
# Do not fail on first error, but run all the checks
ignore_errors = true
commands =
isort --check-only --diff tox_ipdb.py tests.py
flake8 --format=pylint --show-source tox_ipdb.py tests.py
bandit --recursive tox_ipdb.py tests.py
pydocstyle tox_ipdb.py
mypy --show-error-codes tox_ipdb.py tests.py
ruff check tox_ipdb.py tests.py
mypy tox_ipdb.py tests.py
doc8 CHANGELOG.rst README.rst

0 comments on commit 600744f

Please sign in to comment.