Skip to content

Commit 1cd330f

Browse files
authored
Remove shared_library key (#31)
* Remove shared_library key * changelog * Put back shared_library key but exclude from output * Fix test * lint * Remove lint job * Rollback python version in ci * Update test
1 parent 5212b7f commit 1cd330f

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

.github/workflows/main.yml

+2-19
Original file line numberDiff line numberDiff line change
@@ -31,33 +31,16 @@ jobs:
3131
with:
3232
token: ${{ secrets.CODECOV_TOKEN }}
3333

34-
lint:
35-
runs-on: ubuntu-latest
36-
37-
steps:
38-
- uses: actions/checkout@v3
39-
- name: Set up Python 3.11
40-
uses: actions/setup-python@v3
41-
with:
42-
python-version: "3.11"
43-
- name: Install dependencies
44-
run: |
45-
python -m pip install --upgrade pip
46-
pip install pre-commit
47-
- name: Lint
48-
run: |
49-
pre-commit run -a
50-
5134
deploy:
52-
runs-on: ubuntu-20.04
35+
runs-on: ubuntu-latest
5336
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
5437
environment: PyPi-deploy
5538
steps:
5639
- uses: actions/checkout@v3
5740

5841
- uses: actions/setup-python@v4
5942
with:
60-
python-version: 3.11.1
43+
python-version: 3.12
6144
- name: Install requirements and build wheel
6245
shell: bash -l {0}
6346
run: |

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
default_language_version:
2-
python: "3.11"
2+
python: "3.12"
33
repos:
44
- repo: https://github.com/pre-commit/pre-commit-hooks
55
rev: "v4.4.0"

CHANGELOG.md

+8-1
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66

77
## Unreleased
88

9+
## [0.1.0a7] - 2024-08-08
10+
11+
### Added
12+
13+
- `shared_library` key is removed from the lock file.
14+
[#31](https://github.com/pyodide/pyodide-lock/pull/31)
15+
916
## [0.1.0a6] - 2024-04-03
1017

1118
### Added
1219

1320
- The `info` field now contains an optional `abi_version`.
14-
[#86](https://github.com/pyodide/pyodide-lock/pull/86)
21+
[#27](https://github.com/pyodide/pyodide-lock/pull/27)
1522

1623
## [0.1.0a5] - 2024-04-03
1724

pyodide_lock/spec.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ class PackageSpec(BaseModel):
2828
imports: list[str] = []
2929
depends: list[str] = []
3030
unvendored_tests: bool = False
31-
# This field is deprecated
32-
shared_library: bool = False
31+
# This field is deprecated and will not be included in the output
32+
shared_library: bool = Field(default=False, exclude=True)
3333
model_config = ConfigDict(extra="forbid")
3434

3535

tests/conftest.py

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
),
3030
"imports": ["numpy"],
3131
"depends": [],
32+
"shared_library": False,
3233
}
3334
},
3435
}

tests/test_spec.py

+11-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def test_lock_spec_parsing(pyodide_version, tmp_path):
3030
assert spec.info == spec2.info
3131
assert set(spec.packages.keys()) == set(spec2.packages.keys())
3232
for key in spec.packages:
33-
assert spec.packages[key] == spec2.packages[key]
33+
pkg1 = spec.packages[key]
34+
pkg2 = spec2.packages[key]
35+
assert pkg1.model_dump() == pkg2.model_dump()
3436

3537

3638
def test_check_wheel_filenames(example_lock_data):
@@ -103,3 +105,11 @@ def test_extra_config_forbidden(example_lock_data):
103105

104106
with pytest.raises(ValidationError, match="Extra inputs are not permitted"):
105107
PackageSpec(**package_data)
108+
109+
110+
def test_exclude_key(example_lock_data):
111+
spec = PyodideLockSpec(**example_lock_data)
112+
dump = spec.model_dump()
113+
assert "packages" in dump
114+
for pkg in dump["packages"].values():
115+
assert "shared_library" not in pkg

tests/test_wheel.py

-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ def test_self_wheel(example_lock_spec):
117117
imports=["pyodide_lock"],
118118
depends=["pydantic"],
119119
unvendored_tests=False,
120-
shared_library=False,
121120
)
122121

123122
assert example_lock_spec.packages["pyodide-lock"] == expected

0 commit comments

Comments
 (0)