Skip to content
Open
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/5536.deps.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Upgrade the base CPython version from 3.13.3 to 3.13.7
33 changes: 19 additions & 14 deletions docs/dev/daily-workflows.rst
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,14 @@ 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.13.3/bin/ruff``.

As of Pantsbuild 2.24, self-contained tool binaries are auto-exported into ``dist/export/bin/``
when executing ``pants export`` command with whatever arguments.
For example, the Ruff executable is exported as ``dist/export/bin/ruff``.
Other tools that require Python virtualenv (e.g., Mypy) are still exported as virtualenvs.

For Pantsbuild 2.23 or older, the tool binaries are exported as regular Python virtualenvs like
``dist/export/python/virtualenvs/ruff/3.13.7/bin/ruff``.

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

Expand Down Expand Up @@ -275,7 +281,7 @@ 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.13.3/bin/python"]``
- ``["/abs/path/to/dist/export/python/virtualenvs/mypy/3.13.7/bin/python"]`` (use the absolute path)
* - ``mypy-type-checker.importStrategy``
- ``"fromEnvironment"``
* - ``ruff.interpreter``
Expand Down Expand Up @@ -309,8 +315,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.13.3/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/python/virtualenvs/ruff/3.13.3/bin/ruff'
let g:ale_python_mypy_executable = s:cwd . '/dist/export/python/virtualenvs/mypy/3.13.7/bin/mypy'
let g:ale_python_ruff_executable = s:cwd . '/dist/export/bin/ruff'
let g:ale_linters = { "python": ['ruff', 'mypy'] }
let g:ale_fixers = {'python': ['ruff']}
let g:ale_fix_on_save = 1
Expand All @@ -320,19 +326,18 @@ in the local working copy to initialize Pyright functionalities.
In the local configuration file (``.vim/coc-settings.json``), you may put the linter/formatter configurations
just like VSCode (see `the official reference <https://www.npmjs.com/package/coc-pyright>`_).

.. code-block:: json
.. code-block:: json5

{
"coc.preferences.formatOnType": false,
"coc.preferences.willSaveHandlerTimeout": 5000,
"ruff.enabled": true,
"ruff.autoFixOnSave": true,
"ruff.useDetectRuffCommand": false,
"ruff.builtin.pythonPath": "dist/export/python/virtualenvs/ruff/3.13.3/bin/python",
"ruff.serverPath": "dist/export/python/virtualenvs/ruff/3.13.3/bin/ruff-lsp",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.13.3/bin/python",
"python.pythonPath": "dist/export/python/virtualenvs/python-default/3.13.7/bin/python",
"python.linting.mypyEnabled": true,
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.13.3/bin/mypy",
"python.linting.mypyPath": "dist/export/python/virtualenvs/mypy/3.13.7/bin/mypy",
"python.linting.ruffEnabled": true,
"python.linting.ruffPath": "dist/export/bin/ruff",
"python.formatting.provider": "ruff",
"python.formatting.ruffPath": "dist/export/bin/ruff",
}

To activate Ruff (a Python linter and fixer), run ``:CocCommand ruff.builtin.installServer``
Expand Down Expand Up @@ -703,7 +708,7 @@ Making a new release
line, e.g., using ``set noeol`` in Vim. This is also configured in
``./editorconfig``)

* Run ``LOCKSET=tools/towncrier ./py -m towncrier`` to auto-generate the changelog.
* Run ``LOCKSET=towncrier/3.13.7 ./py -m towncrier`` to auto-generate the changelog.

- You may append ``--draft`` to see a preview of the changelog update without
actually modifying the filesystem.
Expand Down
2 changes: 1 addition & 1 deletion pants.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ enable_resolves = true
# * Let other developers do:
# - Run `pants export` again
# - Update their local IDE/editor's interpreter path configurations
interpreter_constraints = ["CPython==3.13.3"]
interpreter_constraints = ["CPython==3.13.7"]
tailor_pex_binary_targets = false
pip_version = "25.0.1"

Expand Down
6 changes: 3 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[project]
requires-python = "~=3.13.3"
requires-python = "~=3.13.7"
name = "backend.ai"
dynamic = ["version"]

Expand Down Expand Up @@ -110,7 +110,7 @@ ignore_missing_imports = true
mypy_path = "stubs:src:tools/pants-plugins"
namespace_packages = true
explicit_package_bases = true
python_executable = "dist/export/python/virtualenvs/python-default/3.13.3/bin/python"
python_executable = "dist/export/python/virtualenvs/python-default/3.13.7/bin/python"
disable_error_code = ["typeddict-unknown-key"]

[tool.pyright]
Expand All @@ -127,7 +127,7 @@ exclude = [
"src/ai/backend/web/static",
]
venvPath = "dist/export/python/virtualenvs/python-default"
venv = "3.13.3"
venv = "3.13.7"

[tool.pydantic-mypy]
init_forbid_extra = true
Expand Down
Loading
Loading