Skip to content
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
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
with:
python-version: "3.14"

- uses: astral-sh/setup-uv@v10.2.0
- uses: astral-sh/setup-uv@v10.3.0
- run: uvx --with tox-uv tox -e py,style,ty,pyrefly,pyright,mypy,zuban
- run: uv build
- name: Publish to PyPI
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- uses: astral-sh/setup-uv@v10.2.0
- uses: astral-sh/setup-uv@v10.3.0
- run: uvx --with tox-uv tox -e py

- uses: coverallsapp/github-action@v2
Expand Down Expand Up @@ -55,5 +55,5 @@ jobs:
with:
python-version: "3.14"

- uses: astral-sh/setup-uv@v10.2.0
- uses: astral-sh/setup-uv@v10.3.0
- run: uvx --with tox-uv tox -e style,ty,pyrefly,pyright,mypy,zuban
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## v2.1.0

- portable-python's code is now checked by multiple type checkers on every change
- Bumped SQLite to 3.53.4 and gettext-tiny to 0.3.3; re-checked every other component against upstream (all already current, or deliberately held back — see the `version` property comments).
- Bumped OpenSSL to 3.5.9, SQLite to 3.53.4, xz to 5.8.4 and gettext-tiny to 0.3.3; re-checked every other component against upstream (all already current, or deliberately held back — see the `version` property comments).
- Bug fixes:
- With `cpython-use-github: true`, a failed GitHub API call (e.g. rate limiting) crashed with a stack trace
- A build where `bin/python` could not be found crashed (instead of reporting it) when `cpython-validate-script` or `cpython-additional-packages` was configured
Expand Down
30 changes: 14 additions & 16 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,30 +1,28 @@
# This file was autogenerated by uv via the following command:
# uv pip compile pyproject.toml --universal -o requirements.txt --python-version 3.10 --group dev
certifi==2026.6.17
certifi==2026.10.19
# via requests
charset-normalizer==3.4.7
charset-normalizer==3.5.2
# via requests
click==8.4.1
click==8.5.0
# via portable-python (pyproject.toml)
colorama==0.4.6 ; sys_platform == 'win32'
# via
# click
# pytest
coverage==7.14.2
# via pytest
coverage==7.16.2
# via pytest-cov
exceptiongroup==1.3.1 ; python_full_version < '3.11'
# via pytest
idna==3.18
idna==3.20
# via requests
iniconfig==2.3.0
iniconfig==2.3.1
# via pytest
packaging==26.2
packaging==26.3
# via pytest
pluggy==1.6.0
pluggy==1.7.0
# via
# pytest
# pytest-cov
pygments==2.20.0
pygments==2.21.0
# via pytest
pytest==9.1.1
# via pytest-cov
Expand All @@ -34,15 +32,15 @@ pyyaml==6.0.3
# via portable-python (pyproject.toml)
requests==2.34.2
# via portable-python (pyproject.toml)
runez==5.9.1
runez==5.11.1
# via portable-python (pyproject.toml)
tomli==2.4.1 ; python_full_version <= '3.11'
tomli==2.5.0 ; python_full_version <= '3.11'
# via
# coverage
# pytest
typing-extensions==4.15.0 ; python_full_version < '3.11'
typing-extensions==4.16.0 ; python_full_version < '3.11'
# via exceptiongroup
urllib3==2.7.0
urllib3==2.8.0
# via
# portable-python (pyproject.toml)
# requests
2 changes: 1 addition & 1 deletion src/portable_python/cpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def _apply_pep668(self):

def _relativize_shebangs(self):
"""Autocorrect shebangs in bin/ folder, making them relative to the location of the python executable"""
for folder in (self.bin_folder, self.prefix_config_folder):
for folder in filter(None, (self.bin_folder, self.prefix_config_folder)):
for path in runez.ls_dir(folder):
if path != self.bin_python and runez.is_executable(path) and not path.is_symlink():
self._relativize_shebang_file(path)
Expand Down
6 changes: 3 additions & 3 deletions src/portable_python/external/xcpython.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,9 @@ def url(self):
def version(self):
# 3.5 is LTS, supported until Apr 2030 (3.0 EOL Sept 2026)
# Stay on the 3.5 LTS line: 3.6.x and 4.0.x have shipped but are not verified for cpython builds
# (python-build-standalone pins 3.5.7 as well)
# (python-build-standalone pins 3.5.x as well)
# Check https://github.com/openssl/openssl/releases and https://endoflife.date/openssl
return self.cfg_version("3.5.7")
return self.cfg_version("3.5.9")

def c_configure_args(self):
if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
Expand Down Expand Up @@ -391,7 +391,7 @@ def url(self):
@property
def version(self):
# Check https://github.com/tukaani-project/xz/releases
return self.cfg_version("5.8.3")
return self.cfg_version("5.8.4")

def c_configure_args(self):
if config_args := self.cfg_configure(self.deps_lib_dir, self.deps_lib64_dir):
Expand Down
4 changes: 2 additions & 2 deletions src/portable_python/inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ def __repr__(self):
return runez.short(self.filepath)

@runez.cached_property
def additional_info(self):
def additional_info(self) -> "SoInfo | str | None":
path = self.filepath
if path:
if is_dyn_lib(path):
Expand All @@ -180,7 +180,7 @@ def report_rows(self):
version = runez.bold(version)

info = self.additional_info
if hasattr(info, "represented"):
if isinstance(info, SoInfo):
info = info.represented()

else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_failed.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ def test_build_bogus_platform(cli):
def test_failed_build(cli):
cli.run("-tmacos-arm64", "build", "3.12.0")
assert cli.failed
assert "Error while compiling xz:5.8.3: ForbiddenHttpError" in cli.logged
assert "Error while compiling xz:5.8.4: ForbiddenHttpError" in cli.logged
assert "Overall compilation failed:" in cli.logged


Expand Down
6 changes: 5 additions & 1 deletion tests/test_inspector.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ def test_inspect_python(temp_folder, monkeypatch):
PPG.grab_config("foo.yml")
inspector = PythonInspector("invoker")
assert str(inspector)
assert str(inspector.module_info["_ctypes"])
module_info = inspector.module_info
assert module_info
assert str(module_info["_ctypes"])
r = inspector.full_so_report
assert r.ok

Expand All @@ -44,6 +46,7 @@ def test_inspect_python(temp_folder, monkeypatch):
PPG.grab_config(target="linux-x86_64")
monkeypatch.setitem(PPG.config.default.data, "linux", {"allowed-system-libs": "/foo"})
problem = r.get_problem(True)
assert problem
assert problem.startswith("Uses system libs:")


Expand Down Expand Up @@ -90,6 +93,7 @@ def test_inspect_problematic(temp_folder):
assert "_tkinter*_failed.so" in report # Failed modules are marked as such (cpython renames them `*_failed.so`)

problem = inspector.full_so_report.get_problem(portable=False)
assert problem
assert problem.startswith("\n-- 3 problematic\n")


Expand Down
Loading