From a9b53b908aad6b0cda11a19a6cc2e25d0183eeb9 Mon Sep 17 00:00:00 2001 From: kelu-wandb Date: Wed, 13 May 2026 11:38:43 -0700 Subject: [PATCH] build(sweeps): align make format with CI, remove python 3.9 support --- .circleci/config.yml | 39 --------------------------------------- .pre-commit-config.yaml | 10 +++++++++- Makefile | 10 +++------- README.md | 2 +- requirements.dev.txt | 6 +++--- setup.py | 8 +++----- tox.ini | 18 ++++++------------ 7 files changed, 25 insertions(+), 68 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 8179710c..6f4d50a6 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -5,27 +5,6 @@ orbs: codecov: codecov/codecov@5.0.3 jobs: - linux39: - machine: - image: ubuntu-2204:2024.11.1 - steps: - - checkout - - run: - name: Install python - command: pyenv install 3.9 - - run: - name: Load python - command: pyenv global 3.9 - - run: - name: Run tests - command: pip install tox==3.24.0 && tox -e py39 - no_output_timeout: 60m - - codecov/upload - - store_artifacts: - path: prof/ - - store_test_results: - path: . - resource_class: large linux310: machine: image: ubuntu-2204:2024.11.1 @@ -89,19 +68,6 @@ jobs: - store_test_results: path: . resource_class: large - linters39: - docker: - - image: cimg/python:3.9 - steps: - - checkout - - run: - name: Install dependencies - command: pip install -r requirements.dev.txt - - run: - name: Run linters - command: | - pre-commit run --all-files - mypy --ignore-missing-imports --scripts-are-modules . linters310: docker: - image: cimg/python:3.10 @@ -114,7 +80,6 @@ jobs: name: Run linters command: | pre-commit run --all-files - mypy --ignore-missing-imports --scripts-are-modules . linters311: docker: - image: cimg/python:3.11 @@ -127,7 +92,6 @@ jobs: name: Run linters command: | pre-commit run --all-files - mypy --ignore-missing-imports --scripts-are-modules . linters312: docker: - image: cimg/python:3.12 @@ -140,16 +104,13 @@ jobs: name: Run linters command: | pre-commit run --all-files - mypy --ignore-missing-imports --scripts-are-modules . workflows: main: jobs: - - linux39 - linux310 - linux311 - linux312 - - linters39 - linters310 - linters311 - linters312 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8989ecb2..6d90e960 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,8 +12,16 @@ repos: - id: black pass_filenames: true - repo: https://github.com/pycqa/flake8 - rev: 5.0.4 + rev: 7.3.0 hooks: - id: flake8 pass_filenames: true + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.14.1 + hooks: + - id: mypy + args: ["--ignore-missing-imports", "--scripts-are-modules", "."] + additional_dependencies: ["types-PyYAML==5.4.3"] + pass_filenames: false + always_run: true exclude: setup.cfg diff --git a/Makefile b/Makefile index 63b12dc2..4b52a311 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,3 @@ -lint: - pre-commit run --all-files - mypy --scripts-are-modules --ignore-missing-imports . - dist: clean ## builds source and wheel package python setup.py sdist bdist_wheel ls -l dist @@ -30,16 +26,16 @@ clean-pyc: ## remove Python file artifacts find . -name '__pycache__' -exec rm -fr {} + test: - tox -e "black,flake8,py39" + tox -e "black,flake8,py310" test-full: tox test-short: - tox -e "py39" + tox -e "py310" format: - tox -e format + pre-commit run --all-files release: dist ## package and upload release pip install -qq twine diff --git a/README.md b/README.md index 52393431..2def54e6 100644 --- a/README.md +++ b/README.md @@ -172,7 +172,7 @@ pip install -r requirements.dev.txt Install the pre-commit hooks: ``` -pre-commit install . +pre-commit install ``` Run formatting and tests: diff --git a/requirements.dev.txt b/requirements.dev.txt index 4e3c1848..7ebaff9b 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,7 +1,7 @@ -r requirements.txt -pre-commit==2.12.0 -black==22.3.0 -flake8==3.9.1 +pre-commit==4.6.0 +black==22.8.0 +flake8==7.3.0 types-PyYAML==5.4.3 mypy==1.14.1 tox>=3.24.0 diff --git a/setup.py b/setup.py index 89d3e3fe..e97fd7d7 100644 --- a/setup.py +++ b/setup.py @@ -21,7 +21,7 @@ install_requires=requirements, license="MIT license", zip_safe=False, - python_requires=">=3.6", + python_requires=">=3.10", classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", @@ -29,11 +29,9 @@ "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", "Topic :: Scientific/Engineering :: Artificial Intelligence", "Topic :: Software Development :: Libraries :: Python Modules", ], diff --git a/tox.ini b/tox.ini index ee9eed29..77f1a61c 100644 --- a/tox.ini +++ b/tox.ini @@ -1,8 +1,8 @@ [tox] minversion=3.24.0 -envlist = py{39,310,311,312} +envlist = py{310,311,312} -[testenv:py{39,310,311,312}] +[testenv:py{310,311,312}] deps = -r{toxinidir}/requirements.test.txt @@ -14,7 +14,7 @@ commands = [black] deps= - black==22.3.0 + black==22.8.0 [testenv:black] basepython = python3 @@ -23,24 +23,18 @@ deps = {[black]deps} commands = black --check src/ tests/ tools/ examples/ -[isort] -profile = black -multi_line_output = 3 - [testenv:format] basepython = python3 skip_install = true deps= - {[black]deps} - isort==4.3.21 + pre-commit==4.6.0 commands = - isort --recursive src/ tests/ tools/ examples/ - black src/ tests/ tools/ examples/ + pre-commit run --all-files [flake8] max-line-length = 80 select = C,E,F,W,B,B950 -ignore = E501, W503 +ignore = E501, E721, W503 deps = flake8 flake8-colors