diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index 7ad16f0..dcba4b5 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -24,11 +24,11 @@ jobs: strategy: matrix: python-version: [ - '3.10', '3.11', '3.12', '3.13', '3.14', + '3.15', ] steps: @@ -37,16 +37,20 @@ jobs: uses: actions/setup-python@v7 with: python-version: ${{ matrix.python-version }} + cache: 'pip' - name: Install dependencies run: | python -m pip install --upgrade pip - cd python && pip install .[dev] + cd python && pip install . --group test - name: Run tests run: cd python && tox env: TOX_GH_MAJOR_MINOR: ${{ matrix.python-version }} - - uses: astral-sh/ruff-action@v3 + - uses: astral-sh/ruff-action@v4.1.0 with: src: "./python" + args: "--version" + - name: Lint code + run: ruff check -v - name: Check formatting - run: cd python && black --check . + run: ruff format -v diff --git a/python/.gitignore b/python/.gitignore index 25aacff..0cebcfc 100644 --- a/python/.gitignore +++ b/python/.gitignore @@ -1,3 +1,4 @@ build/ dist/ *.egg-info/ +*.lock diff --git a/python/MANIFEST.in b/python/MANIFEST.in index fce3334..509e6a6 100644 --- a/python/MANIFEST.in +++ b/python/MANIFEST.in @@ -1,6 +1,5 @@ include README.rst include LICENSE -include tox.ini recursive-include http_ece/tests * global-exclude */__pycache__/* diff --git a/python/http_ece/tests/test_ece.py b/python/http_ece/tests/test_ece.py index 3d9f713..c0f09b3 100644 --- a/python/http_ece/tests/test_ece.py +++ b/python/http_ece/tests/test_ece.py @@ -30,7 +30,6 @@ def logbuf(msg, buf): logmsg(msg + ": [" + str(len(buf)) + "]") for i in list(range(0, len(buf), 48)): logmsg(" " + repr(buf[i : i + 48])) - return def b64e(arg): diff --git a/python/pyproject.toml b/python/pyproject.toml index 9f07f0a..38f447b 100644 --- a/python/pyproject.toml +++ b/python/pyproject.toml @@ -6,30 +6,36 @@ build-backend = "setuptools.build_meta" name = "http_ece" version = "1.2.1" license = "MIT" +license-files = ["LICENSE"] authors = [{ name = "Martin Thomson", email = "martin.thomson@gmail.com" }] keywords = ["crypto http"] classifiers = [ "Development Status :: 4 - Beta", - "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", "Programming Language :: Python :: 3.14", + "Programming Language :: Python :: 3.15", ] description = "Encrypted Content Encoding for HTTP" readme = { file = "README.rst", content-type = "text/x-rst" } -requires-python = ">=3.10" +requires-python = ">=3.11" dependencies = ["cryptography>=46.0.1"] -[project.optional-dependencies] -dev = [ - "black>=26.3.1", - "pytest", +[dependency-groups] +lint = [ + "ruff==0.17.4", +] +test = [ + "pytest>=9", "pytest-cov", - "ruff==0.14.10", - "tox", + "tox>=4.22", "tox-gh", ] +dev = [ + { include-group = "lint" }, + { include-group = "test" }, +] [project.urls] Repository = "https://github.com/web-push-libs/encrypted-content-encoding" @@ -52,3 +58,26 @@ lint.select = ["A", "F", "FURB", "I", "PERF", "PT", "PTH", "RUF", "S", "UP"] [tool.setuptools] packages = ["http_ece"] + +[tool.tox] +env_list = [ + "py311", + "py312", + "py313", + "py314", + "py315", +] + +[tool.tox.env_run_base] +description = "run tests with pytest under {base_python}" +dependency_groups = ["test"] +commands = [ + ["pytest", "{posargs}"], +] + +[tool.tox.gh.python] +"3.11" = ["py311"] +"3.12" = ["py312"] +"3.13" = ["py313"] +"3.14" = ["py314"] +"3.15" = ["py315"] diff --git a/python/tox.ini b/python/tox.ini deleted file mode 100644 index 800e88b..0000000 --- a/python/tox.ini +++ /dev/null @@ -1,31 +0,0 @@ -# Tox (http://tox.testrun.org/) is a tool for running tests -# in multiple virtualenvs. This configuration file will run the -# test suite on all supported python versions. To use it, "pip install tox" -# and then run "tox" from this directory. - -[tox] -envlist = py310,py311,py312,py313,py314 - -[gh] -; Github Action -python = - 3.10 = py310 - 3.11 = py311 - 3.12 = py312 - 3.13 = py313 - 3.14 = py314 - -[testenv] -basepython = - py310: python3.10 - py311: python3.11 - py312: python3.12 - py313: python3.13 - py314: python3.14 -commands = - pytest \ - [] -deps = - pytest - pytest-cov - flake8