diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f80b79d..9412b7f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -12,10 +12,10 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Set up Python 3.10 + - name: Set up Python uses: actions/setup-python@v3 with: - python-version: "3.10" + python-version: "3.12" - name: Install dependencies run: | python -m pip install --upgrade pip diff --git a/CHANGELOG.md b/CHANGELOG.md index 5bab48f..4737603 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,26 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.1.3] - 2026-04-21 + +### Changed + +- Removed `version` field from `info` section in lock file. + This field have been used to specify the Pyodide version used to create the lockfile, + but lockfile does not need to be bound to a specific Pyodide version. + If you need to check the compatibility between the lockfile and Pyodide, + you can use the `abi_version` field in the `info` section instead. + [#41](https://github.com/pyodide/pyodide-lock/pull/41) + +- Upgraded Python version constraint from 3.10 to 3.12. + [#41](https://github.com/pyodide/pyodide-lock/pull/41) + +## [0.1.2] - 2026-02-27 + +- Added `UvPipCompile` compile class for experimental support for constructing + lock files using `uv pip compile`. + [#40](https://github.com/pyodide/pyodide-lock/pull/40) + ## [0.1.1] - 2026-01-02 Dropped `typer` dependency for CLI. diff --git a/pyodide_lock/spec.py b/pyodide_lock/spec.py index 81092d1..a4f6a0e 100644 --- a/pyodide_lock/spec.py +++ b/pyodide_lock/spec.py @@ -8,7 +8,8 @@ class InfoSpec(BaseModel): arch: Literal["wasm32", "wasm64"] = "wasm32" platform: str - version: str + # This field is deprecated and will not be included in the output + version: str = Field(default="0.0.0", exclude=True) python: str abi_version: str | None = None model_config = ConfigDict(extra="forbid") diff --git a/pyodide_lock/utils.py b/pyodide_lock/utils.py index 1cc3c54..4e9851e 100644 --- a/pyodide_lock/utils.py +++ b/pyodide_lock/utils.py @@ -103,7 +103,10 @@ def _generate_package_hash(full_path: Path) -> str: def _get_marker_environment( - platform: str, version: str, arch: str, python: str, abi_version: str | None = None + platform: str, + arch: str, + python: str, + **kwargs, ) -> dict[str, str]: """ Get the marker environment for this pyodide-lock file. If running diff --git a/pyodide_lock/uv_pip_compile.py b/pyodide_lock/uv_pip_compile.py index 091335d..749a44d 100644 --- a/pyodide_lock/uv_pip_compile.py +++ b/pyodide_lock/uv_pip_compile.py @@ -4,8 +4,8 @@ import os import shutil -import sys import sysconfig +import tomllib from logging import DEBUG from pathlib import Path from pprint import pformat @@ -23,11 +23,6 @@ from .spec import PackageSpec, PyodideLockSpec from .utils import add_wheels_to_spec, logger -if sys.version_info >= (3, 11): # pragma: no cover - import tomllib -else: # pragma: no cover - import tomli as tomllib - if TYPE_CHECKING: from collections.abc import Iterator diff --git a/pyproject.toml b/pyproject.toml index 78ff34d..4d49c77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -9,7 +9,7 @@ authors = [ ] description = "Tooling to manage the `pyodide-lock.json` file" readme = "README.md" -requires-python = ">=3.10" +requires-python = ">=3.12" dependencies = [ # compatible with pyodide-build and the as-shipped wheel in the pyodide distribution "pydantic>=2", @@ -39,6 +39,7 @@ wheel = [ ] dev = [ "build", + "setuptools", "click", "pytest-cov", "pytest", diff --git a/tests/test_spec.py b/tests/test_spec.py index b16167f..d89a7eb 100644 --- a/tests/test_spec.py +++ b/tests/test_spec.py @@ -27,7 +27,7 @@ def test_lock_spec_parsing(pyodide_version, tmp_path): spec2 = PyodideLockSpec.from_json(target2_path) - assert spec.info == spec2.info + assert spec.info.model_dump() == spec2.info.model_dump() assert set(spec.packages.keys()) == set(spec2.packages.keys()) for key in spec.packages: pkg1 = spec.packages[key] @@ -113,3 +113,6 @@ def test_exclude_key(example_lock_data): assert "packages" in dump for pkg in dump["packages"].values(): assert "shared_library" not in pkg + + assert "info" in dump + assert "version" not in dump["info"]