Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: Upgrade Python (3.12.2 -> 3.12.4) (#2449) #2450

Merged
merged 1 commit into from
Jul 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changes/2449.deps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade the base CPython from 3.12.2 to 3.12.4
20 changes: 10 additions & 10 deletions docs/dev/daily-workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ you should also configure ``PYTHONPATH`` to include the repository root's ``src`
For linters and formatters, configure the tool executable paths to indicate
``dist/export/python/virtualenvs/RESOLVE_NAME/PYTHON_VERSION/bin/EXECUTABLE``.
For example, ruff's executable path is
``dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff``.
``dist/export/python/virtualenvs/ruff/3.12.4/bin/ruff``.

Currently we have the following Python tools to configure in this way:

Expand Down Expand Up @@ -259,7 +259,7 @@ Set the workspace settings for the Python extension for code navigation and auto
* - ``python.analysis.autoSearchPaths``
- true
* - ``python.analysis.extraPaths``
- ``["dist/export/python/virtualenvs/python-default/3.12.2/lib/python3.12/site-packages"]``
- ``["dist/export/python/virtualenvs/python-default/3.12.4/lib/python3.12/site-packages"]``
* - ``python.analysis.importFormat``
- ``"relative"``
* - ``editor.formatOnSave``
Expand All @@ -275,11 +275,11 @@ Set the following keys in the workspace settings to configure Python tools:
* - Setting ID
- Example value
* - ``mypy-type-checker.interpreter``
- ``["dist/export/python/virtualenvs/mypy/3.12.2/bin/python"]``
- ``["dist/export/python/virtualenvs/mypy/3.12.4/bin/python"]``
* - ``mypy-type-checker.importStrategy``
- ``"fromEnvironment"``
* - ``ruff.interpreter``
- ``["dist/export/python/virtualenvs/ruff/3.12.2/bin/python"]``
- ``["dist/export/python/virtualenvs/ruff/3.12.4/bin/python"]``
* - ``ruff.importStrategy``
- ``"fromEnvironment"``

Expand Down Expand Up @@ -309,8 +309,8 @@ Then put the followings in ``.vimrc`` (or ``.nvimrc`` for NeoVim) in the build r
.. code-block:: vim

let s:cwd = getcwd()
let g:ale_python_mypy_executable = s:cwd . '/dist/export/python/virtualenvs/mypy/3.12.2/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff'
let g:ale_python_mypy_executable = s:cwd . '/dist/export/python/virtualenvs/mypy/3.12.4/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/python/virtualenvs/ruff/3.12.4/bin/ruff'
let g:ale_linters = { "python": ['ruff', 'mypy'] }
let g:ale_fixers = {'python': ['ruff']}
let g:ale_fix_on_save = 1
Expand All @@ -328,11 +328,11 @@ just like VSCode (see `the official reference <https://www.npmjs.com/package/coc
"ruff.enabled": true,
"ruff.autoFixOnSave": true,
"ruff.useDetectRuffCommand": false,
"ruff.builtin.pythonPath": "dist/export/python/virtualenvs/ruff/3.12.2/bin/python",
"ruff.serverPath": "dist/export/python/virtualenvs/ruff/3.12.2/bin/ruff-lsp",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.12.2/bin/python",
"ruff.builtin.pythonPath": "dist/export/python/virtualenvs/ruff/3.12.4/bin/python",
"ruff.serverPath": "dist/export/python/virtualenvs/ruff/3.12.4/bin/ruff-lsp",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.12.4/bin/python",
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.12.2/bin/mypy",
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.12.4/bin/mypy",
}

To activate Ruff (a Python linter and fixer), run ``:CocCommand ruff.builtin.installServer``
Expand Down
8 changes: 4 additions & 4 deletions docs/install/install-from-package/os-preparation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,10 @@ For example,

.. code-block:: console

$ curl -L "https://github.com/indygreg/python-build-standalone/releases/download/20231002/cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz" > cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz
$ tar -xf "cpython-3.12.2+20240224-x86_64-unknown-linux-gnu-install_only.tar.gz"
$ curl -L "https://github.com/indygreg/python-build-standalone/releases/download/20240713/cpython-3.12.4+20240713-x86_64-unknown-linux-gnu-install_only.tar.gz" > cpython-3.12.4+20240713-x86_64-unknown-linux-gnu-install_only.tar.gz
$ tar -xf "cpython-3.12.4+20240713-x86_64-unknown-linux-gnu-install_only.tar.gz"
$ mkdir -p "/home/bai/.static-python/versions"
$ mv python "/home/bai/.static-python/versions/3.12.2"
$ mv python "/home/bai/.static-python/versions/3.12.4"

Then, you can create multiple virtual environments per service. To create a
virtual environment for Backend.AI Manager and activate it, for example, you may run:
Expand All @@ -145,7 +145,7 @@ virtual environment for Backend.AI Manager and activate it, for example, you may

$ mkdir "${HOME}/manager"
$ cd "${HOME}/manager"
$ ~/.static-python/versions/3.12.2/bin/python3 -m venv .venv
$ ~/.static-python/versions/3.12.4/bin/python3 -m venv .venv
$ source .venv/bin/activate
$ pip install -U pip setuptools wheel

Expand Down
18 changes: 9 additions & 9 deletions pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ enable_resolves = true
# * Let other developers do:
# - Run `./pants export` again
# - Update their local IDE/editor's interpreter path configurations
interpreter_constraints = ["CPython==3.12.2"]
interpreter_constraints = ["CPython==3.12.4"]
tailor_pex_binary_targets = false
pip_version = "24.0"
pip_version = "24.1.2"

[python-bootstrap]
search_path = ["<PYENV>"]
Expand Down Expand Up @@ -82,13 +82,13 @@ setuptools = "tools/setuptools.lock"

[pex-cli]
# Pants 2.21.0 uses Pex 2.3.1 by default.
# version = "v2.3.0"
# known_versions = [
# "v2.3.0|macos_arm64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
# "v2.3.0|macos_x86_64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
# "v2.3.0|linux_arm64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
# "v2.3.0|linux_x86_64|581f7c2d61b4c24c66ba241f2a37d8f3b552f24ed22543279860f3463ac3db35|4124506",
# ]
version = "v2.10.0"
known_versions = [
"v2.10.0|macos_arm64|de2e75c6528009051331e81e57cf05d460d0a8a3411fa9cd0b7b0ffb5d3fc23e|4170525",
"v2.10.0|macos_x86_64|de2e75c6528009051331e81e57cf05d460d0a8a3411fa9cd0b7b0ffb5d3fc23e|4170525",
"v2.10.0|linux_arm64|de2e75c6528009051331e81e57cf05d460d0a8a3411fa9cd0b7b0ffb5d3fc23e|4170525",
"v2.10.0|linux_x86_64|de2e75c6528009051331e81e57cf05d460d0a8a3411fa9cd0b7b0ffb5d3fc23e|4170525",
]
# When trying a new pex version, you could find out the hash and size-in-bytes as follows:
# $ curl -s -L https://github.com/pantsbuild/pex/releases/download/v2.1.99/pex | tee >(wc -c) >(shasum -a 256) >/dev/null

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
requires-python = "~=3.12.2"
requires-python = "~=3.12.4"

[tool.towncrier]
package = "ai.backend.manager" # reference point for getting __version__
Expand Down Expand Up @@ -106,5 +106,5 @@ implicit_optional = true # FIXME: remove after adding https://github.com/haunts
mypy_path = "stubs:src:tools/pants-plugins"
namespace_packages = true
explicit_package_bases = true
python_executable = "dist/export/python/virtualenvs/python-default/3.12.2/bin/python"
python_executable = "dist/export/python/virtualenvs/python-default/3.12.4/bin/python"
disable_error_code = ["typeddict-unknown-key"]
Loading
Loading