diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 12962111..bd294b03 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -56,7 +56,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.7 - 3.10" # sync with requires-python in pyproject.toml + python-version: "3.8 - 3.10" # sync with requires-python in pyproject.toml update-environment: true - name: Set __release__ @@ -96,14 +96,14 @@ jobs: run: | make pytest - build-wheels-py37: + build-wheels-py38: name: Build wheels for Python ${{ matrix.python-version }} on ubuntu-latest runs-on: ubuntu-latest needs: [build] if: github.repository == 'metaopt/torchopt' && (github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) strategy: matrix: - python-version: ["3.7"] # sync with requires-python in pyproject.toml + python-version: ["3.8"] # sync with requires-python in pyproject.toml fail-fast: false timeout-minutes: 60 steps: @@ -142,18 +142,18 @@ jobs: - uses: actions/upload-artifact@v3 with: - name: wheels-py37 + name: wheels-py38 path: wheelhouse/*.whl if-no-files-found: error build-wheels: name: Build wheels for Python ${{ matrix.python-version }} on ubuntu-latest runs-on: ubuntu-latest - needs: [build, build-wheels-py37] + needs: [build, build-wheels-py38] if: github.repository == 'metaopt/torchopt' && (github.event_name != 'push' || startsWith(github.ref, 'refs/tags/')) strategy: matrix: - python-version: ["3.8", "3.9", "3.10"] # sync with requires-python in pyproject.toml + python-version: ["3.9", "3.10"] # sync with requires-python in pyproject.toml fail-fast: false timeout-minutes: 60 steps: @@ -198,7 +198,7 @@ jobs: publish: runs-on: ubuntu-latest - needs: [build, build-wheels-py37, build-wheels] + needs: [build, build-wheels-py38, build-wheels] if: | github.repository == 'metaopt/torchopt' && github.event_name != 'pull_request' && (github.event_name != 'workflow_dispatch' || github.event.inputs.task == 'build-and-publish') && @@ -215,7 +215,7 @@ jobs: uses: actions/setup-python@v4 if: startsWith(github.ref, 'refs/tags/') with: - python-version: "3.7 - 3.11" # sync with requires-python in pyproject.toml + python-version: "3.8 - 3.11" # sync with requires-python in pyproject.toml update-environment: true - name: Set __release__ @@ -249,7 +249,7 @@ jobs: with: # unpacks default artifact into dist/ # if `name: artifact` is omitted, the action will create extra parent dir - name: wheels-py37 + name: wheels-py38 path: dist - name: Download built wheels diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 59678338..4f6fad50 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,10 +41,10 @@ jobs: submodules: "recursive" fetch-depth: 1 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml) + python-version: "3.8" # the lowest version we support (sync with requires-python in pyproject.toml) update-environment: true - name: Setup CUDA Toolkit @@ -111,10 +111,10 @@ jobs: submodules: "recursive" fetch-depth: 1 - - name: Set up Python 3.7 + - name: Set up Python 3.8 uses: actions/setup-python@v4 with: - python-version: "3.7" # the lowest version we support (sync with requires-python in pyproject.toml) + python-version: "3.8" # the lowest version we support (sync with requires-python in pyproject.toml) update-environment: true - name: Upgrade pip diff --git a/.gitignore b/.gitignore index 450d7b0c..350ddfb2 100644 --- a/.gitignore +++ b/.gitignore @@ -146,6 +146,9 @@ venv.bak/ # mkdocs documentation /site +# ruff +.ruff_cache/ + # mypy .mypy_cache/ .dmypy.json diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 4e5ddd14..f943f89f 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -48,7 +48,7 @@ repos: rev: v3.3.1 hooks: - id: pyupgrade - args: [--py37-plus] # sync with requires-python + args: [--py38-plus] # sync with requires-python stages: [commit, push, manual] exclude: | (?x)( diff --git a/.pylintrc b/.pylintrc index accc71d5..a21967ee 100644 --- a/.pylintrc +++ b/.pylintrc @@ -84,7 +84,7 @@ persistent=yes # Minimum Python version to use for version dependent checks. Will default to # the version used to run pylint. -py-version=3.7 # the lowest version we support (sync with requires-python in pyproject.toml) +py-version=3.8 # the lowest version we support (sync with requires-python in pyproject.toml) # Discover python modules and packages in the file system subtree. recursive=no diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b2a2899..3a884496 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,7 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Removed -- +- Drop Python 3.7 support by [@XuehaiPan](https://github.com/XuehaiPan) in [#136](https://github.com/metaopt/torchopt/pull/136). ------ diff --git a/Makefile b/Makefile index 750b9d9f..bd839812 100644 --- a/Makefile +++ b/Makefile @@ -68,11 +68,7 @@ pre-commit-install: docs-install: $(call check_pip_install_extra,pydocstyle,pydocstyle[toml]) - $(call check_pip_install_extra,doc8,"doc8<1.0.0a0") - if ! $(PYTHON) -c "import sys; exit(sys.version_info < (3, 8))"; then \ - $(PYTHON) -m pip uninstall --yes importlib-metadata; \ - $(call check_pip_install_extra,importlib-metadata,"importlib-metadata<5.0.0a0"); \ - fi + $(call check_pip_install,doc8) $(call check_pip_install,sphinx) $(call check_pip_install,sphinx-rtd-theme) $(call check_pip_install,sphinx-autoapi) @@ -202,6 +198,7 @@ format: py-format-install ruff-install clang-format-install addlicense-install clean-py: find . -type f -name '*.py[co]' -delete find . -depth -type d -name "__pycache__" -exec rm -r "{}" + + find . -depth -type d -name ".ruff_cache" -exec rm -r "{}" + find . -depth -type d -name ".mypy_cache" -exec rm -r "{}" + find . -depth -type d -name ".pytest_cache" -exec rm -r "{}" + rm tests/.coverage diff --git a/README.md b/README.md index 8c8bd8f6..fe149970 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@