From 05076c3f402521e12ad8b714f5b2317f54ed6ea6 Mon Sep 17 00:00:00 2001 From: Rene Leonhardt <65483435+reneleonhardt@users.noreply.github.com> Date: Mon, 7 Apr 2025 13:46:49 +0200 Subject: [PATCH] chore(deps): Support Python 3.13 and drop 3.9 Closes #3037 --- .github/workflows/check_pypi_version.yml | 2 +- .github/workflows/ubuntu-tests.yml | 2 +- .github/workflows/windows-tests.yml | 3 +-- .github/workflows/windows_check_pypi_version.yml | 2 +- CONTRIBUTING.md | 6 +++--- aider/website/docs/install.md | 5 ++--- pyproject.toml | 3 ++- requirements.txt | 12 +++++------- requirements/common-constraints.txt | 12 +++++++----- requirements/pydub.in | 2 ++ requirements/requirements-browser.txt | 3 +-- requirements/requirements-dev.txt | 6 +++++- requirements/requirements-help.in | 10 +++++----- requirements/requirements-help.txt | 8 +++++--- requirements/tree-sitter.in | 1 - scripts/pip-compile.sh | 8 +++++--- 16 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 requirements/pydub.in diff --git a/.github/workflows/check_pypi_version.yml b/.github/workflows/check_pypi_version.yml index b383e87be..7fadeba54 100644 --- a/.github/workflows/check_pypi_version.yml +++ b/.github/workflows/check_pypi_version.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Set up Python ${{ matrix.python-version }} diff --git a/.github/workflows/ubuntu-tests.yml b/.github/workflows/ubuntu-tests.yml index 753470af0..a849af008 100644 --- a/.github/workflows/ubuntu-tests.yml +++ b/.github/workflows/ubuntu-tests.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Check out repository diff --git a/.github/workflows/windows-tests.yml b/.github/workflows/windows-tests.yml index f79f84b66..a4dee9e0f 100644 --- a/.github/workflows/windows-tests.yml +++ b/.github/workflows/windows-tests.yml @@ -25,7 +25,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] steps: - name: Check out repository @@ -49,4 +49,3 @@ jobs: AIDER_ANALYTICS: false run: | pytest - diff --git a/.github/workflows/windows_check_pypi_version.yml b/.github/workflows/windows_check_pypi_version.yml index 6bd48fdf6..00867282f 100644 --- a/.github/workflows/windows_check_pypi_version.yml +++ b/.github/workflows/windows_check_pypi_version.yml @@ -15,7 +15,7 @@ jobs: runs-on: windows-latest strategy: matrix: - python-version: ["3.10", "3.11", "3.12"] + python-version: ["3.10", "3.11", "3.12", "3.13"] defaults: run: shell: pwsh # Use PowerShell for all run steps diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index abe35a1c0..ea08cd610 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -50,7 +50,7 @@ cd aider It is recommended to create a virtual environment outside of the repository to keep your development environment isolated. -#### Using `venv` (Python 3.9 and later) +#### Using `venv` (Python 3.10 and later) ``` python -m venv /path/to/venv @@ -155,7 +155,7 @@ The built documentation will be available in the `aider/website/_site` directory ### Python Compatibility -Aider supports Python versions 3.9, 3.10, 3.11, and 3.12. When contributing code, ensure compatibility with these supported Python versions. +Aider supports Python versions 3.10, 3.11, 3.12, and 3.13. When contributing code, ensure compatibility with these supported Python versions. ### Code Style @@ -188,7 +188,7 @@ pytest tests/basic/test_coder.py::TestCoder::test_specific_case The project uses GitHub Actions for continuous integration. The testing workflows are defined in the following files: -- `.github/workflows/ubuntu-tests.yml`: Runs tests on Ubuntu for Python versions 3.9 through 3.12. +- `.github/workflows/ubuntu-tests.yml`: Runs tests on Ubuntu for Python versions 3.10 through 3.13. - `.github/workflows/windows-tests.yml`: Runs that on Windows These workflows are triggered on push and pull request events to the `main` branch, ignoring changes to the `aider/website/**` and `README.md` files. diff --git a/aider/website/docs/install.md b/aider/website/docs/install.md index 0ebf1d2e2..5d52a2524 100644 --- a/aider/website/docs/install.md +++ b/aider/website/docs/install.md @@ -75,7 +75,7 @@ python -m pip install pipx # If you need to install pipx pipx install aider-chat ``` -You can use pipx to install aider with python versions 3.9-3.12. +You can use pipx to install aider with python versions 3.10-3.13. Also see the [docs on other methods for installing pipx itself](https://pipx.pypa.io/stable/installation/). @@ -93,7 +93,7 @@ using a to keep aider's dependencies separated. -You can use pip to install aider with python versions 3.9-3.12. +You can use pip to install aider with python versions 3.10-3.13. ```bash python -m pip install -U --upgrade-strategy only-if-needed aider-chat @@ -112,4 +112,3 @@ they often install aider with incorrect dependencies. There are some [optional install steps](/docs/install/optional.html) you could consider. See the [usage instructions](https://aider.chat/docs/usage.html) to start coding with aider. - diff --git a/pyproject.toml b/pyproject.toml index e92d278d4..5569bf2b7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,10 +12,11 @@ classifiers = [ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python", "Topic :: Software Development", ] -requires-python = ">=3.10,<3.13" +requires-python = ">=3.10,<3.14" dynamic = ["dependencies", "optional-dependencies", "version"] [project.urls] diff --git a/requirements.txt b/requirements.txt index d26543ad1..90b1da5b1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -250,7 +250,7 @@ networkx==3.4.2 # via # -c requirements/common-constraints.txt # -r requirements/requirements.in -numpy==1.26.4 +numpy==2.2.4 # via # -c requirements/common-constraints.txt # scipy @@ -463,9 +463,6 @@ tqdm==4.67.1 # google-generativeai # huggingface-hub # openai - # via - # -c requirements/common-constraints.txt - # tree-sitter-language-pack tree-sitter-c-sharp==0.23.1 # via # -c requirements/common-constraints.txt @@ -485,14 +482,12 @@ tree-sitter-yaml==0.7.0 typing-extensions==4.13.2 # via # -c requirements/common-constraints.txt - # anyio # beautifulsoup4 # google-generativeai # huggingface-hub # openai # pydantic # pydantic-core - # referencing # typing-inspection typing-inspection==0.4.0 # via @@ -523,6 +518,9 @@ zipp==3.21.0 # via # -c requirements/common-constraints.txt # importlib-metadata - + tree-sitter==0.23.2; python_version < "3.10" tree-sitter==0.24.0; python_version >= "3.10" + +# Remove if Python 3.13 support https://github.com/jiaaro/pydub/pull/816 gets released +audioop-lts>=0.2.1; python_version >= "3.13" diff --git a/requirements/common-constraints.txt b/requirements/common-constraints.txt index 122473cc7..8e13c8d73 100644 --- a/requirements/common-constraints.txt +++ b/requirements/common-constraints.txt @@ -282,7 +282,7 @@ nltk==3.9.1 # via llama-index-core nodeenv==1.9.1 # via pre-commit -numpy==1.26.4 +numpy==2.2.4 # via # -r requirements/requirements-help.in # contourpy @@ -295,7 +295,7 @@ numpy==1.26.4 # soundfile # streamlit # transformers -openai==1.75.0 +openai==1.76.0 # via litellm oslex==0.1.3 # via -r requirements/requirements.in @@ -529,7 +529,7 @@ tokenizers==0.21.1 # transformers toml==0.10.2 # via streamlit -torch==2.2.2 +torch==2.6.0 # via # -r requirements/requirements-help.in # sentence-transformers @@ -561,7 +561,6 @@ typer==0.15.3 typing-extensions==4.13.2 # via # altair - # anyio # beautifulsoup4 # google-generativeai # huggingface-hub @@ -570,7 +569,6 @@ typing-extensions==4.13.2 # pydantic # pydantic-core # pyee - # referencing # sentence-transformers # sqlalchemy # streamlit @@ -610,3 +608,7 @@ yarl==1.20.0 # via aiohttp zipp==3.21.0 # via importlib-metadata + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/requirements/pydub.in b/requirements/pydub.in new file mode 100644 index 000000000..483a11d83 --- /dev/null +++ b/requirements/pydub.in @@ -0,0 +1,2 @@ +# Remove if Python 3.13 support https://github.com/jiaaro/pydub/pull/816 gets released +audioop-lts>=0.2.1; python_version >= "3.13" diff --git a/requirements/requirements-browser.txt b/requirements/requirements-browser.txt index 3f9dbbbc5..f455fa4bd 100644 --- a/requirements/requirements-browser.txt +++ b/requirements/requirements-browser.txt @@ -62,7 +62,7 @@ narwhals==1.38.2 # via # -c requirements/common-constraints.txt # altair -numpy==1.26.4 +numpy==2.2.4 # via # -c requirements/common-constraints.txt # pandas @@ -143,7 +143,6 @@ typing-extensions==4.13.2 # via # -c requirements/common-constraints.txt # altair - # referencing # streamlit tzdata==2025.2 # via diff --git a/requirements/requirements-dev.txt b/requirements/requirements-dev.txt index 4d49ef191..2a5ed21ca 100644 --- a/requirements/requirements-dev.txt +++ b/requirements/requirements-dev.txt @@ -143,7 +143,7 @@ nodeenv==1.9.1 # via # -c requirements/common-constraints.txt # pre-commit -numpy==1.26.4 +numpy==2.2.4 # via # -c requirements/common-constraints.txt # contourpy @@ -309,3 +309,7 @@ wheel==0.45.1 # via # -c requirements/common-constraints.txt # pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/requirements/requirements-help.in b/requirements/requirements-help.in index 43e302cca..1bddc8d02 100644 --- a/requirements/requirements-help.in +++ b/requirements/requirements-help.in @@ -1,11 +1,11 @@ llama-index-embeddings-huggingface -# Because sentence-transformers doesn't like >=2 -numpy<2 +# sentence-transformers 4 requires numpy 2 (indirectly through scipy 1.14 which dropped Python 3.9 support) +numpy>=2 -# Mac x86 only supports 2.2.2 +# Drop Mac x86 support # https://discuss.pytorch.org/t/why-no-macosx-x86-64-build-after-torch-2-2-2-cp39-none-macosx-10-9-x86-64-whl/204546/2 -torch==2.2.2 +torch>2.2.2 # Later versions break test_help in GitHub Actions on Windows and Ubuntu -llama-index-core==0.12.26 \ No newline at end of file +llama-index-core==0.12.26 diff --git a/requirements/requirements-help.txt b/requirements/requirements-help.txt index 2559b273f..3fd49588b 100644 --- a/requirements/requirements-help.txt +++ b/requirements/requirements-help.txt @@ -172,7 +172,7 @@ nltk==3.9.1 # via # -c requirements/common-constraints.txt # llama-index-core -numpy==1.26.4 +numpy==2.2.4 # via # -c requirements/common-constraints.txt # -r requirements/requirements-help.in @@ -273,7 +273,7 @@ tokenizers==0.21.1 # via # -c requirements/common-constraints.txt # transformers -torch==2.2.2 +torch==2.6.0 # via # -c requirements/common-constraints.txt # -r requirements/requirements-help.in @@ -293,7 +293,6 @@ transformers==4.51.3 typing-extensions==4.13.2 # via # -c requirements/common-constraints.txt - # anyio # huggingface-hub # llama-index-core # pydantic @@ -325,3 +324,6 @@ yarl==1.20.0 # via # -c requirements/common-constraints.txt # aiohttp + +# The following packages are considered to be unsafe in a requirements file: +# setuptools diff --git a/requirements/tree-sitter.in b/requirements/tree-sitter.in index eba2e6770..9ba57296a 100644 --- a/requirements/tree-sitter.in +++ b/requirements/tree-sitter.in @@ -1,3 +1,2 @@ - tree-sitter==0.23.2; python_version < "3.10" tree-sitter==0.24.0; python_version >= "3.10" diff --git a/scripts/pip-compile.sh b/scripts/pip-compile.sh index e1e1e512b..5255afc15 100755 --- a/scripts/pip-compile.sh +++ b/scripts/pip-compile.sh @@ -25,9 +25,11 @@ uv pip compile \ requirements/requirements.in \ $1 -grep -v ^tree-sitter= tmp.requirements.txt \ - | cat - requirements/tree-sitter.in \ - > requirements.txt +{ + grep -v ^tree-sitter= tmp.requirements.txt + echo; cat requirements/tree-sitter.in + echo; cat requirements/pydub.in +} > requirements.txt # Compile additional requirements files SUFFIXES=(dev help browser playwright)