Skip to content

Commit b630152

Browse files
committed
chore: migrate to pyproject.toml and add PEP 751 lockfile
Replace setup.py with a pyproject.toml (setuptools backend) and add a uv-generated pylock.toml so installs are reproducible. Update docs to include contribution and release details.
1 parent c6bc202 commit b630152

7 files changed

Lines changed: 476 additions & 156 deletions

File tree

docs/contributing.rst

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,28 @@ Clone you github fork repo locally and install errbot in development mode from t
2727
From there, anytime you execute `errbot` it will run from the checked out version of Errbot with all your local
2828
changes taken into account.
2929

30+
Updating the dependency lockfile
31+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
32+
33+
Errbot ships a pinned dependency lockfile (``pylock.toml``) in `PEP 751`_ format,
34+
generated by uv_ from the top-level dependencies declared in ``pyproject.toml``.
35+
The lockfile is the source of truth for reproducible installs in CI and for
36+
downstream consumers that want exact versions.
37+
38+
Regenerate the lockfile any time you change a dependency in ``pyproject.toml`` (or
39+
to refresh the pinned versions). From the root of the repository::
40+
41+
# Install uv if you don't have it (https://docs.astral.sh/uv/)
42+
pip install uv
43+
44+
# Recompile the lockfile from pyproject.toml, pinned to the project's
45+
# minimum supported Python version so the resolution covers 3.9+.
46+
uv pip compile pyproject.toml -o pylock.toml \
47+
--format pylock.toml --python-version 3.9
48+
49+
Commit the resulting ``pylock.toml`` alongside your ``pyproject.toml`` change in
50+
the same pull request so the two stay in sync.
51+
3052
Preparing your pull request
3153
^^^^^^^^^^^^^^^^^^^^^^^^^^^
3254

@@ -42,6 +64,56 @@ these guidelines as you open a pull request.
4264
* If you can, please add tests for your code. We know large parts of our codebase
4365
are missing tests, so we won't reject your code if it lacks tests, though.
4466

67+
Releasing Errbot
68+
----------------
69+
70+
This section is for maintainers cutting a release. The flow assumes a CHANGES.rst
71+
maintained by hand under a ``v9.9.9 (unreleased)`` heading on master.
72+
73+
Cutting a release
74+
~~~~~~~~~~~~~~~~~
75+
76+
1. **Open a release PR** that does two edits:
77+
78+
- Bump ``errbot/version.py``::
79+
80+
VERSION = "X.Y.Z"
81+
82+
- Rename the unreleased heading in ``CHANGES.rst`` from ``v9.9.9 (unreleased)``
83+
to ``vX.Y.Z (YYYY-MM-DD)`` and double-check the entries beneath it.
84+
85+
2. **Let CI gate the change.** The test ``tests/release_metadata_test.py`` skips on the
86+
``9.9.9`` sentinel but, once ``version.py`` is bumped, asserts that ``CHANGES.rst``
87+
contains a section heading for the new version. A release PR that forgets the heading
88+
rename will fail this test before it can merge.
89+
90+
3. **Merge the release PR**, then run the release tooling from a clean checkout::
91+
92+
./tools/releases.sh
93+
94+
The script reruns the same pre-release gate, builds the sdist/wheel with
95+
``python -m build``, and calls ``twine`` to publish to PyPI.
96+
97+
4. **Tag the commit** and push the tag::
98+
99+
git tag vX.Y.Z
100+
git push origin vX.Y.Z
101+
102+
5. **Return master to dev mode** in a follow-up PR:
103+
104+
- Reset ``errbot/version.py`` to ``VERSION = "9.9.9"``.
105+
- Add a fresh ``v9.9.9 (unreleased)`` heading at the top of ``CHANGES.rst``.
106+
107+
After this, the gate test goes back to skipping on master and the next release
108+
cycle starts.
109+
110+
Refreshing the lockfile for a release
111+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
112+
113+
If dependency pins have changed since the previous release, regenerate
114+
``pylock.toml`` (see `Updating the dependency lockfile`_) and include the result
115+
in the release PR.
116+
45117
Contributing documentation & making changes to the website
46118
----------------------------------------------------------
47119

@@ -94,3 +166,5 @@ to ask your question on Stack Overflow, `tagged errbot
94166
.. _repos.py: https://github.com/errbotio/errbot/blob/master/errbot/repos.py
95167
.. _`issue tracker`: https://github.com/errbotio/errbot/issues/
96168
.. _Gitter: https://gitter.im/errbotio/errbot
169+
.. _uv: https://docs.astral.sh/uv/
170+
.. _`PEP 751`: https://peps.python.org/pep-0751/

0 commit comments

Comments
 (0)