Skip to content

Commit

Permalink
Merge branch 'main' into feature/poetry-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau authored Aug 26, 2024
2 parents ee47801 + 5b90250 commit 333197f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 18 deletions.
24 changes: 6 additions & 18 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,22 +58,7 @@ jobs:
unit-tests:
strategy:
matrix:
os: [ubuntu-20.04, ubuntu-22.04]
python-versions:
- |
3.7
3.8
3.9
3.10
3.12
include:
- os: ubuntu-24.04
# Noble doesn't have a 3.7 release from GH
python-versions: |
3.8
3.10
3.12
3.13-dev
os: [ubuntu-20.04, ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
Expand All @@ -83,7 +68,10 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-versions }}
python-version: |
3.10
3.12
3.13-dev
cache: pip
- name: Install apt build dependencies
run: |
Expand Down Expand Up @@ -143,7 +131,7 @@ jobs:
- adjective: jammy
- os: ubuntu-20.04
python-version: "3.10"
adjective: jammy
adjective: focal
- os: ubuntu-24.04
python-version: "3.12"
adjective: noble
Expand Down
1 change: 1 addition & 0 deletions craft_parts/parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ class PartSpec(BaseModel):
extra="forbid",
frozen=True,
alias_generator=lambda s: s.replace("_", "-"),
coerce_numbers_to_str=True,
)

@field_validator("overlay_packages", "overlay_files", "overlay_script")
Expand Down
4 changes: 4 additions & 0 deletions tests/unit/test_parts.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,3 +541,7 @@ def test_part_validation_missing(self, partitions):
error = r"source\s+Field required"
with pytest.raises(pydantic.ValidationError, match=error):
parts.validate_part(data)

def test_part_coerces_numbers(self, partitions):
data = {"plugin": "nil", "build-environment": [{"CGO_ENABLED": 0}]}
parts.validate_part(data)

0 comments on commit 333197f

Please sign in to comment.