|
| 1 | +# How to prepare a release |
| 2 | + |
| 3 | +## Prepare the pypi config file `~/.pypirc`: |
| 4 | + |
| 5 | +``` |
| 6 | +[distutils] |
| 7 | +index-servers = |
| 8 | + pypi |
| 9 | + pypitest |
| 10 | +
|
| 11 | +[pypi] |
| 12 | +repository=https://pypi.python.org/pypi |
| 13 | +username=<user> |
| 14 | +password=<password> |
| 15 | +
|
| 16 | +[pypitest] |
| 17 | +repository=https://test.pypi.org/legacy/ |
| 18 | +username=<user> |
| 19 | +password=<password> |
| 20 | +``` |
| 21 | +**Note:** the user name and password are open text, so it is wise to change permissions: |
| 22 | + |
| 23 | +``` |
| 24 | +chmod 600 ~/.pypirc |
| 25 | +``` |
| 26 | + |
| 27 | +## Release Steps |
| 28 | + |
| 29 | +1. Update ChangeLog |
| 30 | +2. Make sure git clone is clean |
| 31 | +3. Edit `codimension/cdmverspec.py` setting the new version |
| 32 | +4. Make sure pandoc is installed as well as pypandoc |
| 33 | +5. Run |
| 34 | +```shell |
| 35 | +python setup.py sdist |
| 36 | +``` |
| 37 | +6. Make sure that `tar.gz` in the `dist` directory has all the required files |
| 38 | +7. Upload to pypitest |
| 39 | +```shell |
| 40 | +python setup.py sdist upload -r pypitest |
| 41 | +``` |
| 42 | +8. Make sure it looks all right at [pypitest](https://testpypi.python.org/pypi) |
| 43 | +9. Install it from pypitest |
| 44 | +```shell |
| 45 | +pip install --index-url https://test.pypi.org/simple/ codimension |
| 46 | +``` |
| 47 | +10. Check the installed version |
| 48 | +```shell |
| 49 | +codimension & |
| 50 | +``` |
| 51 | +11. Uninstall the pypitest version |
| 52 | +```shell |
| 53 | +pip uninstall codimension |
| 54 | +``` |
| 55 | +12. Upload to pypy |
| 56 | +```shell |
| 57 | +python setup.py sdist upload |
| 58 | +``` |
| 59 | +13. Make sure it looks all right at [pypi](https://pypi.python.org/pypi) |
| 60 | +14. Install it from pypi |
| 61 | +```shell |
| 62 | +pip install codimension |
| 63 | +``` |
| 64 | +15. Check the installed version |
| 65 | +```shell |
| 66 | +codimension & |
| 67 | +``` |
| 68 | +16. Create an annotated tag |
| 69 | +```shell |
| 70 | +git tag -a 4.0.0 -m "Release 4.0.0" |
| 71 | +git push --tags |
| 72 | +``` |
| 73 | +17. Publish the release on github at [releases](https://github.com/SergeySatskiy/codimension/releases) |
| 74 | + |
| 75 | + |
| 76 | +## Development |
| 77 | + |
| 78 | +```shell |
| 79 | +# Install a develop version (create links) |
| 80 | +python setup.py develop |
| 81 | + |
| 82 | +# Uninstall the develop version |
| 83 | +python setup.py develop --uninstall |
| 84 | +``` |
| 85 | + |
| 86 | +## Links |
| 87 | + |
| 88 | +[Peter Downs instructions](http://peterdowns.com/posts/first-time-with-pypi.html) |
| 89 | + |
| 90 | +[Ewen Cheslack-Postava instructions](https://ewencp.org/blog/a-brief-introduction-to-packaging-python/) |
| 91 | + |
0 commit comments