Repository navigation
Requirements check: allow extras in fixed versions (package[extra1,extra2]==version) - #9
Merged
Merged
Conversation
…tra2]==version) The form refused 'colabfold[alphafold,openmm]==1.6.3': its pattern had no room for extras. Extras choose optional parts of the same package and keep its version fixed, and the template's requirements merge already handles them. - requirements_format.py (new): the accepted format, outside app.py so it can be tested without Streamlit. - app.py: validate_requirements uses it; the error names both forms. - tests/test_requirements_format.py: fixed versions with and without extras are accepted; ranges, wildcards, markers, URLs and malformed extras are still refused. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Uploading a notebook whose
requirements.yamllistscolabfold[alphafold,openmm]==1.6.3failed with:The pattern in
validate_requirements(^[a-zA-Z0-9_.-]+==[a-zA-Z0-9_.-]+$) has no room for extras. Extras only choose optional parts of the same package, so the version stays fixed. The template's requirements merge already handles them, both the current one and the one in CellMigrationLab/LabConstrictor#55.Changes
requirements_format.py(new): the accepted format,package==versionorpackage[extra1,extra2]==version. It lives outsideapp.py, which builds the Streamlit page on import, so tests can check it, likeplaceholders.py.app.py:validate_requirementsuses it, and the error message names both forms. Only those lines change, and the file keeps its CR LF line endings.tests/test_requirements_format.py: fixed versions with and without extras are accepted (includingcolabfold[alphafold, openmm]). Ranges, wildcards (==2.*), platform markers, Git URLs, unpinned names and malformed extras ([],[a,], an unclosed[) are still refused.The policy is unchanged: only fixed versions are accepted.
Verified
test_placeholdersandtest_app_manifestpass locally.test_manifest_formneeds Streamlit, which CI installs.packaging.requirements.Requirement) readscolabfold[alphafold,openmm]==1.6.3ascolabfold, extrasalphafoldandopenmm, version==1.6.3.merge_requirements.pyand the one in Template 0.1.31: no silent change of a notebook's package versions, no lost work when a notebook is updated LabConstrictor#55 write the line torequirements.txtunchanged. The 0.1.31 one also combines the extras that two notebooks ask for.mainafter the merge.🤖 Generated with Claude Code