2015-10-11 16:44:51 +00:00
|
|
|
HOW TO MANAGE A NEW RELEASE
|
2015-10-12 16:30:24 +00:00
|
|
|
===========================
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:57:08 +00:00
|
|
|
This file is intended for the project's maintainers and it describes
|
2015-10-11 16:44:51 +00:00
|
|
|
how to update, build and upload a new release.
|
|
|
|
|
2015-11-01 16:01:18 +00:00
|
|
|
Most of the management commands have been directly placed inside the
|
|
|
|
Makefile: `python setup.py make [alias]`, (or simply `make [alias]` in
|
|
|
|
UNIX-like environments).
|
2015-10-13 13:15:11 +00:00
|
|
|
|
2015-10-13 13:25:12 +00:00
|
|
|
Note: to use the Makefile on Windows, you need to install make.exe,
|
|
|
|
for example by installing [MinGW MSYS](http://www.mingw.org/wiki/msys).
|
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
|
2015-10-11 16:44:51 +00:00
|
|
|
SEMANTIC VERSIONING
|
2015-10-11 17:10:22 +00:00
|
|
|
-------------------
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
The tqdm repository managers should regularly bump the version number in the
|
2015-11-01 16:01:18 +00:00
|
|
|
[_version.py](https://raw.githubusercontent.com/tqdm/tqdm/master/tqdm/_version.py)
|
|
|
|
file to follow the [Semantic Versioning](http://semver.org/) convention.
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
Tools can be used to automate this process, such as
|
|
|
|
[bumpversion](https://github.com/peritus/bumpversion) or
|
|
|
|
[python-semanticversion](https://github.com/rbarrois/python-semanticversion/)
|
|
|
|
to automate this task.
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
The managers should take care of this instead of users to avoid PR conflicts
|
2015-11-01 16:01:18 +00:00
|
|
|
solely due to the version file bumping.
|
2015-10-11 16:44:51 +00:00
|
|
|
|
|
|
|
|
2015-10-11 19:18:22 +00:00
|
|
|
CHECKING SETUP.PY
|
2015-10-12 16:30:24 +00:00
|
|
|
-----------------
|
2015-10-11 19:18:22 +00:00
|
|
|
|
2015-11-01 16:01:18 +00:00
|
|
|
To check that the `setup.py` file is compliant with PyPi requirements (e.g.
|
|
|
|
version number; reStructuredText in README.rst) use the following command:
|
2015-10-11 19:18:22 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
python setup.py check --restructuredtext --strict
|
|
|
|
```
|
|
|
|
|
2015-11-01 16:01:18 +00:00
|
|
|
If you happen to mistakenly upload a broken release to PyPi,
|
2015-10-15 13:47:02 +00:00
|
|
|
you can fix the metadata by using: `python setup.py make pypimeta`
|
|
|
|
or `python setup.py register`.
|
2015-10-11 19:18:22 +00:00
|
|
|
|
|
|
|
|
2015-10-11 16:44:51 +00:00
|
|
|
BUILDING A RELEASE AND UPLOADING TO PYPI
|
2015-10-11 17:10:22 +00:00
|
|
|
----------------------------------------
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
First, check `setup.py` and `MANIFEST.in`, which define the packaging
|
|
|
|
process and info that will be uploaded to [pypi](pypi.python.org).
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
Check the result by using the following commands:
|
2015-10-11 16:44:51 +00:00
|
|
|
|
|
|
|
```
|
2015-10-15 13:47:02 +00:00
|
|
|
python setup.py make installdev
|
2015-10-11 17:10:22 +00:00
|
|
|
```
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
Secondly, build tqdm into a distributable python package:
|
2015-10-11 16:44:51 +00:00
|
|
|
|
|
|
|
```
|
2015-10-15 13:47:02 +00:00
|
|
|
python setup.py make build
|
2015-10-11 17:10:22 +00:00
|
|
|
```
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
This will generate several builds in the `dist/` folder.
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-11-01 16:01:18 +00:00
|
|
|
Finally, upload everything to pypi. This can be done easily using the
|
|
|
|
[twine](https://github.com/pypa/twine) module:
|
2015-10-11 16:44:51 +00:00
|
|
|
|
|
|
|
```
|
2015-10-15 13:47:02 +00:00
|
|
|
python setup.py make pypi
|
2015-10-11 16:44:51 +00:00
|
|
|
```
|
|
|
|
|
2015-10-11 17:10:22 +00:00
|
|
|
NOTE:
|
|
|
|
|
|
|
|
- you can also test on the pypi test servers `testpypi.python.org/pypi`
|
|
|
|
before the real deployment
|
|
|
|
- in case of a mistake, you can delete an uploaded release on pypi, but you
|
|
|
|
cannot re-upload another with the same version number!
|
2015-10-11 19:18:22 +00:00
|
|
|
- in case of a mistake in the metadata on pypi (like the long description README
|
|
|
|
getting garbled because of a silent error), you can use the following
|
2015-10-13 13:15:11 +00:00
|
|
|
command to update the metadata: `make pypimeta` or `python setup.py register`
|
2015-10-11 16:44:51 +00:00
|
|
|
|
2015-11-01 16:01:18 +00:00
|
|
|
Also, the new release can be added to github by creating a new release
|
2015-10-11 17:10:22 +00:00
|
|
|
from the web interface.
|