diff --git a/.bazelrc b/.bazelrc index 40ed5e85a..21547b9c6 100644 --- a/.bazelrc +++ b/.bazelrc @@ -3,7 +3,7 @@ common --experimental_repository_cache_hardlinks # specify python path for pyo3 compile build:windows --action_env="PYO3_PYTHON=c:/python/python.exe" -#build:linux --action_env="PYO3_PYTHON=/usr/local/bin/python3.8" +#build:linux --action_env="PYO3_PYTHON=/usr/local/bin/python3.9" # only affects the ankihelper library #build:macos --macos_cpus=x86_64,arm64 diff --git a/docs/development.md b/docs/development.md index 38ee3061d..cff63dbb2 100644 --- a/docs/development.md +++ b/docs/development.md @@ -15,14 +15,14 @@ Pre-built Python packages are available on PyPI. They are useful if you wish to: - Get code completion when developing add-ons - Make command line scripts that modify .anki2 files via Anki's Python libraries -You will need the 64 bit version of Python 3.8 or 3.9 installed. If you do not +You will need the 64 bit version of Python 3.9 or 3.10 installed. If you do not have Python yet, please see the platform-specific instructions in the "Building from source" section below for more info. **Mac/Linux**: ``` -$ python3.8 -m venv ~/pyenv +$ python3.9 -m venv ~/pyenv $ ~/pyenv/bin/pip install --upgrade pip $ ~/pyenv/bin/pip install aqt ``` diff --git a/docs/linux.md b/docs/linux.md index efdf83b08..9cf2c1d79 100644 --- a/docs/linux.md +++ b/docs/linux.md @@ -18,18 +18,18 @@ $ sudo apt install bash grep findutils curl gcc g++ git The 'find' utility is 'findutils' on Debian. -**Install Python 3.8**: +**Install Python 3.9**: If you're on a modern distribution, you may be able to install Python from the repo: ``` -$ sudo apt install python3.8 +$ sudo apt install python3.9 ``` If you are using a packaged Python version that is installed in /usr/bin, you can jump -immediately to the next section after ensuring python3.8-distutils is installed. +immediately to the next section after ensuring python3.9-distutils is installed. -If Python 3.8 is not available in your distro, you can download it from +If Python 3.9 is not available in your distro, you can download it from python.org, compile it, and install it in /usr/local. If you're on a basic Debian install, make sure you have the following installed before building Python: @@ -41,12 +41,12 @@ other than /usr/bin, you'll need to put the following into a file called user.ba at the top of this repo before proceeding: ``` -build --action_env=PYO3_PYTHON=/usr/local/bin/python3.8 +build --action_env=PYO3_PYTHON=/usr/local/bin/python3.9 ``` If you're building Anki from a docker container or distro that has no `python` command in /usr/bin, you'll need to symlink `python` to `/usr/bin/python`. `/usr/bin/python` does not -need to be Python 3.8; any version will do. `apt install python-is-python3` can also be +need to be Python 3.9; any version will do. `apt install python-is-python3` can also be used to link python3 to python. If your system only has Python 3.9, you should be able to build Anki with it, diff --git a/docs/mac.md b/docs/mac.md index db9a2f9dc..d116ab0da 100644 --- a/docs/mac.md +++ b/docs/mac.md @@ -17,9 +17,9 @@ Then install deps: $ brew install rsync bazelisk ``` -**Install Python 3.8**: +**Install Python 3.9**: -Install Python 3.8 from . We have heard reports +Install Python 3.9 from . We have heard reports of issues with pyenv and homebrew, so the package from python.org is the only recommended approach. @@ -29,10 +29,10 @@ You do not need to set up a Python venv prior to building Anki. When you run "python" in a shell, if it shows Python 2.x, you may get a bunch of hashlib warnings during build. You can work around this by -pointing python to python3.8: +pointing python to python3.9: ``` -$ ln -sf /usr/local/bin/{python3.8,python} +$ ln -sf /usr/local/bin/{python3.9,python} ``` This linking will not work if you're using the system Python from Big Sur, diff --git a/docs/windows.md b/docs/windows.md index 3f659b83a..c855e2801 100644 --- a/docs/windows.md +++ b/docs/windows.md @@ -15,9 +15,9 @@ Install the [Visual Studio build tools](https://visualstudio.microsoft.com/downl Make sure the "C++ build tools" box is selected, and leave the default optional components enabled on the right. -**Python 3.8**: +**Python 3.9**: -Download the 64 bit Python 3.8 from . Run the installer, +Download the 64 bit Python 3.9 from . Run the installer, and customize the installation. Select "install for all users", and choose the install path as c:\python. Currently the build scripts require Python to be installed in that location. diff --git a/pylib/anki/BUILD.bazel b/pylib/anki/BUILD.bazel index e7654c611..f0c3c0e1f 100644 --- a/pylib/anki/BUILD.bazel +++ b/pylib/anki/BUILD.bazel @@ -77,7 +77,7 @@ py_wheel( "//platforms:linux_arm64": "manylinux2014_aarch64", }), python_tag = "cp38", - python_version = ">=3.8", + python_version = ">=3.9", requires = [ "beautifulsoup4", "requests[socks]", diff --git a/pylib/mypy.ini b/pylib/mypy.ini index c2e786baa..756045bdc 100644 --- a/pylib/mypy.ini +++ b/pylib/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.8 +python_version = 3.9 pretty = false no_strict_optional = true show_error_codes = true diff --git a/pylib/rsbridge/Cargo.toml b/pylib/rsbridge/Cargo.toml index 576b3149c..7b9f7926f 100644 --- a/pylib/rsbridge/Cargo.toml +++ b/pylib/rsbridge/Cargo.toml @@ -12,7 +12,7 @@ anki = { path = "../../rslib" } # /cargo/update.py needs to be run if updating the version below [dependencies.pyo3] version = "0.14.5" -features = ["extension-module", "abi3", "abi3-py38"] +features = ["extension-module", "abi3", "abi3-py39"] [lib] name = "rsbridge" diff --git a/pylib/tests/run_format.py b/pylib/tests/run_format.py index 80751c7a8..f69ad6b46 100644 --- a/pylib/tests/run_format.py +++ b/pylib/tests/run_format.py @@ -29,7 +29,7 @@ if __name__ == "__main__": "-m", "black", "-t", - "py38", + "py39", "anki", "tests", "tools", diff --git a/python.bzl b/python.bzl index d34895f4b..aa67d8aa4 100644 --- a/python.bzl +++ b/python.bzl @@ -1,10 +1,8 @@ def _impl(rctx): # locate python on path, and export it names = [ - # prefer 3.8 over 3.9, as pylint currently fails on 3.9 - # (due to issues like https://github.com/PyCQA/pylint/pull/3890) - "python3.8", - "python3", + "python3.9", + "python3.10", "python.exe", ] path = None diff --git a/qt/mypy.ini b/qt/mypy.ini index db40aba95..10a49657d 100644 --- a/qt/mypy.ini +++ b/qt/mypy.ini @@ -1,5 +1,5 @@ [mypy] -python_version = 3.8 +python_version = 3.9 no_strict_optional = true show_error_codes = true disallow_untyped_decorators = True diff --git a/qt/tests/run_format.py b/qt/tests/run_format.py index 6210a896b..20e151bd1 100644 --- a/qt/tests/run_format.py +++ b/qt/tests/run_format.py @@ -28,7 +28,7 @@ if __name__ == "__main__": "-m", "black", "-t", - "py38", + "py39", "--exclude=aqt/forms|colors|_gen", "aqt", "tests",