diff --git a/pyproject.toml b/pyproject.toml index db1fa8161..e3adf16a1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -82,11 +82,11 @@ dependencies = [ "sympy", "astropy", "toml", - # 26.7.25 bounds the time a fetch can take: every request carries an + # This floor bounds the time a fetch can take: every request carries an # explicit connect and read timeout, and a transient failure is retried # with backoff instead of ending the fetch. Below that floor a stalled # mirror hangs the start of a run with no diagnostic. - "fwl-io>=26.7.25", + "fwl-io>=26.8.31", "zenodo-get", "zenodo-client>=0.4.1", "osfclient", diff --git a/src/proteus/data/__init__.py b/src/proteus/data/__init__.py index 83e06a9e3..a4716181c 100644 --- a/src/proteus/data/__init__.py +++ b/src/proteus/data/__init__.py @@ -24,10 +24,10 @@ EXOPLANET_REFERENCE = 'observe.exoplanet_reference' MASS_RADIUS_ZENG_2019 = 'observe.mass_radius.zeng_2019' -# The manifest schema this manifest is written against. An fwl-io older than -# this reads the manifest as malformed rather than as a version mismatch, so the -# load names which side is out of date. Keep in step with the fwl-io requirement -# in pyproject.toml; the test suite pins the two together. +# The oldest fwl-io that reads this manifest schema. An older fwl-io reads the +# manifest as malformed rather than as a version mismatch, so the load names +# which side is out of date. The fwl-io requirement in pyproject.toml must be at +# least this version; the test suite enforces the relation. FWL_IO_FLOOR = '26.7.25' diff --git a/tests/data/test_manifest.py b/tests/data/test_manifest.py index c966572b1..32207c602 100644 --- a/tests/data/test_manifest.py +++ b/tests/data/test_manifest.py @@ -238,13 +238,16 @@ class _NewDataset: assert _fwl_io_derives_the_location() is True -def test_declared_floor_matches_the_requirement(): - """The fwl-io floor in the error message equals the one pip installs. +def test_declared_floor_is_not_below_the_schema_floor(): + """The pyproject fwl-io floor is not below the manifest schema floor. - If the two drift, the upgrade instruction names a version that does not fix - the problem the reader is looking at. + A pyproject floor below the schema floor would let pip install an fwl-io that + cannot read the manifest, which the load reports as a stale install. A + pyproject floor above it is allowed: it tracks fixes in later fwl-io + releases, and the upgrade instruction names only the schema floor. """ from packaging.requirements import Requirement + from packaging.version import Version requirements = _pyproject()['project']['dependencies'] bounds = [ @@ -258,7 +261,9 @@ def test_declared_floor_matches_the_requirement(): # Checked first so a dropped `>=` reports the absence it is, rather than # reaching the comparison below and reading as a version mismatch. assert len(bounds) == 1, f'expected one lower bound on fwl-io, found {bounds}' - assert bounds == [FWL_IO_FLOOR], f'pyproject floor {bounds} vs module floor {FWL_IO_FLOOR}' + assert Version(bounds[0]) >= Version(FWL_IO_FLOOR), ( + f'pyproject floor {bounds[0]} is below the manifest schema floor {FWL_IO_FLOOR}' + ) def test_manifest_and_registries_are_declared_as_package_data():