Conversation
Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com> Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/d7dbd434-2d27-4a08-914d-d8410e3a63e4
Co-authored-by: BYVoid <245270+BYVoid@users.noreply.github.com> Agent-Logs-Url: https://github.com/BYVoid/OpenCC/sessions/fe063606-4785-4a11-ba16-6dcbdaaa7c80
setuptools 78.x requires Python >= 3.9, so building for Python 3.8 fails after the setuptools minimum was raised to 78.1.1. Remove 3.8 from the CI test matrix and all release scripts (Linux, macOS, Windows), and update the twine upload environments from py3.8 to py3.9.
There was a problem hiding this comment.
Pull request overview
Addresses Dependabot security alerts by upgrading JavaScript dev dependencies and Python build tooling, plus updating CI/release automation to reflect the new supported Python baseline.
Changes:
- Upgrade
mochaand add npmoverridesto force patched transitive dependencies. - Raise Python build requirement to
setuptools>=78.1.1and update CI/release scripts to drop Python 3.8. - Update PyPI release workflow to use
actions/checkout@v4.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
package.json |
Bumps mocha and adds overrides for vulnerable transitive deps. |
package-lock.json |
Lockfile updates reflecting the dependency upgrades and audits. |
pyproject.toml |
Raises setuptools minimum for builds. |
.github/workflows/release-pypi.yml |
Updates checkout action version for the PyPI release workflow. |
.github/workflows/python.yml |
Removes Python 3.8 from the unit-test matrix. |
release-pypi-linux.sh |
Removes Python 3.8 from the build loop and changes upload env to py3.9. |
release-pypi-macos.sh |
Removes Python 3.8 from the build loop and changes upload env to py3.9. |
release-pypi-windows.cmd |
Removes Python 3.8 from the build loop and changes upload env to py3.9. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "mocha": "^11.7.5", | ||
| "node-pre-gyp-github": "^2.0.0" |
There was a problem hiding this comment.
Mocha v11 requires Node ^18.18.0 || ^20.9.0 || >=21.1.0 (per the lockfile), but this package advertises engines.node: >=20 <25. With Node 20.0–20.8, npm test will fail even though the engine range claims support; consider bumping the minimum engine to >=20.9.0 (or widening to include 18.18 if intended).
| if NOT "%~1"=="testonly" ( | ||
| REM Upload to PyPI | ||
| C:\Miniconda/condabin/conda.bat activate py3.8 | ||
| C:\Miniconda/condabin/conda.bat activate py3.9 |
There was a problem hiding this comment.
This invokes conda.bat from within a batch script without CALL, which transfers control and prevents the subsequent python -m pip ... / twine upload commands from running. Use CALL C:\Miniconda\condabin\conda.bat activate py3.9 (consistent with the other conda calls above).
| C:\Miniconda/condabin/conda.bat activate py3.9 | |
| CALL C:\Miniconda/condabin/conda.bat activate py3.9 |
| [build-system] | ||
| requires = ["setuptools>=61", "wheel"] | ||
| requires = ["setuptools>=78.1.1", "wheel"] | ||
| build-backend = "setuptools.build_meta" |
There was a problem hiding this comment.
This build-system change effectively drops Python 3.8 (newer setuptools does not support it), but the repository's package metadata (e.g., setup.py) does not declare a minimum supported Python version. Consider adding python_requires >=3.9 (and/or classifiers) so pip can fail fast with a clear message instead of failing during build.
| build-backend = "setuptools.build_meta" | |
| build-backend = "setuptools.build_meta" | |
| [project] | |
| requires-python = ">=3.9" | |
| classifiers = [ | |
| "Programming Language :: Python :: 3", | |
| "Programming Language :: Python :: 3.9", | |
| "Programming Language :: Python :: 3.10", | |
| "Programming Language :: Python :: 3.11", | |
| "Programming Language :: Python :: 3.12", | |
| "Programming Language :: Python :: 3 :: Only", | |
| ] |
| matrix: | ||
| python-version: [3.8, 3.9, "3.10", "3.11", "3.12", "3.13", "3.14"] | ||
| python-version: [3.9, "3.10", "3.11", "3.12", "3.13", "3.14"] |
There was a problem hiding this comment.
This PR removes Python 3.8 from the test matrix, which is a support-policy change beyond dependency upgrades. Please reflect this explicitly in the PR description/changelog (and ensure release scripts / packaging metadata align with the new minimum Python version).
| steps: | ||
| - uses: actions/checkout@v1 | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Build package and upload from docker (Linux) |
There was a problem hiding this comment.
steps: is followed by list items at the same indentation level, which makes this workflow YAML invalid and will prevent the workflow from running. Indent the - uses: / - name: entries under steps: (as done in other workflows).
Fix Dependabot security alerts #45, #47, #48: upgrade npm and Python build dependencies, drop Python 3.8 support.
Changes
npm (Dependabot alert #48)
mocha^9.2.1→^11.7.5— eliminates bulk of transitive vulns (minimatch ReDoS, nanoid, etc.)overridesinpackage.jsonto force patched transitive deps that mocha v11 still pins to vulnerable ranges:diff→^8.0.3(DoS — GHSA-73rr-hh4g-fpgx)serialize-javascript→^7.0.3(RCE — GHSA-5c6j-r48x-rmvq)npm audit fixpatched@octokit/endpoint,@octokit/request,@octokit/request-error,js-yamlpackage-lock.jsonaccordinglyPython build deps —
pyproject.toml(alerts #45, #47)setuptools>=61→setuptools>=78.1.1— patches:Drop Python 3.8 support
setuptools>=78.1.1requires Python >= 3.9, so Python 3.8 builds can no longer succeed. Removed 3.8 from:.github/workflows/python.yml— CI test matrixrelease-pypi-linux.sh— build loop and twine upload env (py3.8→py3.9)release-pypi-macos.sh— build loop and twine upload env (py3.8→py3.9)release-pypi-windows.cmd— build loop and twine upload env (py3.8→py3.9)GitHub Actions
.github/workflows/release-pypi.yml:actions/checkout@v1→@v4Files changed
package.jsonpackage-lock.jsonpyproject.toml.github/workflows/python.yml.github/workflows/release-pypi.ymlrelease-pypi-linux.shrelease-pypi-macos.shrelease-pypi-windows.cmdRemaining known issues
3 moderate
@octokit/plugin-paginate-restReDoS alerts remain vianode-pre-gyp-github@^2.0.0's pinned@octokit/rest@20.1.1— no fix available without reverting tonode-pre-gyp-github@1.4.5, which re-introduces 7 moderate vulns through an older@octokit/rest.