pyscaffoldext-pre-commit-ruff 1.0.2__tar.gz → 1.1.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. pyscaffoldext_pre_commit_ruff-1.1.1/.github/dependabot.yml +26 -0
  2. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/.github/workflows/publish-package.yml +13 -13
  3. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/.pre-commit-config.yaml +14 -9
  4. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/CHANGELOG.rst +42 -5
  5. pyscaffoldext_pre_commit_ruff-1.1.1/CONTRIBUTING.rst +463 -0
  6. {pyscaffoldext_pre_commit_ruff-1.0.2/src/pyscaffoldext_pre_commit_ruff.egg-info → pyscaffoldext_pre_commit_ruff-1.1.1}/PKG-INFO +43 -7
  7. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/README.rst +37 -6
  8. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/environment.yml +0 -1
  9. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/setup.cfg +5 -0
  10. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext/pre_commit_ruff/extension.py +1 -2
  11. pyscaffoldext_pre_commit_ruff-1.1.1/src/pyscaffoldext/pre_commit_ruff/templates/pre-commit-ruff-config.template +80 -0
  12. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1/src/pyscaffoldext_pre_commit_ruff.egg-info}/PKG-INFO +43 -7
  13. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/SOURCES.txt +1 -1
  14. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/tests/conftest.py +2 -2
  15. pyscaffoldext_pre_commit_ruff-1.0.2/.cirrus.yml +0 -195
  16. pyscaffoldext_pre_commit_ruff-1.0.2/CONTRIBUTING.rst +0 -342
  17. pyscaffoldext_pre_commit_ruff-1.0.2/src/pyscaffoldext/pre_commit_ruff/templates/pre-commit-ruff-config.template +0 -37
  18. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/.coveragerc +0 -0
  19. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/.gitignore +0 -0
  20. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/.readthedocs.yml +0 -0
  21. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/AUTHORS.rst +0 -0
  22. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/LICENSE.txt +0 -0
  23. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/Makefile +0 -0
  24. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/_static/.gitignore +0 -0
  25. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/authors.rst +0 -0
  26. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/changelog.rst +0 -0
  27. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/conf.py +0 -0
  28. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/contributing.rst +0 -0
  29. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/index.rst +0 -0
  30. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/license.rst +0 -0
  31. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/readme.rst +0 -0
  32. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/docs/requirements.txt +0 -0
  33. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/pyproject.toml +0 -0
  34. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/setup.py +0 -0
  35. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext/pre_commit_ruff/__init__.py +0 -0
  36. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext/pre_commit_ruff/templates/__init__.py +0 -0
  37. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext/pre_commit_ruff/templates/pyproject_toml.template +0 -0
  38. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext/pre_commit_ruff/templates/setup_cfg.template +0 -0
  39. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/dependency_links.txt +0 -0
  40. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/entry_points.txt +0 -0
  41. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/not-zip-safe +0 -0
  42. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/requires.txt +0 -0
  43. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/src/pyscaffoldext_pre_commit_ruff.egg-info/top_level.txt +0 -0
  44. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/tests/__init__.py +0 -0
  45. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/tests/helpers.py +0 -0
  46. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/tests/test_custom_extension.py +0 -0
  47. {pyscaffoldext_pre_commit_ruff-1.0.2 → pyscaffoldext_pre_commit_ruff-1.1.1}/tox.ini +0 -0
@@ -0,0 +1,26 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ day: "friday"
8
+ time: "06:00"
9
+ groups:
10
+ core-actions:
11
+ patterns:
12
+ - "actions/*"
13
+ setup-actions:
14
+ patterns:
15
+ - "actions/setup-*"
16
+ security:
17
+ patterns:
18
+ - "*security*"
19
+ commit-message:
20
+ prefix: "deps"
21
+ include: "scope"
22
+ open-pull-requests-limit: 10
23
+ rebase-strategy: "auto"
24
+ labels:
25
+ - "dependencies"
26
+ - "github-actions"
@@ -32,9 +32,9 @@ jobs:
32
32
  outputs:
33
33
  wheel-distribution: ${{ steps.wheel-distribution.outputs.path }}
34
34
  steps:
35
- - uses: actions/checkout@v4
35
+ - uses: actions/checkout@v6
36
36
  with: { fetch-depth: 0 } # deep clone for setuptools-scm
37
- - uses: actions/setup-python@v5
37
+ - uses: actions/setup-python@v6
38
38
  id: setup-python
39
39
  with: { python-version: "3.10" }
40
40
  - name: Run static analysis and format checkers
@@ -49,7 +49,7 @@ jobs:
49
49
  - name: Store the distribution files for use in other stages
50
50
  # `tests` and `publish` will use the same pre-built distributions,
51
51
  # so we make sure to release the exact same package that was tested
52
- uses: actions/upload-artifact@v4
52
+ uses: actions/upload-artifact@v7
53
53
  with:
54
54
  name: python-distribution-files
55
55
  path: dist/
@@ -68,18 +68,18 @@ jobs:
68
68
  # - windows-latest
69
69
  runs-on: ${{ matrix.platform }}
70
70
  steps:
71
- - uses: actions/checkout@v4
71
+ - uses: actions/checkout@v6
72
72
  - name: Setup git user
73
73
  run: |
74
74
  git config --global user.name "$(git --no-pager log --format=format:'%an' -n 1)"
75
75
  git config --global user.email "$(git --no-pager log --format=format:'%ae' -n 1)"
76
- - uses: actions/setup-python@v5
76
+ - uses: actions/setup-python@v6
77
77
  id: setup-python
78
78
  with:
79
79
  python-version: ${{ matrix.python }}
80
- - uses: rhysd/action-setup-vim@v1.3.5
80
+ - uses: rhysd/action-setup-vim@v1.6.1
81
81
  - name: Retrieve pre-built distribution files
82
- uses: actions/download-artifact@v4
82
+ uses: actions/download-artifact@v8
83
83
  with: { name: python-distribution-files, path: dist/ }
84
84
  - name: Run tests
85
85
  run: >-
@@ -89,7 +89,7 @@ jobs:
89
89
  - name: Generate coverage report
90
90
  run: pipx run coverage lcov -o coverage.lcov
91
91
  - name: Coveralls GitHub Action
92
- uses: coverallsapp/github-action@v2.3.4
92
+ uses: coverallsapp/github-action@v2.3.6
93
93
  with:
94
94
  path-to-lcov: coverage.lcov
95
95
  github-token: ${{ secrets.GITHUB_TOKEN }}
@@ -101,7 +101,7 @@ jobs:
101
101
  runs-on: ubuntu-latest
102
102
  steps:
103
103
  - name: Finalize coverage report
104
- uses: coverallsapp/github-action@v2.3.4
104
+ uses: coverallsapp/github-action@v2.3.6
105
105
  with:
106
106
  github-token: ${{ secrets.GITHUB_TOKEN }}
107
107
  parallel-finished: true
@@ -121,7 +121,7 @@ jobs:
121
121
 
122
122
  steps:
123
123
  - name: Retrieve pre-built distribution files
124
- uses: actions/download-artifact@v4
124
+ uses: actions/download-artifact@v8
125
125
  with: { name: python-distribution-files, path: dist/ }
126
126
  - name: Publish distribution 📦 to TestPyPI
127
127
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -142,7 +142,7 @@ jobs:
142
142
  id-token: write # IMPORTANT: mandatory for trusted publishing
143
143
  steps:
144
144
  - name: Retrieve pre-built distribution files
145
- uses: actions/download-artifact@v4
145
+ uses: actions/download-artifact@v8
146
146
  with: { name: python-distribution-files, path: dist/ }
147
147
  - name: Publish distribution 📦 to PyPI
148
148
  uses: pypa/gh-action-pypi-publish@release/v1
@@ -160,10 +160,10 @@ jobs:
160
160
 
161
161
  steps:
162
162
  - name: Download all the dists
163
- uses: actions/download-artifact@v4
163
+ uses: actions/download-artifact@v8
164
164
  with: { name: python-distribution-files, path: dist/ }
165
165
  - name: Sign the dists with Sigstore
166
- uses: sigstore/gh-action-sigstore-python@v3.0.0
166
+ uses: sigstore/gh-action-sigstore-python@v3.3.0
167
167
  with:
168
168
  inputs: >-
169
169
  ./dist/*.tar.gz
@@ -2,7 +2,7 @@ exclude: "^docs/conf.py"
2
2
 
3
3
  repos:
4
4
  - repo: https://github.com/pre-commit/pre-commit-hooks
5
- rev: v5.0.0
5
+ rev: v6.0.0
6
6
  hooks:
7
7
  - id: trailing-whitespace
8
8
  - id: check-added-large-files
@@ -20,7 +20,7 @@ repos:
20
20
  ## ruff-pre-commit
21
21
  - repo: https://github.com/astral-sh/ruff-pre-commit
22
22
  # Ruff version.
23
- rev: v0.7.0
23
+ rev: v0.15.10
24
24
  hooks:
25
25
  # Run the linter.
26
26
  - id: ruff
@@ -32,14 +32,19 @@ repos:
32
32
 
33
33
  ## Check for misspells in documentation files:
34
34
  - repo: https://github.com/codespell-project/codespell
35
- rev: v2.3.0
35
+ rev: v2.4.2
36
36
  hooks:
37
37
  - id: codespell
38
38
 
39
- ## pre-commit-rst-lint
40
- - repo: https://github.com/hoefling/pre-commit-rst-lint
41
- rev: "0ea7c4e56416e3d38012dfcccecd35a7d95bd1dd"
39
+ # ## pre-commit-rst-lint
40
+ # - repo: https://github.com/hoefling/pre-commit-rst-lint
41
+ # rev: "0ea7c4e56416e3d38012dfcccecd35a7d95bd1dd"
42
+ # hooks:
43
+ # - id: rst-lint
44
+ # exclude: ^docs
45
+ # additional_dependencies: [pygments]
46
+
47
+ - repo: https://github.com/sphinx-contrib/sphinx-lint
48
+ rev: v1.0.2
42
49
  hooks:
43
- - id: rst-lint
44
- exclude: ^docs
45
- additional_dependencies: [pygments]
50
+ - id: sphinx-lint
@@ -2,7 +2,6 @@
2
2
  Changelog
3
3
  =========
4
4
 
5
-
6
5
  All notable changes to this project will be documented in this file.
7
6
 
8
7
  The format is based on `Keep a Changelog`_, and this project adheres to
@@ -20,6 +19,36 @@ Changed
20
19
  Removed
21
20
  -------
22
21
 
22
+ `1.1.1`_ 2026-04-11
23
+ ===================
24
+
25
+ Added
26
+ -----
27
+
28
+ - CI badges.
29
+ - `Dependabot`_ Github configuration.
30
+ - `pre-commit-hooks`_ ``name-tests-test`` ``--pytest-test-first``.
31
+ - `Markdown Lint`_
32
+ - `mdformat`_
33
+ - `gitlint`_
34
+ - `pyproject-fmt`_
35
+ - Add maintenance instructions for ``Github actions`` and ``Dependabot`` to
36
+ :doc:`Contributing <contributing>`.
37
+
38
+ Changed
39
+ -------
40
+
41
+ - Sort and format ``.pre-commit-config.yaml``.
42
+ - Enable Ruff show fixes.
43
+ - Don't enable `pyproject-fmt`_ by default.
44
+ - Replace `rst-lint <https://github.com/hoefling/pre-commit-rst-lint>`_ with
45
+ `Sphinx-lint <https://github.com/sphinx-contrib/sphinx-lint>`_.
46
+
47
+ Removed
48
+ -------
49
+
50
+ - Unused ``Cirrus`` CI configuration.
51
+
23
52
  `1.0.2`_ 2025-12-05
24
53
  ===================
25
54
 
@@ -64,9 +93,17 @@ Removed
64
93
  - ``flake8`` template and configuration
65
94
  - ``[testenv:publish]`` in ``tox.ini``
66
95
 
96
+ .. _1.0.0: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/3e1993e7efea9da6d7e8007317cc6d3ea3333a65...1.0.0
97
+ .. _1.0.1: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.0...1.0.1
98
+ .. _1.0.2: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.1...1.0.2
99
+ .. _1.1.1: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.2...1.1.1
100
+ .. _Unreleased: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.1.1...HEAD
101
+ .. _Dependabot: https://github.com/dependabot
67
102
  .. _Keep a Changelog: https://keepachangelog.com/en/1.0.0/
103
+ .. _Markdown Lint: https://github.com/igorshubovych/markdownlint-cli
68
104
  .. _Semantic Versioning: https://semver.org/spec/v2.0.0.html
69
- .. _Unreleased: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.2...HEAD
70
- .. _1.0.2: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.1...1.0.2
71
- .. _1.0.1: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/1.0.0...1.0.1
72
- .. _1.0.0: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/compare/3e1993e7efea9da6d7e8007317cc6d3ea3333a65...1.0.0
105
+ .. _gitlint: https://github.com/hukkin/mdformat
106
+ .. _mdformat: https://github.com/hukkin/mdformat
107
+ .. _pre-commit-hooks: https://github.com/pre-commit/pre-commit-hooks
108
+ .. _pre-commit: https://pre-commit.com/
109
+ .. _pyproject-fmt: https://github.com/tox-dev/pyproject-fmt
@@ -0,0 +1,463 @@
1
+ .. _contributing:
2
+
3
+ ============
4
+ Contributing
5
+ ============
6
+
7
+ Welcome to ``pyscaffoldext-pre-commit-ruff`` contributor's guide.
8
+
9
+ This document focuses on getting any potential contributor familiarized with
10
+ the development processes, but `other kinds of contributions`_ are also
11
+ appreciated.
12
+
13
+ If you are new to using `git`_ or have never collaborated in a project
14
+ previously, please have a look at `contribution-guide.org`_.
15
+ Other resources are also listed in the excellent `guide created by
16
+ FreeCodeCamp`_ [1]_.
17
+
18
+ Please notice, all users and contributors are expected to be **open,
19
+ considerate, reasonable, and respectful**. When in doubt,
20
+ `Python Software Foundation's Code of Conduct`_ is a good reference in terms
21
+ of behavior guidelines.
22
+
23
+ Please follow `pyscaffold's contributor's guide`_.
24
+
25
+
26
+ Issue Reports
27
+ -------------
28
+
29
+ If you experience bugs or general issues with
30
+ ``pyscaffoldext-pre-commit-ruff``, please have a look on the
31
+ `issue tracker`_. If you don't see anything useful there, please feel
32
+ free to fire an issue report.
33
+
34
+ .. container:: {tip}
35
+
36
+ Please don't forget to include the closed issues in your search.
37
+ Sometimes a solution was already reported, and the problem is considered
38
+ **solved**.
39
+
40
+ New issue reports should include information about your programming
41
+ environment (e.g., operating system, Python version) and steps to reproduce
42
+ the problem.
43
+ Please try also to simplify the reproduction steps to a very minimal example
44
+ that still illustrates the problem you are facing. By removing other factors,
45
+ you help us to identify the root cause of the issue.
46
+
47
+
48
+ Documentation Improvements
49
+ --------------------------
50
+
51
+ You can help improve ``pyscaffoldext-pre-commit-ruff`` docs by making them
52
+ more readable and coherent, or by adding missing information and correcting
53
+ mistakes.
54
+
55
+ ``pyscaffoldext-pre-commit-ruff`` documentation uses `Sphinx`_ as its main
56
+ documentation compiler. This means that the docs are kept in the same
57
+ repository as the project code, and that any documentation update is done in
58
+ the same way was a code contribution—i.e., `reStructuredText`_.
59
+
60
+ .. container:: {tip}
61
+
62
+ Please notice that the `GitHub web interface`_ provides a quick way to
63
+ propose changes in ``pyscaffoldext-pre-commit-ruff``\ 's files. While this
64
+ mechanism can be tricky for normal code contributions, it works perfectly
65
+ fine for contributing to the docs, and can be quite handy.
66
+
67
+ If you are interested in trying this method out, please navigate to the
68
+ ``docs`` folder in the source `repository`_, find which file you would
69
+ like to propose changes and click in the little pencil icon at the top, to
70
+ open `GitHub's code editor`_. Once you finish editing the file, please
71
+ write a message in the form at the bottom of the page describing which
72
+ changes have you made and what are the motivations behind them and submit
73
+ your proposal.
74
+
75
+ When working on documentation changes in your local machine, you can compile
76
+ them using `tox`_ :
77
+
78
+ .. code:: bash
79
+
80
+ tox -e docs
81
+
82
+ and use Python's built-in web server for a preview in your web browser
83
+ (``http://localhost:8000``):
84
+
85
+ .. code:: bash
86
+
87
+ python3 -m http.server --bind localhost 8000 --directory 'docs/_build/html'
88
+
89
+
90
+ Code Contributions
91
+ ------------------
92
+
93
+ The architecture follows `Extending PyScaffold`_.
94
+
95
+ Submit an issue
96
+ ~~~~~~~~~~~~~~~
97
+
98
+ Before you work on any non-trivial code contribution it's best to first
99
+ create a report in the `issue tracker`_ to start a discussion on the subject.
100
+ This often provides additional considerations and avoids unnecessary work.
101
+
102
+ Create an environment
103
+ ~~~~~~~~~~~~~~~~~~~~~
104
+
105
+ Before you start coding, we recommend creating an isolated `virtual
106
+ environment`_ to avoid any problems with your installed Python packages.
107
+ This can easily be done via either `uv`_:
108
+
109
+ ::
110
+
111
+ uv tool install tox --with tox-uv
112
+ uv venv <PATH TO VENV>
113
+ source <PATH TO VENV>/bin/activate
114
+
115
+ or `conda`_:
116
+
117
+ ::
118
+
119
+ conda create -n pyscaffoldext-pre-commit-ruff python=3 six virtualenv pytest pytest-cov
120
+ conda activate pyscaffoldext-pre-commit-ruff
121
+
122
+ Clone the repository
123
+ ~~~~~~~~~~~~~~~~~~~~
124
+
125
+ 1. Create an user account on GitHub if you do not already have one.
126
+
127
+ 2. Fork the project `repository`_: click on the *Fork* button near the top of
128
+ the page. This creates a copy of the code under your account on GitHub.
129
+
130
+ 3. Clone this copy to your local disk:
131
+
132
+ ::
133
+
134
+ git clone https://github.com/YourLogin/pyscaffoldext-pre-commit-ruff.git
135
+ cd pyscaffoldext-pre-commit-ruff
136
+
137
+ 4. You should run:
138
+
139
+ ::
140
+
141
+ uv pip install -e .
142
+
143
+ to be able to import the package under development in the Python REPL.
144
+
145
+ 5. Install `pre-commit`_:
146
+
147
+ .. code:: bash
148
+
149
+ uv tool install pre-commit
150
+ pre-commit install
151
+
152
+ ``pyscaffoldext-pre-commit-ruff`` comes with a lot of hooks configured to
153
+ automatically help the developer to check the code being written.
154
+
155
+ Implement your changes
156
+ ~~~~~~~~~~~~~~~~~~~~~~
157
+
158
+ 1. Create a branch to hold your changes:
159
+
160
+ .. code:: bash
161
+
162
+ git checkout -b my-feature
163
+
164
+ and start making changes. Never work on the main branch!
165
+
166
+ 2. Start your work on this branch. Don't forget to add `docstrings`_ to new
167
+ functions, modules and classes, especially if they are part of public APIs.
168
+
169
+ 3. Add yourself to the list of contributors in ``AUTHORS.rst``.
170
+
171
+ 4. When you're done editing, do:
172
+
173
+ .. code:: bash
174
+
175
+ git add <MODIFIED FILES>
176
+ git commit
177
+
178
+ to record your changes in `git`_.
179
+
180
+ Please make sure to see the validation messages from `pre-commit`_ and fix
181
+ any eventual issues.
182
+ This should automatically use `ruff`_ to check/fix the code style
183
+ in a way that is compatible with the project.
184
+
185
+ .. container:: {important}
186
+
187
+ Don't forget to add unit tests and documentation in case your
188
+ contribution adds an additional feature and is not just a bugfix.
189
+
190
+ Moreover, writing a `descriptive commit message`_ is highly recommended.
191
+ In case of doubt, you can check the commit history with:
192
+
193
+ .. code:: bash
194
+
195
+ git log --graph --decorate --pretty=oneline --abbrev-commit --all
196
+
197
+ to look for recurring communication patterns.
198
+
199
+ 5. Please check that your changes don't break any unit tests with:
200
+
201
+ ::
202
+
203
+ tox
204
+
205
+ (after having installed `tox`_ with ``uv tool install tox --with tox-uv``
206
+ or ``pipx``).
207
+
208
+ You can also use `tox`_ to run several other pre-configured tasks in the
209
+ repository. Try ``tox -av`` to see a list of the available checks.
210
+
211
+ Submit your contribution
212
+ ~~~~~~~~~~~~~~~~~~~~~~~~
213
+
214
+ 1. If everything works fine, push your local branch to the remote server with:
215
+
216
+ .. code:: bash
217
+
218
+ git push -u origin my-feature
219
+
220
+ 2. Go to the web page of your fork and click "Create pull request" to send
221
+ your changes for review.
222
+
223
+ Find more detailed information in `creating a PR`_. You might also want to
224
+ open the PR as a draft first and mark it as ready for review after the
225
+ feedbacks from the continuous integration (CI) system or any required
226
+ fixes.
227
+
228
+ Troubleshooting
229
+ ~~~~~~~~~~~~~~~
230
+
231
+ The following tips can be used when facing problems to build or test the
232
+ package:
233
+
234
+ 1. Make sure to fetch all the tags from the upstream `repository`_.
235
+ The command ``git describe --abbrev=0 --tags`` should return the version you
236
+ are expecting. If you are trying to run CI scripts in a fork repository,
237
+ make sure to push all the tags.
238
+ You can also try to remove all the egg files or the complete egg folder,
239
+ i.e., ``.eggs``, as well as the ``*.egg-info`` folders in the ``src``
240
+ folder or potentially in the root of your project.
241
+
242
+ 2. Sometimes `tox`_ misses out when new dependencies are added, especially to
243
+ ``setup.cfg`` and ``docs/requirements.txt``. If you find any problems with
244
+ missing dependencies when running a command with `tox`_, try to recreate
245
+ the ``tox`` environment using the ``-r`` flag. For example, instead of:
246
+
247
+ .. code:: bash
248
+
249
+ tox -e docs
250
+
251
+ Try running:
252
+
253
+ .. code:: bash
254
+
255
+ tox -r -e docs
256
+
257
+ 3. Make sure to have a reliable `tox`_ installation that uses the correct
258
+ Python version (e.g., 3.7+). When in doubt you can run:
259
+
260
+ .. code:: bash
261
+
262
+ tox --version
263
+ # OR
264
+ which tox
265
+
266
+ If you have trouble and are seeing weird errors upon running `tox`_, you
267
+ can also try to create a dedicated `virtual environment`_ with a `tox`_
268
+ binary freshly installed. For example:
269
+
270
+ .. code:: bash
271
+
272
+ uv venv .venv
273
+ source .venv/bin/activate
274
+ .venv/bin/pip install tox
275
+ .venv/bin/tox -e all
276
+
277
+ 4. `Pytest can drop you`_ in an interactive session in the case an error
278
+ occurs. In order to do that you need to pass a ``--pdb`` option (for
279
+ example by running ``tox -- -k <NAME OF THE FALLING TEST> --pdb``).
280
+ You can also setup breakpoints manually instead of using the ``--pdb``
281
+ option.
282
+
283
+
284
+ Maintainer tasks
285
+ ----------------
286
+
287
+ Releases
288
+ ~~~~~~~~
289
+
290
+ If you are part of the group of maintainers and have correct user permissions
291
+ on `PyPI`_, the following steps can be used to release a new version for
292
+ ``pyscaffoldext-pre-commit-ruff``:
293
+
294
+ 1. Make sure all unit tests are successful.
295
+ 2. Tag the current commit on the main branch with a release tag, e.g.,
296
+ ``v1.2.3``.
297
+ 3. Push the new tag to the upstream `repository`_, e.g.,
298
+ ``git push upstream v1.2.3``
299
+ 4. Clean up the ``dist`` and ``build`` folders with ``tox -e clean``
300
+ (or ``rm -rf dist build``) to avoid confusion with old builds and Sphinx
301
+ docs.
302
+ 5. Run ``tox -e build`` and check that the files in ``dist`` have the correct
303
+ version (no ``.dirty`` or `git`_ hash) according to the `git`_ tag. Also
304
+ check the sizes of the distributions, if they are too big (e.g.,
305
+ > 500KB), unwanted clutter may have been accidentally included.
306
+
307
+ GitHub Actions & CI Maintenance
308
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
309
+
310
+ This project uses `GitHub Actions`_ for continuous integration, automated
311
+ publishing, and scheduled health checks. The primary workflow is defined in
312
+ ``.github/workflows/publish-package.yml``. Maintainers are responsible for
313
+ keeping CI infrastructure current, secure, and reliable.
314
+
315
+ Workflow overview
316
+ ^^^^^^^^^^^^^^^^^
317
+
318
+ The ``publish-package.yml`` workflow handles four concerns:
319
+
320
+ - **Build & lint** — checks out the repository (deep clone for
321
+ ``setuptools-scm``), runs `pre-commit`_ on all files, and builds the
322
+ distribution package.
323
+ - **Test matrix** — runs the test suite against multiple Python versions
324
+ using `tox`_, with coverage reported to `Coveralls`_.
325
+ - **Publish** — on tagged pushes, publishes the distribution to `TestPyPI`_
326
+ and then `PyPI`_ via `trusted publishing`_, and creates a signed
327
+ `GitHub Release`_ using `Sigstore`_.
328
+ - **Scheduled run** — a cron trigger (``0 0 1,16 * *``) runs the full
329
+ pipeline roughly every 15 days to catch breakage from upstream dependency
330
+ changes.
331
+
332
+ Dependabot
333
+ ^^^^^^^^^^
334
+
335
+ `Dependabot`_ automates dependency update pull requests for GitHub Actions
336
+ and Python packages. To enable it, create or update
337
+ ``.github/dependabot.yml``.
338
+
339
+ When reviewing Dependabot pull requests:
340
+
341
+ - **GitHub Actions updates** (e.g., ``actions/checkout``,
342
+ ``actions/setup-python``) should generally be merged promptly after CI
343
+ passes. These are low-risk and often contain security fixes.
344
+ - **Major version bumps** of actions (e.g., ``v4`` → ``v5``) may introduce
345
+ breaking changes. Review the action's release notes and changelog before
346
+ merging.
347
+ - **Python dependency updates** should be validated against the test suite.
348
+ Watch for deprecation warnings in the CI output that may signal future
349
+ breakage.
350
+ - If a Dependabot PR causes CI failures, comment on the PR with findings and
351
+ close it if the update is incompatible. Re-open or recreate when the issue
352
+ is resolved upstream.
353
+
354
+ Workflow update practices
355
+ ^^^^^^^^^^^^^^^^^^^^^^^^^
356
+
357
+ When editing ``.github/workflows/publish-package.yml`` or adding new
358
+ workflows, follow these practices:
359
+
360
+ 1. **Pin actions by major version tag**, not by ``main`` or full SHA alone.
361
+ For example, use ``actions/checkout@v4`` rather than a bare branch
362
+ reference. This balances reproducibility with receiving patch-level fixes.
363
+ If your security policy requires stricter pinning, use the full commit
364
+ SHA with a version comment:
365
+
366
+ .. code:: yaml
367
+
368
+ - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
369
+
370
+ 2. **Set minimal permissions** on the workflow and individual jobs.
371
+ The workflow already declares ``permissions: contents: read`` at the top
372
+ level and escalates only where needed (e.g., ``id-token: write`` for
373
+ trusted publishing, ``contents: write`` for GitHub Releases). Preserve
374
+ this principle when adding new jobs.
375
+
376
+ 3. **Test workflow changes in a branch or fork first.** Use
377
+ ``workflow_dispatch`` (already enabled) to trigger a manual run against
378
+ your branch before merging to ``main``.
379
+
380
+ 4. **Keep the Python version matrix current.** Update the ``matrix.python``
381
+ entries in the ``test`` job when new Python versions reach stable release
382
+ or old versions reach end-of-life.
383
+
384
+ 5. **Review third-party actions periodically.** The workflow uses several
385
+ community-maintained actions:
386
+
387
+ .. list-table::
388
+ :header-rows: 1
389
+ :widths: 40 60
390
+
391
+ * - Action
392
+ - Purpose
393
+ * - ``coverallsapp/github-action``
394
+ - Coverage reporting
395
+ * - ``rhysd/action-setup-vim``
396
+ - Vim/Neovim for tests
397
+ * - ``pypa/gh-action-pypi-publish``
398
+ - Trusted publishing to PyPI
399
+ * - ``sigstore/gh-action-sigstore-python``
400
+ - Artifact signing
401
+
402
+ Check each action's repository for deprecation notices, archived status,
403
+ or recommended migration paths at least once per release cycle.
404
+
405
+ CI maintenance checklist
406
+ ^^^^^^^^^^^^^^^^^^^^^^^^
407
+
408
+ Use this checklist before each release or when performing routine CI upkeep:
409
+
410
+ - Verify the scheduled cron run (``0 0 1,16 * *``) is producing green
411
+ builds. Check the **Actions** tab for recent scheduled runs.
412
+ - Confirm that `Coveralls`_ coverage reporting is functional and thresholds
413
+ have not regressed.
414
+ - Ensure the ``publish-to-testpypi`` and ``publish-to-pypi`` jobs reference
415
+ the correct `PyPI`_ environment names and URLs (see `trusted publishing`_).
416
+ - Audit repository secrets and environment configurations. The workflow uses
417
+ ``GITHUB_TOKEN`` (automatic) and `trusted publishing`_ (no API tokens
418
+ required). No manual secret rotation is needed for PyPI under this setup.
419
+ - Review and merge any open Dependabot PRs for GitHub Actions version bumps.
420
+ - After upgrading actions or changing the workflow, run a full
421
+ ``workflow_dispatch`` cycle and verify all jobs complete successfully
422
+ before tagging a release.
423
+
424
+
425
+ .. [1] Even though, these resources focus on open source projects and
426
+ communities, the general ideas behind collaborating with other developers
427
+ to collectively create software are general and can be applied to all
428
+ sorts of environments, including private companies and proprietary code
429
+ bases.
430
+
431
+
432
+ .. _other kinds of contributions: https://opensource.guide/how-to-contribute
433
+ .. _git: https://git-scm.com
434
+ .. _contribution-guide.org: https://www.contribution-guide.org/
435
+ .. _guide created by FreeCodeCamp: https://github.com/freecodecamp/how-to-contribute-to-open-source
436
+ .. _Python Software Foundation's Code of Conduct: https://www.python.org/psf/conduct/
437
+ .. _pyscaffold's contributor's guide: https://pyscaffold.org/en/stable/contributing.html
438
+ .. _issue tracker: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff/issues
439
+ .. _Sphinx: https://www.sphinx-doc.org/en/master/
440
+ .. _reStructuredText: https://www.sphinx-doc.org/en/master/usage/restructuredtext/
441
+ .. _GitHub web interface: https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files
442
+ .. _repository: https://github.com/jfishe/pyscaffoldext-pre-commit-ruff
443
+ .. _GitHub's code editor: https://docs.github.com/en/repositories/working-with-files/managing-files/editing-files
444
+ .. _tox: https://tox.readthedocs.io/en/stable/
445
+ .. _Extending PyScaffold: https://pyscaffold.org/en/stable/extensions.html#extending-pyscaffold
446
+ .. _virtual environment: https://realpython.com/python-virtual-environments-a-primer/
447
+ .. _uv: https://docs.astral.sh/uv/
448
+ .. _conda: https://docs.conda.io/
449
+ .. _pre-commit: https://pre-commit.com/
450
+ .. _docstrings: https://www.sphinx-doc.org/en/master/usage/extensions/napoleon.html
451
+ .. _ruff: https://docs.astral.sh/ruff
452
+ .. _descriptive commit message: https://cbea.ms/git-commit/
453
+ .. _creating a PR: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request
454
+ .. _Pytest can drop you: https://docs.pytest.org/en/stable/how-to/failures.html#using-python-library-pdb-with-pytest
455
+ .. _PyPI: https://pypi.org/
456
+ .. _GitHub Actions: https://docs.github.com/en/actions
457
+ .. _Coveralls: https://coveralls.io/github/jfishe/pyscaffoldext-pre-commit-ruff
458
+ .. _TestPyPI: https://test.pypi.org/
459
+ .. _trusted publishing: https://docs.pypi.org/trusted-publishers/
460
+ .. _GitHub Release: https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases
461
+ .. _Sigstore: https://www.sigstore.dev/
462
+ .. _Cirrus CI: https://cirrus-ci.org/
463
+ .. _Dependabot: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates