Skip to content

Commit 2be1bbb

Browse files
committed
Merge branch 'update-project-setup'
2 parents 91f6639 + 600744f commit 2be1bbb

File tree

6 files changed

+44
-37
lines changed

6 files changed

+44
-37
lines changed

.github/workflows/tests.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,11 @@ jobs:
1616
max-parallel: 4
1717
matrix:
1818
python:
19-
- "3.7"
2019
- "3.8"
2120
- "3.9"
2221
- "3.10"
22+
- "3.11"
23+
- "3.12"
2324
steps:
2425
- uses: actions/checkout@v3
2526
- name: Set up Python

pyproject.toml

+23
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,26 @@
11
[build-system]
22
requires = ["setuptools"]
33
build-backend = "setuptools.build_meta"
4+
5+
[tool.ruff]
6+
target-version = "py38"
7+
line-length = 120
8+
9+
[tool.ruff.lint]
10+
select = ["E", "W", "F", "C", "I", "D", "S", "UP", "B", "ISC", "G", "RSE"]
11+
ignore = ["D105", "D106", "D107", "UP032"]
12+
13+
[tool.ruff.lint.per-file-ignores]
14+
"tests.py" = ["D1", "S101", "S105", "S106", "S107", "B015", "B018"]
15+
16+
[tool.ruff.lint.isort]
17+
combine-as-imports = true
18+
19+
[tool.ruff.lint.mccabe]
20+
max-complexity = 10
21+
22+
[tool.ruff.lint.pycodestyle]
23+
max-doc-length = 120
24+
25+
[tool.ruff.lint.pydocstyle]
26+
convention = "google"

setup.cfg

+4-19
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ classifiers =
1515
License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
1616
Operating System :: OS Independent
1717
Programming Language :: Python
18-
Programming Language :: Python :: 3.7
1918
Programming Language :: Python :: 3.8
2019
Programming Language :: Python :: 3.9
2120
Programming Language :: Python :: 3.10
21+
Programming Language :: Python :: 3.11
22+
Programming Language :: Python :: 3.12
2223
Topic :: Software Development
2324
Topic :: Software Development :: Debuggers
2425
Topic :: Software Development :: Testing
2526

2627
[options]
2728
py_modules =
2829
tox_ipdb
29-
python_requires = ~=3.7
30+
python_requires = ~=3.8
3031
install_requires =
3132
tox>=3.0
3233

@@ -36,25 +37,14 @@ tox =
3637

3738
[options.extras_require]
3839
quality =
39-
bandit
4040
doc8
41-
flake8
42-
isort
4341
mypy
44-
pydocstyle
42+
ruff
4543

4644
[doc8]
4745
max-line-length = 120
4846
allow-long-titles = true
4947

50-
[flake8]
51-
max-line-length = 120
52-
max-complexity = 10
53-
54-
[isort]
55-
line_length = 120
56-
combine_as_imports = true
57-
5848
[mypy]
5949
ignore_missing_imports = true
6050
disallow_untyped_defs = true
@@ -66,8 +56,3 @@ warn_unused_ignores = false
6656

6757
[mypy-tests]
6858
disallow_untyped_defs = false
69-
70-
[pydocstyle]
71-
convention = google
72-
add_ignore = D105,D106,D107
73-
add_select = D204,D400,D401

tests.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def test_other_env(self):
8787
class ToxAddEnvConfigTest(TestCase):
8888
def _test(self, env_name: str, initial_deps: str, result: List[str]) -> None:
8989
root = Path(__file__).parent
90-
source = IniSource(Path('/tmp/does/not/exist'), '') # nosec
90+
source = IniSource(Path('/tmp/does/not/exist'), '') # noqa: S108
9191
parsed = Parsed(override=(), root_dir=root, work_dir=root)
9292
state = State(Options(parsed, None, source, sentinel.cmd_handlers, sentinel.tox_handler), [])
9393

tox.ini

+12-13
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,44 @@
11
[tox]
2-
isolated_build = true
2+
minversion = 4.4.0
33
envlist =
44
clear-coverage
55
quality
6-
py37-tox{3,414,4}
76
py38-tox{3,414,4}
87
py39-tox{3,414,4}
98
py310-tox{3,414,4}
9+
py311-tox{3,414,4}
10+
py312-tox{3,414,4}
1011
compute-coverage
1112
skip_missing_interpreters = true
1213

1314
[testenv]
1415
depends = clear-coverage
1516
setenv =
16-
py37,py38,py39,py310: PYTHONWARNINGS = {env:PYTHONWARNINGS:all}
17+
py38,py39,py310,py311,py312: PYTHONWARNINGS = {env:PYTHONWARNINGS:all}
1718
deps =
1819
coverage
1920
tox3: tox == 3.*
2021
tox414: tox == 4.*,<4.15
2122
tox4: tox == 4.*
23+
skip_install =
24+
coverage: true
2225
commands =
2326
coverage run --parallel-mode --include=tox_ipdb.py,tests.py --branch -m unittest {posargs:discover}
27+
constrain_package_deps = true
28+
use_frozen_constraints = true
2429

2530
[testenv:clear-coverage]
2631
depends =
27-
# Use single virtualenv for both coverage envs.
28-
envdir = {toxworkdir}/coverage
2932
commands =
3033
coverage erase
3134

3235
[testenv:compute-coverage]
3336
depends =
34-
py37-tox{3,414,4}
3537
py38-tox{3,414,4}
3638
py39-tox{3,414,4}
3739
py310-tox{3,414,4}
38-
# Use single virtualenv for both coverage envs.
39-
envdir = {toxworkdir}/coverage
40+
py311-tox{3,414,4}
41+
py312-tox{3,414,4}
4042
parallel_show_output = true
4143
commands =
4244
coverage combine
@@ -49,9 +51,6 @@ extras =
4951
# Do not fail on first error, but run all the checks
5052
ignore_errors = true
5153
commands =
52-
isort --check-only --diff tox_ipdb.py tests.py
53-
flake8 --format=pylint --show-source tox_ipdb.py tests.py
54-
bandit --recursive tox_ipdb.py tests.py
55-
pydocstyle tox_ipdb.py
56-
mypy --show-error-codes tox_ipdb.py tests.py
54+
ruff check tox_ipdb.py tests.py
55+
mypy tox_ipdb.py tests.py
5756
doc8 CHANGELOG.rst README.rst

tox_ipdb.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
11
"""Tox plugin which installs ipdb in tox environments."""
22
import logging
3-
from distutils.version import LooseVersion
43

54
import tox
65

76
__version__ = '0.3'
87
_LOGGER = logging.getLogger(__name__)
98

109

11-
if LooseVersion(tox.__version__) < LooseVersion('4.0.0'):
10+
if tox.__version__ < '4':
1211
# TOX 3
1312
from tox import hookimpl # type: ignore[attr-defined]
1413
from tox.action import Action
@@ -60,7 +59,7 @@ def tox_add_env_config(env_conf: EnvConfigSet, state: State) -> None:
6059

6160
override = Override('{}.deps={}'.format(env_conf.name, '\n'.join(new_deps)))
6261
# API changed in tox 4.15.0
63-
if LooseVersion(tox.__version__) < LooseVersion('4.15.0'):
62+
if tox.__version__ < '4.15':
6463
env_conf.loaders[0].overrides[override.key] = override # type: ignore[assignment]
6564
else:
6665
env_conf.loaders[0].overrides.setdefault(override.key, []).append(override)

0 commit comments

Comments
 (0)