Repository navigation
Add the remaining pre-commit hooks, adopt sphinx-scrapy - #26
Conversation
Add blacken-docs, pre-commit-hooks, sphinx-lint, sphinx-scrapy and zizmor, matching the pre-commit configuration of Scrapy. Adopt sphinx-scrapy for the docs and fix the findings of the new hooks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
===========================================
+ Coverage 85.71% 98.09% +12.38%
===========================================
Files 4 4
Lines 105 105
Branches 19 19
===========================================
+ Hits 90 103 +13
+ Misses 11 0 -11
+ Partials 4 2 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
| push: | ||
| tags: | ||
| - "[0-9]+.[0-9]+.[0-9]+" | ||
| permissions: {} |
There was a problem hiding this comment.
This line seems unnecessary. I also wonder why the permissions line is nested under jobs instead of here.
| @@ -1,2 +1 @@ | |||
| Sphinx==7.2.4 # https://github.com/sphinx-doc/sphinx/issues/11662#issuecomment-1699989128 | |||
| sphinx-rtd-theme==1.3.0 | |||
| sphinx-scrapy==0.13.0 | |||
There was a problem hiding this comment.
Could you switch the project to use requirements.in / requirements.txt?
- Add the Dependabot config used in Scrapy to upgrade GitHub Actions. - Add docs/requirements.in and compile docs/requirements.txt from it with uv. - Set permissions (contents: read) at the workflow level instead of per job.
|
Could you also do zytedata/url-matcher#30 here? It may feel a bit out of scope, but given the CI failure, it may be easiest to handle it now here. |
- Require Python 3.10+; CI and classifiers now cover 3.10-3.15. This also fixes the 3.9 CI jobs, as sphinx-scrapy requires 3.10+. - Replace the nonexistent "min" tox env in CI with min-1x and min-2x, and pin scrapy==2.6.0 and w3lib<2 there, since Scrapy 1.0.0 cannot be imported on Python 3.10. - Bump ruff (hook id is now ruff-check), black, mypy, pytest, twine and build, and ignore PLC0415 in tests/test_params.py. - Add the "Typing :: Typed" classifier.
Thanks Adrian. |
| python -m build | ||
| - name: Publish to PyPI | ||
| uses: pypa/gh-action-pypi-publish@v1.10.2 | ||
| uses: pypa/gh-action-pypi-publish@897895f1e160c830e369f9779632ebc134688e1b # v1.10.2 # zizmor: ignore[use-trusted-publishing] |
There was a problem hiding this comment.
Let’s switch to trusted publishing. (I’ll handle the PyPI setup)
Grant the deploy job id-token: write and drop the PYPI_TOKEN secret and the zizmor ignore for use-trusted-publishing.
|
@AdrianAtZyte thanks, I have fixed tox errors. |
- Run the check jobs on 3.14, as the docs env requires it (matches .readthedocs.yml). - Bump pytest-mypy-testing to 0.2.0; 0.1.3 requires pytest<9. - Remove the extra blank line at the end of publish.yml.
Aligns the pre-commit config with Scrapy's: adds blacken-docs, pre-commit-hooks (end-of-file-fixer, trailing-whitespace), sphinx-lint, sphinx-scrapy and zizmor.
sphinx-scrapy adoption
Following scrapy/parsel#380:
[tool.sphinx-scrapy]inpyproject.toml,sphinx_scrapyextension indocs/conf.pydocs/requirements.txtpinssphinx-scrapy==0.13.0;tox.iniusessphinx-scrapy[tox]and the custom docs env is removed.readthedocs.ymlbuilds via tox;docs/.gitignoreaddeddocs/_extremoved: it registered the same directives as sphinx-scrapy, which fails the buildhtml_themedropped, assphinx_rtd_themeis no longer installed (docs now use the default theme)Hook fixes
MANIFEST.inpersist-credentials: false, minimalpermissionspublish.ymlis suppressed inline; moving to trusted publishing needs PyPI-side setup.Verification
pre-commit run --all-filesandtox -e docspass.Jira: DC-1353
🤖 Generated with Claude Code