diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2c215c3..f80b79d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -31,25 +31,8 @@ jobs: with: token: ${{ secrets.CODECOV_TOKEN }} - lint: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Set up Python 3.11 - uses: actions/setup-python@v3 - with: - python-version: "3.11" - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install pre-commit - - name: Lint - run: | - pre-commit run -a - deploy: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags') environment: PyPi-deploy steps: @@ -57,7 +40,7 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: 3.11.1 + python-version: 3.12 - name: Install requirements and build wheel shell: bash -l {0} run: | diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 3d35cb7..35a9fc3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,5 +1,5 @@ default_language_version: - python: "3.11" + python: "3.12" repos: - repo: https://github.com/pre-commit/pre-commit-hooks rev: "v4.4.0" diff --git a/CHANGELOG.md b/CHANGELOG.md index 40b39ae..69b18e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,12 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased +## [0.1.0a7] - 2024-08-08 + +### Added + +- `shared_library` key is removed from the lock file. + [#31](https://github.com/pyodide/pyodide-lock/pull/31) + ## [0.1.0a6] - 2024-04-03 ### Added - The `info` field now contains an optional `abi_version`. - [#86](https://github.com/pyodide/pyodide-lock/pull/86) + [#27](https://github.com/pyodide/pyodide-lock/pull/27) ## [0.1.0a5] - 2024-04-03 diff --git a/pyodide_lock/spec.py b/pyodide_lock/spec.py index 542fe1f..81092d1 100644 --- a/pyodide_lock/spec.py +++ b/pyodide_lock/spec.py @@ -28,8 +28,8 @@ class PackageSpec(BaseModel): imports: list[str] = [] depends: list[str] = [] unvendored_tests: bool = False - # This field is deprecated - shared_library: bool = False + # This field is deprecated and will not be included in the output + shared_library: bool = Field(default=False, exclude=True) model_config = ConfigDict(extra="forbid") diff --git a/tests/conftest.py b/tests/conftest.py index 602fe0a..dd3ef61 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,6 +29,7 @@ ), "imports": ["numpy"], "depends": [], + "shared_library": False, } }, } diff --git a/tests/test_spec.py b/tests/test_spec.py index 10a4df9..b16167f 100644 --- a/tests/test_spec.py +++ b/tests/test_spec.py @@ -30,7 +30,9 @@ def test_lock_spec_parsing(pyodide_version, tmp_path): assert spec.info == spec2.info assert set(spec.packages.keys()) == set(spec2.packages.keys()) for key in spec.packages: - assert spec.packages[key] == spec2.packages[key] + pkg1 = spec.packages[key] + pkg2 = spec2.packages[key] + assert pkg1.model_dump() == pkg2.model_dump() def test_check_wheel_filenames(example_lock_data): @@ -103,3 +105,11 @@ def test_extra_config_forbidden(example_lock_data): with pytest.raises(ValidationError, match="Extra inputs are not permitted"): PackageSpec(**package_data) + + +def test_exclude_key(example_lock_data): + spec = PyodideLockSpec(**example_lock_data) + dump = spec.model_dump() + assert "packages" in dump + for pkg in dump["packages"].values(): + assert "shared_library" not in pkg diff --git a/tests/test_wheel.py b/tests/test_wheel.py index 265da85..d1526e5 100644 --- a/tests/test_wheel.py +++ b/tests/test_wheel.py @@ -117,7 +117,6 @@ def test_self_wheel(example_lock_spec): imports=["pyodide_lock"], depends=["pydantic"], unvendored_tests=False, - shared_library=False, ) assert example_lock_spec.packages["pyodide-lock"] == expected