Skip to content

Add Python 3.10+ version constraints and GitHub workflow permissions - #316

Merged
ekzhu merged 3 commits into
masterfrom
claude/add-workflow-permissions-yEcLZ
Apr 17, 2026
Merged

Add Python 3.10+ version constraints and GitHub workflow permissions#316
ekzhu merged 3 commits into
masterfrom
claude/add-workflow-permissions-yEcLZ

Conversation

@ekzhu

@ekzhu ekzhu commented Apr 17, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

  • Add Python version constraints (python_version >= '3.10') to nltk and pytest dependencies in pyproject.toml to ensure compatibility with newer versions
  • Add explicit permissions blocks to all GitHub Actions workflows following the principle of least privilege:
    • contents: read for build, checks, test, and database test workflows
    • contents: write for documentation workflow (needed for publishing)
  • Update documentation example to use placeholder values instead of real credentials in MongoDB connection string

Checklist

  • Are unit tests passing?
  • Documentation added/updated for all public APIs?
  • Is this a breaking change? If yes, add "[BREAKING]" to the PR title.

https://claude.ai/code/session_01TpxJA1jStTbtLqB6FgNFm4

claude added 2 commits April 17, 2026 22:47
Add minimal permission blocks to GitHub Actions workflows flagged by
code scanning, and replace a sample MongoDB Atlas connection string
in the docs with a placeholder to silence secret scanning.

https://claude.ai/code/session_01TpxJA1jStTbtLqB6FgNFm4
Pin nltk>=3.9.4 and pytest>=9.0.3 on Python >= 3.10 to pick up fixes
for the critical nltk zip-slip, the nltk path traversal, the nltk
wordnet_app XSS/remote-shutdown/recursion issues, and the pytest
tmpdir CVE. Both fix versions dropped Python 3.9 support, so the
constraint is guarded by a python_version marker to keep 3.9 builds
resolvable.

Pillow remains at the most recent version compatible with each Python
(12.2.0 on >=3.10, 11.3.0 on 3.9); the outstanding Pillow PSD/FITS
alerts only affect the 3.9 resolution and cannot be fixed without
dropping 3.9 support.

https://claude.ai/code/session_01TpxJA1jStTbtLqB6FgNFm4

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation to use placeholders for MongoDB connection strings and bumps the package version to 1.10.0. It also updates dependency constraints for nltk and pytest in pyproject.toml to target Python 3.10 and above. Feedback was provided to include constraints for Python versions older than 3.10, as the current changes would leave those environments without necessary dependencies for benchmarks and testing.

Comment thread pyproject.toml
"SetSimilaritySearch>=0.1.7",
"pyfarmhash>=0.2.2",
"nltk>=3.4.5",
"nltk>=3.9.4; python_version >= '3.10'",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The current change restricts nltk to Python 3.10 and above. Since the project appears to support older Python versions (as indicated by the numpy markers in uv.lock), this will cause nltk to be missing from the environment on Python < 3.10. If nltk is still required for benchmarks on older versions, you should provide a version constraint for those as well.

Suggested change
"nltk>=3.9.4; python_version >= '3.10'",
"nltk>=3.4.5; python_version < '3.10'",
"nltk>=3.9.4; python_version >= '3.10'",

Comment thread pyproject.toml
"nose>=1.3.7",
"nose-exclude>=0.5.0",
"pytest",
"pytest>=9.0.3; python_version >= '3.10'",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Restricting pytest to Python 3.10+ will prevent the test suite from being installed and run on older Python versions. To maintain support for Python < 3.10, you should include a compatible version of pytest for those environments.

Suggested change
"pytest>=9.0.3; python_version >= '3.10'",
"pytest; python_version < '3.10'",
"pytest>=9.0.3; python_version >= '3.10'",

Addresses gemini-code-assist review: the python_version >= '3.10'
marker on its own drops these packages from the resolution on Python
3.9 entirely. Add fallback entries so Python 3.9 users still get
nltk>=3.4.5 (the previous minimum) and an unpinned pytest.

https://claude.ai/code/session_01TpxJA1jStTbtLqB6FgNFm4
@ekzhu
ekzhu merged commit c7c8df0 into master Apr 17, 2026
25 checks passed
@ekzhu
ekzhu deleted the claude/add-workflow-permissions-yEcLZ branch April 17, 2026 23:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants