| 1 |
.. include:: ../header.rst |
| 2 |
|
| 3 |
============================= |
| 4 |
Docutils_ Release Procedure |
| 5 |
============================= |
| 6 |
|
| 7 |
:Authors: David Goodger; Lea Wiemann; open to all Docutils developers |
| 8 |
:Contact: [email protected] |
| 9 |
:Date: $Date: 2025-06-10 22:41:26 +0200 (Di, 10. Jun 2025) $ |
| 10 |
:Revision: $Revision: 10164 $ |
| 11 |
:Copyright: This document has been placed in the public domain. |
| 12 |
|
| 13 |
.. _Docutils: https://docutils.sourceforge.io/ |
| 14 |
|
| 15 |
Steps to take and watch |
| 16 |
----------------------- |
| 17 |
|
| 18 |
Make a clean checkout of svn.code.sf.net/p/docutils/code/trunk/docutils |
| 19 |
to avoid having development files in the released packages. |
| 20 |
|
| 21 |
Test, package and release this checkout. |
| 22 |
|
| 23 |
* Announce the upcoming release on docutils-develop list. |
| 24 |
|
| 25 |
Consider **feature freeze** or/and **check-in freeze** . |
| 26 |
|
| 27 |
* set_version.sh does not change HISTORY.rst and RELEASE-NOTES.rst. |
| 28 |
|
| 29 |
Why ? Maybe because the underline of the section needs to be changed anyway |
| 30 |
and personally I like to look around. |
| 31 |
|
| 32 |
Maybe change this. |
| 33 |
|
| 34 |
* Change HISTORY.rst title ``Release <version> (unublished)``: |
| 35 |
|
| 36 |
Change the version insert date for unpublished. |
| 37 |
|
| 38 |
* Update RELEASE-NOTES.rst section ``Release <version> (unpublished)``. |
| 39 |
|
| 40 |
Change the version insert date for unpublished. |
| 41 |
|
| 42 |
Consult HISTORY.rst for important changes. |
| 43 |
|
| 44 |
* Set new version (replace ``<version>`` with the new version indentifier |
| 45 |
and ``<docutils-repository-root>`` with the dir containing |
| 46 |
``HISTORY.rst`` and ``RELEASE-NOTES.rst``):: |
| 47 |
|
| 48 |
cd <docutils-repository-root> |
| 49 |
../sandbox/infrastructure/set_version.sh <version> |
| 50 |
|
| 51 |
Check what was changed by ``set_version.sh``. |
| 52 |
|
| 53 |
Change acchordingly docutils/__init__.py :: |
| 54 |
|
| 55 |
__version_info__ = VersionInfo( |
| 56 |
major=0, |
| 57 |
minor=21, |
| 58 |
micro=0, |
| 59 |
releaselevel='candidate', # one of 'alpha', 'beta', 'candidate', 'final' |
| 60 |
serial=1, # pre-release number (0 for final releases and snapshots) |
| 61 |
release=False # True for official releases and pre-releases |
| 62 |
) |
| 63 |
|
| 64 |
|
| 65 |
Run tests :: |
| 66 |
|
| 67 |
export PYTHONWARNINGS=default |
| 68 |
python3 test/alltests.py |
| 69 |
|
| 70 |
or use tox. |
| 71 |
In case of errors, clearing ``docutils/__pycache__`` may help. |
| 72 |
|
| 73 |
``export PYTHONWARNINGS=default`` prints DeprecationWarnings in python3. |
| 74 |
|
| 75 |
* Generate wheel and source-distribution, e.g.:: |
| 76 |
|
| 77 |
python3 -m pip install build |
| 78 |
python3 -m build . |
| 79 |
|
| 80 |
check file sizes: the 0.21.2 wheel was 574K the sdist 2,2M. |
| 81 |
|
| 82 |
* Test the wheel in local environment |
| 83 |
|
| 84 |
From checkout:: |
| 85 |
|
| 86 |
cd .. |
| 87 |
python3 -m venv du3 |
| 88 |
cd du3 |
| 89 |
. bin/activate |
| 90 |
pip install <checkout-dir>/dist/... .whl |
| 91 |
# CAUTION copy test from modified not yet committed source tree. |
| 92 |
cp -Lr ../docutils-code/docutils/test . |
| 93 |
python test/alltests.py |
| 94 |
|
| 95 |
Uploads to pypi/test.pypi can not be overwritten, require a new version. |
| 96 |
|
| 97 |
* Commit changes ... the changed version number. |
| 98 |
|
| 99 |
* build again and test locally. |
| 100 |
|
| 101 |
* Upload wheel and source to test.pypi. |
| 102 |
|
| 103 |
Set repository and key in ~/.pypirc with a <server-name> and |
| 104 |
password token:: |
| 105 |
|
| 106 |
python3 -m twine upload --repository <server-name> dist/* |
| 107 |
|
| 108 |
Change directory outside of checkout and test in venv. |
| 109 |
NOTE use --pre for prereleases:: |
| 110 |
|
| 111 |
python3 -m venv du3 ; cd du3 |
| 112 |
export PYTHONPATH= ; . bin/activate |
| 113 |
|
| 114 |
pip install --index-url https://test.pypi.org/simple/ --no-deps docutils |
| 115 |
|
| 116 |
# CAUTION copy test from modified not yet committed source tree. |
| 117 |
cp -Lr ../docutils-code/docutils/test . |
| 118 |
python test/alltests.py |
| 119 |
|
| 120 |
Ignore missing HISTORY.rst it is not in the wheel file. |
| 121 |
if ok :: |
| 122 |
|
| 123 |
deactivate ; cd .. ; rm -r du3 |
| 124 |
|
| 125 |
Test the sdist:: |
| 126 |
|
| 127 |
python3 -m venv du3s ; cd du3s |
| 128 |
export PYTHONPATH= ; . bin/activate |
| 129 |
|
| 130 |
pip install --index-url https://test.pypi.org/simple/ --no-binary docutils docutils |
| 131 |
|
| 132 |
sdist installation fails with subprocess not finding flit_core . |
| 133 |
test.pypi has flit 3.5.1 but installs 0.5 preinstalling flit_core did not work |
| 134 |
either ... why. |
| 135 |
|
| 136 |
postbone sdist test to pypi:: |
| 137 |
|
| 138 |
cp -Lr ../docutils-code/docutils/test . |
| 139 |
python test/alltests.py |
| 140 |
|
| 141 |
Ignore ``test_find_file_in_dirs`` fails because HISTORY.rst is missing or/and |
| 142 |
missing pil.:: |
| 143 |
|
| 144 |
deactivate ; cd .. ; rm -r du3s |
| 145 |
|
| 146 |
* If final release |
| 147 |
|
| 148 |
- tag #.# (Note: only directory docutils is copied):: |
| 149 |
|
| 150 |
svn copy svn+ssh://[email protected]/p/docutils/code/trunk/docutils \ |
| 151 |
svn+ssh://[email protected]/p/docutils/code/tags/docutils-#.# \ |
| 152 |
-m "tagging release #.#" |
| 153 |
|
| 154 |
- Update your source directory. |
| 155 |
|
| 156 |
- Rebuild wheel and source-distribution, e.g:: |
| 157 |
|
| 158 |
python3 -m build |
| 159 |
|
| 160 |
* Upload to pypi:: |
| 161 |
|
| 162 |
python3 -m twine upload --repository <server-name> dist/docutils-#.#* |
| 163 |
|
| 164 |
* Remove previous package from local cache:: |
| 165 |
|
| 166 |
find .cache/pip/wheels -name docutils\*whl -exec rm -v -i {} \; |
| 167 |
|
| 168 |
* Test the sdist |
| 169 |
:: |
| 170 |
|
| 171 |
python3 -m venv du3s ; cd du3s |
| 172 |
export PYTHONPATH= ; . bin/activate |
| 173 |
|
| 174 |
pip install --no-binary docutils docutils |
| 175 |
|
| 176 |
cp -Lr ../docutils-code/docutils/test . |
| 177 |
python test/alltests.py |
| 178 |
|
| 179 |
Ignore ``test_find_file_in_dirs`` fails because HISTORY.rst is missing:: |
| 180 |
|
| 181 |
deactivate ; cd .. ; rm -r du3s |
| 182 |
|
| 183 |
* and wheel:: |
| 184 |
|
| 185 |
python3 -m venv du3 ; cd du3 |
| 186 |
export PYTHONPATH= ; . bin/activate |
| 187 |
|
| 188 |
pip install --no-deps docutils |
| 189 |
cp -Lr ../docutils-code/docutils/test . |
| 190 |
python test/alltests.py |
| 191 |
|
| 192 |
deactivate ; cd .. ; rm -r du3 |
| 193 |
|
| 194 |
* Notify to docutils-developer and user. |
| 195 |
|
| 196 |
For candidate releases change version to rc#+1dev. |
| 197 |
|
| 198 |
* set_version #.rc#+1.dev |
| 199 |
|
| 200 |
change docutils/__init__.py |
| 201 |
|
| 202 |
test |
| 203 |
|
| 204 |
* docutils/HISTORY.rst: add section "Release <version> (unpublished)" |
| 205 |
* docutils/RELEASE-Notes.rst: add section "Release <version> (unpublished)" |
| 206 |
|
| 207 |
* test again |
| 208 |
* commit |
| 209 |
* run sandbox/infrastructure/docutils-update.local |
| 210 |
|
| 211 |
For final releases |
| 212 |
|
| 213 |
* upload source and generated html to sf-htdocs/#.# :: |
| 214 |
|
| 215 |
mkdir tmp1 |
| 216 |
cd tmp1 |
| 217 |
tar xzvf ../dist/docutils-#.#.tar.gz |
| 218 |
cd docutils-#.#/ |
| 219 |
python3 tools/buildhtml.py . |
| 220 |
find . -name \*.pyc -exec rm -v {} \; |
| 221 |
find . -name __pycache__ -exec rmdir -v {} \; |
| 222 |
rsync -e ssh -r -t ./ web.sourceforge.net:/home/project-web/docutils/htdocs/#.# |
| 223 |
|
| 224 |
* Check web/index.rst for necessary corrections. |
| 225 |
* Run sandbox/infrastructure/docutils-update.local to update web-content. |
| 226 |
* Release to sourceforge. |
| 227 |
|
| 228 |
- Upload docutils-#.#.tar.gz and release notes to sourceforge. |
| 229 |
- Select docutils-#.#.tar.gz as default for all OS. |
| 230 |
|
| 231 |
* set_version #.{#+1}b.dev |
| 232 |
* docutils/HISTORY.rst: add title "Changes Since #.#" |
| 233 |
* run sandbox/infrastructure/docutils-update.local |
| 234 |
|
| 235 |
.. Emacs settings |
| 236 |
|
| 237 |
Local Variables: |
| 238 |
mode: indented-text |
| 239 |
mode: rst |
| 240 |
indent-tabs-mode: nil |
| 241 |
sentence-end-double-space: t |
| 242 |
fill-column: 70 |
| 243 |
End: |