From d70f06b862ba8635a88373ceaae1f643fe1104f9 Mon Sep 17 00:00:00 2001 From: Peter Lithammer Date: Mon, 2 Oct 2023 23:26:03 +0200 Subject: [PATCH] chore: add support for Python 3.12 --- .github/workflows/python.yml | 2 +- Makefile | 5 ++--- pyproject.toml | 28 +++++++++++++++------------- requirements.txt | 10 +++++----- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/.github/workflows/python.yml b/.github/workflows/python.yml index c740cc2..c80313c 100644 --- a/.github/workflows/python.yml +++ b/.github/workflows/python.yml @@ -17,7 +17,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [ubuntu-20.04, windows-2019, macos-11] + os: [ubuntu-22.04, windows-2019, macos-12] steps: - uses: actions/checkout@v4 diff --git a/Makefile b/Makefile index e69af22..64c2eb7 100644 --- a/Makefile +++ b/Makefile @@ -10,6 +10,7 @@ compile_commands.json: .PHONY: build build: $(VIRTUALENV)/freeze.txt +$(VIRTUALENV): $(VIRTUALENV)/freeze.txt $(VIRTUALENV)/freeze.txt: requirements.txt $(PYTHON) -m venv $(@D) $(BINDIR)/pip install -U pip setuptools wheel @@ -22,9 +23,7 @@ test: $(VIRTUALENV) .PHONY: lint lint: $(VIRTUALENV) - $(BINDIR)/black --check src - $(BINDIR)/flake8 src - $(BINDIR)/mypy src + $(BINDIR)/tox -e black,mypy,ruff .PHONY: clean clean: diff --git a/pyproject.toml b/pyproject.toml index d7bfaa6..8010523 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ classifiers = [ "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", ] keywords = ["jump", "consistent", "hash", "jumphash", "algorithm"] @@ -50,7 +51,7 @@ archs = ["auto", "aarch64"] [tool.black] line-length = 79 -target-version = ["py36"] +target-version = ["py38"] [tool.mypy] check_untyped_defs = true @@ -60,25 +61,26 @@ pretty = true show_column_numbers = true warn_unused_configs = true +[tool.ruff] +select = ["E", "F", "I"] +ignore = ["E501"] + +[tool.ruff.isort] +force-sort-within-sections = true +order-by-type = true + [tool.tox] legacy_tox_ini = """ [tox] -envlist = py{38,39,310,311},black,flake8,mypy - -[gh-actions] -python = - 3.8: py38 - 3.9: py39 - 3.10: py310 - 3.11: py311, black, flake8, mypy +envlist = py{38,39,310,311,312},black,mypy,ruff [testenv:black] deps = black commands = black --check src tests setup.py -[testenv:flake8] -deps = flake8 -commands = flake8 src tests setup.py +[testenv:ruff] +deps = ruff +commands = ruff src tests setup.py [testenv:mypy] deps = mypy @@ -87,7 +89,7 @@ commands = mypy src [testenv] setenv = PIP_CONSTRAINT = requirements.txt -passenv = PYTEST_ADDOPTS CFLAGS +passenv = PYTEST_ADDOPTS,CFLAGS deps = pytest commands = pytest {posargs} """ diff --git a/requirements.txt b/requirements.txt index c89cbf5..4037221 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ -black==22.10.0 -flake8==5.0.4 -mypy==0.982 -pytest==7.2.0 -tox==3.26.0 +black==23.9.1 +ruff==0.0.292 +mypy==1.5.1 +pytest==7.4.2 +tox==4.11.3