Skip to content

Commit 9cc1503

Browse files
authored
Update documentation & READMEs (#17)
* Update documentation & READMEs * Include the description from the devel/ directory * Using aliases from the devel/activate-aliases.sh (like upytest and uipython) * Add new sections: * Updating Changelog * Creating a New Release * Update glossary * Rename some RST files * Add new alias uipython For the interactive IPython shell using start-up scripts from the .ipython directory * Add a new alias "makedocs" * The "makedocs" alias calls "uv run --frozen make -C docs html" to update the documentation * Each alias contains now a comment about the purpose
1 parent 588dc38 commit 9cc1503

17 files changed

Lines changed: 187 additions & 115 deletions

changelog.d/README.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,21 @@ a changelog, in our case the :file:`CHANGELOG.rst`, is read by our *users*.
1010
Therefor, any description should be aimed to users instead of describing
1111
internal changes which are only relevant to developers.
1212

13-
To avoid merge conflicts, we use the `Towncrier`_ package to manage our changelog.
14-
1513
The directory :file:`changelog.d` contains "newsfragments" which are short
16-
ReST-formatted files.
14+
ReST-formatted files. Each newsfragment describes a change in the project. A change is usually from a pull request or issue.
1715
On release, those news fragments are compiled into our :file:`CHANGELOG.rst`.
1816

19-
You don't need to install ``towncrier`` yourself, use the :command:`tox` command
20-
to call the tool.
21-
2217
We recommend to follow the steps to make a smooth integration of your changes:
2318

2419
#. After you have created a new pull request (PR), add a new file into the
2520
directory :file:`changelog.d`. Each filename follows the syntax::
2621

2722
<ISSUE>.<TYPE>.rst
2823

29-
where ``<ISSUE>`` is the GitHub issue number.
30-
In case you have no issue but a pull request, prefix your number with ``pr``.
31-
``<TYPE>`` is one of:
24+
where ``<ISSUE>`` is the GitHub pull request or issue number.
25+
If you have changes that are not associated with an issue or pull request,
26+
start with a ``+`` (plus) sign and a short description
27+
The ``<TYPE>`` is one of:
3228

3329
* ``breaking``: describes a change that breaks backward compatibility.
3430
* ``bugfix``: fixes a reported bug.
@@ -39,13 +35,15 @@ We recommend to follow the steps to make a smooth integration of your changes:
3935
* ``removal``: removes obsolete or deprecated features.
4036
* ``infra``: improves the infrastructure, e.g. build or test system.
4137

42-
For example: ``123.feature.rst``, ``pr233.removal.rst``, ``456.bugfix.rst`` etc.
43-
If you have changes that are not associated with an issue or pull request,
44-
start with a "+" sign and a short description, for example, ``+add-json.feature.rst``.
45-
46-
Create the new file with the command::
38+
For example, these are valid filenames: ``123.feature.rst``, ``456.bugfix.rst``, ``+add-json.feature.rst`` etc.
39+
40+
Create the new file with the command:
41+
42+
.. code-block:: shell
43+
:caption: Create a new newsfragment file
44+
:name: towncrier-create
4745
48-
uv run towncrier create -c "Description" 123.feature.rst
46+
towncrier create -c "Description" 123.feature.rst
4947
5048
The file is created int the :file:`changelog.d/` directory.
5149

@@ -57,11 +55,11 @@ We recommend to follow the steps to make a smooth integration of your changes:
5755

5856
#. Check your changes with::
5957

60-
uv run towncrier check
58+
towncrier check
6159

6260
#. Optionally, build a draft version of the changelog file with the command::
6361

64-
uv run towncrier build --draft
62+
towncrier build --draft
6563

6664
#. Commit all your changes and push it.
6765

@@ -70,7 +68,7 @@ This finishes your steps.
7068

7169
On release, the maintainer compiles a new :file:`CHANGELOG.rst` file by running::
7270

73-
uv run towncrier build
71+
towncrier build
7472

7573
This will remove all newsfragments inside the :file:`changelog.d` directory,
7674
making it ready for the next release.

changelog.d/_template.rst

Lines changed: 0 additions & 42 deletions
This file was deleted.

devel/README.md

Lines changed: 0 additions & 18 deletions
This file was deleted.

devel/README.rst

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
Development helper tools
2+
========================
3+
4+
The directory :code:`devel/` contains some helper tools to make development easier:
5+
6+
* :command:`activate-aliases.sh`
7+
Activates helpful aliases for the development environment. It provides
8+
shortcuts for common commands:
9+
10+
* :command:`docbuild`
11+
The project's main command.
12+
* :command:`makedocs`
13+
Builds the project's documentation.
14+
* :command:`towncrier`
15+
Manages changelog and news entries.
16+
* :command:`upytest`
17+
Runs the project's test suite through pytest.
18+
* :command:`uipython`
19+
Starts an interactive IPython shell using start-up scripts
20+
in the :file:`.ipython/` directory.
21+
22+
It is recommended to enable the aliases in your shell by sourcing the shell script in the root directory of the project:
23+
24+
.. code-block:: shell-session
25+
:caption: Activating development aliases
26+
27+
$ source devel/activate-aliases.sh
28+
29+
Run the aliases in the root directory of the project to ensure they work correctly.
30+
31+
* :command:`bump-version.sh`
32+
Bumps the version of the project. To bump the minor version, use
33+
:code:`bump-version.sh minor`.
34+
35+
* :command:`lines-of-code.sh`
36+
Prints a summary of code lines, comments, and blank lines in the project
37+
for each file type.
38+

devel/activate-aliases.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
#!/bin/bash
2+
# If you change this file, update the README.rst file accordingly.
23

34
# For testing:
45
alias upytest="uv run --frozen pytest"
56

7+
# For the interactive Python shell with the project's environment:
8+
alias uipython="uv run --frozen ipython --ipython-dir=.ipython"
9+
610
# For executing the project's script:
711
alias docbuild="uv run --frozen docbuild"
812

docs/source/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
.. |gh_repo| replace:: {gh_repo_url}
2727
.. |gh_repo_url| replace:: `{gh_repo_slug} <{gh_repo_url}>`__
2828
.. |uv| replace:: :command:`uv`
29+
.. |gh_release| replace:: `Releases <{gh_repo_url}/releases/>`__
2930
"""
3031

3132
# -- General configuration
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
Creating a New Release
2+
======================
3+
4+
To create a new release, follow these steps:
5+
6+
#. Ensure that you have the latest changes from the main branch of the repository.
7+
#. Create a new branch for your release. The branch name should follow the format: ``release/<VERSION>``, where ``<VERSION>`` is the version number you are releasing (e.g., ``release/1.0.0``).
8+
#. Run the alias :command:`bump-version.sh` to update the version number in the project files. For example:
9+
10+
.. code-block:: shell
11+
:caption: Bump the version number
12+
13+
bump-version.sh minor
14+
15+
This will update the version number to the next minor version (e.g., from `1.0.0` to `1.1.0`).
16+
#. Update the changelog (see :ref:`update-changelog` for details).
17+
#. Commit your changes with a message that describes the release.
18+
#. Wait for the CI to pass. If it fails, fix the issues and commit again.
19+
#. If the CI passes, (squash-)merge your release branch into the main branch.
20+
#. Tag the commit in the ``main`` branch with the version number. The release process is triggered by this tag in the format ``MAJOR.MINOR.PATCH``.
21+
22+
For example, if you are releasing version 1.1.0, you would tag the commit as follows:
23+
24+
.. code-block:: shell
25+
:caption: Tag the release commit
26+
27+
$ git tag 1.1.0
28+
$ git push origin 1.1.0
29+
30+
#. Find the release in the GitHub repository under the |gh_release| section.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.. _devel-helpers:
2+
3+
Development helper tools
4+
------------------------
5+
6+
.. include:: ../../../devel/README.rst
7+
:start-line: 3
8+
9+
In this documentation, we will use the aliases from now on.

docs/source/developer/index.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Developer Guide
77

88
concepts
99
design
10-
set-environment
10+
prepare-environment
1111
list-dependencies
1212
update-package
1313
run-testsuite
1414
run-ipython
15+
update-changelog
16+
create-release
1517
howto

docs/source/developer/list-dependencies.rst

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,24 @@ If you want to get an overview of the dependencies used in the project, you can
55

66
.. code-block:: shell-session
77
8-
$ uv tree
9-
Resolved 53 packages in 15ms
8+
$ uv tree --frozen
9+
Resolved 78 packages in 290ms
1010
docbuild
1111
├── click v8.2.1
1212
├── jinja2 v3.1.6
1313
│ └── markupsafe v3.0.2
14-
├── lxml v5.4.0
15-
├── pydantic v2.11.5
14+
├── lxml v6.0.0
15+
├── pydantic v2.11.7
1616
│ ├── annotated-types v0.7.0
1717
│ ├── pydantic-core v2.33.2
18-
│ │ └── typing-extensions v4.14.0
19-
│ ├── typing-extensions v4.14.0
18+
│ │ └── typing-extensions v4.14.1
19+
│ ├── typing-extensions v4.14.1
2020
│ └── typing-inspection v0.4.1
21-
│ └── typing-extensions v4.14.0
21+
│ └── typing-extensions v4.14.1
2222
├── rich v14.0.0
2323
│ ├── markdown-it-py v3.0.0
2424
│ │ └── mdurl v0.1.2
25-
│ └── pygments v2.19.1
25+
│ └── pygments v2.19.2
2626
└── tomlkit v0.13.3
2727
2828
This gives a tree-like structure of the dependencies, showing the main packages and their sub-dependencies. The output includes the package names and their versions, allowing you to see which libraries are being used in the project.
@@ -32,23 +32,23 @@ In case you want to list outdated dependencies, use the option ``--outdated``:
3232
.. code-block:: shell-session
3333
3434
$ uv tree --outdated
35-
Resolved 53 packages in 15ms
35+
Resolved 78 packages in 15ms
3636
docbuild
3737
├── click v8.2.1
3838
├── jinja2 v3.1.6
3939
│ └── markupsafe v3.0.2
40-
├── lxml v5.4.0
41-
├── pydantic v2.11.5
40+
├── lxml v6.0.0
41+
├── pydantic v2.11.7
4242
│ ├── annotated-types v0.7.0
43-
│ ├── pydantic-core v2.33.2 (latest: v2.34.1)
44-
│ │ └── typing-extensions v4.14.0
45-
│ ├── typing-extensions v4.14.0
43+
│ ├── pydantic-core v2.33.2 (latest: v2.35.2)
44+
│ │ └── typing-extensions v4.14.1
45+
│ ├── typing-extensions v4.14.1
4646
│ └── typing-inspection v0.4.1
47-
│ └── typing-extensions v4.14.0
47+
│ └── typing-extensions v4.14.1
4848
├── rich v14.0.0
4949
│ ├── markdown-it-py v3.0.0
5050
│ │ └── mdurl v0.1.2
51-
│ └── pygments v2.19.1
51+
│ └── pygments v2.19.2
5252
└── tomlkit v0.13.3
5353
54-
As you can see, the output indicates that the package ``pydantic-core`` has a newer version available (v2.34.1), while the others are up to date.
54+
As you can see, the output indicates that the package ``pydantic-core`` has a newer version available (v2.35.2), while the others are up to date.

0 commit comments

Comments
 (0)