@@ -95,8 +95,12 @@ def validate_source_templates(repo_root: Path, identity: ReleaseIdentity) -> Non
9595 if re .search (r"\b[0-9]+\.[0-9]+\.[0-9]+-(?:alpha|beta|rc)\.[0-9]+\b" , reference , re .IGNORECASE ):
9696 raise ValueError ("docs/index.md must derive exact prerelease identities from pyproject.toml" )
9797
98+ reference_command = markdown_install_command (repo_root / "docs" / "index.md" )
99+ if shlex .split (reference_command ) != shlex .split (identity .install_command ):
100+ raise ValueError ("docs/index.md first install command must select the supported 2.0 prerelease line" )
101+
98102 readme = repo_root / "README.md"
99- expected = ["pip" , "install" , "--pre" , " durable-workflow~=2.0.0rc0" ]
103+ expected = ["pip" , "install" , "durable-workflow~=2.0.0rc0" ]
100104 command = markdown_install_command (readme )
101105 if shlex .split (command ) != expected :
102106 raise ValueError (f"README first install command must select the 2.0 prerelease line, got { command !r} " )
@@ -139,7 +143,7 @@ def validate_rendered_site(site: Path, identity: ReleaseIdentity) -> str:
139143
140144
141145class PublicRequirementUnavailable (subprocess .CalledProcessError ):
142- """The exact requirement could not be installed from the public channel."""
146+ """A required package version could not be installed from the public channel."""
143147
144148
145149def install_public_requirement (
@@ -150,7 +154,7 @@ def install_public_requirement(
150154 attempts : int ,
151155 retry_sleep : float ,
152156) -> None :
153- """Install an exact requirement from public PyPI, retrying propagation delays ."""
157+ """Install the supported prerelease requirement from public PyPI."""
154158 if attempts < 1 :
155159 raise ValueError ("Public PyPI install attempts must be at least 1" )
156160 if retry_sleep < 0 :
@@ -187,10 +191,10 @@ def install_public_requirement(
187191 raise PublicRequirementUnavailable (result .returncode , command )
188192
189193
190- def run_clean_install (
194+ def _run_clean_requirement (
191195 requirement : str ,
192- identity : ReleaseIdentity ,
193196 * ,
197+ expected_version : str | None ,
194198 install_attempts : int = 6 ,
195199 install_retry_sleep : float = 20 ,
196200) -> None :
@@ -212,22 +216,44 @@ def run_clean_install(
212216
213217import durable_workflow
214218
215- expected = os.environ[ "EXPECTED_DURABLE_WORKFLOW_VERSION"]
219+ expected = os.environ.get( "EXPECTED_DURABLE_WORKFLOW_VERSION")
216220installed = importlib.metadata.version("durable-workflow")
217- if installed != expected:
221+ if expected and installed != expected:
218222 raise SystemExit(f"installed durable-workflow {installed}, expected {expected}")
219- if durable_workflow.__version__ != expected :
220- raise SystemExit(f"imported durable-workflow {durable_workflow.__version__}, expected {expected }")
223+ if durable_workflow.__version__ != installed :
224+ raise SystemExit(f"imported durable-workflow {durable_workflow.__version__}, installed {installed }")
221225print(f"clean API-reference install imported durable-workflow {installed}")
222226"""
223227 env = {
224228 ** os .environ ,
225- "EXPECTED_DURABLE_WORKFLOW_VERSION" : identity . registry_version ,
229+ "EXPECTED_DURABLE_WORKFLOW_VERSION" : expected_version or "" ,
226230 "PYTHONPATH" : "" ,
227231 }
228232 subprocess .run ([str (python ), "-c" , check ], cwd = clean_root , env = env , check = True )
229233
230234
235+ def run_clean_install (
236+ requirement : str ,
237+ identity : ReleaseIdentity ,
238+ * ,
239+ install_attempts : int = 6 ,
240+ install_retry_sleep : float = 20 ,
241+ ) -> None :
242+ """Exercise the documented range and independently require the exact release."""
243+ _run_clean_requirement (
244+ requirement ,
245+ expected_version = None ,
246+ install_attempts = install_attempts ,
247+ install_retry_sleep = install_retry_sleep ,
248+ )
249+ _run_clean_requirement (
250+ identity .exact_requirement ,
251+ expected_version = identity .registry_version ,
252+ install_attempts = install_attempts ,
253+ install_retry_sleep = install_retry_sleep ,
254+ )
255+
256+
231257def verify_public_deployment (
232258 url : str ,
233259 identity : ReleaseIdentity ,
@@ -289,7 +315,7 @@ def main() -> int:
289315 parser .add_argument (
290316 "--unavailable-exit-code" ,
291317 type = int ,
292- help = "Return this distinct code only when public PyPI cannot install the exact requirement." ,
318+ help = "Return this distinct code only when public PyPI cannot install the documented or exact requirement." ,
293319 )
294320 parser .add_argument (
295321 "--source-revision" ,
0 commit comments