Skip to content

Commit

Permalink
fix: fix pydantic smart union in older versions, and add minreqs test (
Browse files Browse the repository at this point in the history
…#178)

* add minreqs test

* bump

* use main

* pin higher
  • Loading branch information
tlambert03 authored Jul 8, 2024
1 parent 5801ee6 commit 19cc774
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,21 @@ jobs:
- os: ubuntu-latest
python-version: "3.8"

test-minreqs:
uses: pyapp-kit/workflows/.github/workflows/test-pyrepo.yml@main
with:
os: ubuntu-latest
python-version: ${{ matrix.python-version }}
pip-install-min-reqs: true
coverage-upload: artifact
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.12"]

upload_coverage:
if: always()
needs: [test]
needs: [test, test-minreqs]
uses: pyapp-kit/workflows/.github/workflows/upload-coverage.yml@v2
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ classifiers = [
"Typing :: Typed",
]
dynamic = ["version"]
dependencies = ["pydantic >=2,!=2.4.1", "numpy", "typing-extensions"]
dependencies = ["pydantic >=2.6", "numpy", "typing-extensions"]

# extras
# https://peps.python.org/pep-0621/#dependencies-optional-dependencies
Expand Down
4 changes: 3 additions & 1 deletion src/useq/_mda_sequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,9 @@ class MDASequence(UseqModel):
stage_positions: Union[WellPlatePlan, Tuple[Position, ...]] = Field(
default_factory=tuple
)
grid_plan: Optional[MultiPointPlan] = None
grid_plan: Optional[MultiPointPlan] = Field(
default=None, union_mode="left_to_right"
)
channels: Tuple[Channel, ...] = Field(default_factory=tuple)
time_plan: Optional[AnyTimePlan] = None
z_plan: Optional[AnyZPlan] = None
Expand Down

0 comments on commit 19cc774

Please sign in to comment.