Commit ba667658 authored by Mark Hymers's avatar Mark Hymers

Merge branch '2-release-preparation' into 'master'

Resolve "Release preparation"

Closes #2

See merge request !2
parents 79b26d79 a70bc7ff
Pipeline #749 passed with stage
in 3 minutes and 35 seconds
......@@ -6,10 +6,16 @@ build_test:
script:
- apt update
- apt upgrade -y
- apt install -y python-numpy python3-numpy python-h5py python3-h5py python-sphinx python3-sphinx python-sphinx-rtd-theme python3-sphinx-rtd-theme ipython ipython3 flake8 python-setuptools python3-setuptools python-nose python3-nose
- apt install -y python-numpy python3-numpy python-h5py python3-h5py python-sphinx python3-sphinx python-sphinx-rtd-theme python3-sphinx-rtd-theme ipython ipython3 flake8 python-setuptools python3-setuptools python-nose python3-nose python-wheel python3-wheel
- flake8
- python setup.py build
- make testv2
- python3 setup.py build
- make testv
- make testv3
- make doc-html
- python3 setup.py sdist bdist_wheel
- python setup.py bdist_wheel
artifacts:
paths:
- dist/
expire_in: 1 week
include utils/*
include doc/*
include Makefile
include LICENSE.txt
include RELEASE.md
......@@ -27,10 +27,10 @@ clean:
rm -fr build
rm -fr doc/build
test: all
test3: all
cd build && PYTHONPATH=lib$(PYTHONARCH3)/:$${PYTHONPATH} nosetests3 -c ../nose.cfg lib$(PYTHONARCH3)/anamnesis
testv: all
testv3: all
cd build && PYTHONPATH=lib$(PYTHONARCH3)/:$${PYTHONPATH} nosetests3 --with-coverage --cover-package=anamnesis -c ../nose.cfg -s -v lib$(PYTHONARCH3)/anamnesis
test2: all2
......@@ -44,4 +44,4 @@ install:
mkdir -p $(DESTDIR)/usr/share/doc/anam
cp -a doc/build/html $(DESTDIR)/usr/share/doc/anam
.PHONY: clean doc doc-html all all2 test testv test2 testv4 pythonarch
.PHONY: clean doc doc-html all all2 test3 testv3 test2 testv2 pythonarch
How to release anamnesis
========================
Before
------
* Check that all MRs which are intended to be in this release have been merged into master
* Check that master builds cleanly in CI
* Set the version and release numbers appropriately in `setup.py` in master
* Check that the documentation builds
```
make doc-html
```
* Run the test suite for python2 and python3 and check there are no failures
```
make testv2
make testv3
```
* Ensure that you have an up-to-date python3-twine available. You may have to create a
virtualenv and install it that way. If you need to test it, test against `https://test.pypi.org`
rather than the real `https://pypi.org` (see the Packaging Python Documents tutorial at
https://packaging.python.org/tutorials/packaging-projects/)
* Ensure that you have a gitlab API token set up for `vcs.ynic.york.ac.uk`
Release
-------
* Tag the release in gitlab:
```
git tag x.y.z
git push --tags
```
* Wait for CI to complete and download the artifacts for PyPi
* Check the artefacts - untar the source tarball and run the tests again
* Upload the artefacts to twine (from the `dist/` directory containing the unzipped artefacts.
An example output is below:
```
python3 -m twine upload *
Enter your username: xxx
Enter your password: yyy
Uploading distributions to https://upload.pypi.org/legacy/
Uploading anamnesis-1.0.0-py2-none-any.whl ...
```
* Store the release in gitlab (including links to pypi) [TODO: Write a script for this]
You will need to update the variables in the curl snippet below:
```
curl --header 'Content-Type: application/json' \
--header "PRIVATE-TOKEN: GITLAB_ACCESS_TOKEN_HERE" \
--data '{ "name": "x.y.z", "tag_name": "x.y.z", "description": "Release description here", "assets": { "links": [{ "name": "anamnesis-x.y.z.tar.gz", "url": "https://files.pythonhosted.org/.../anamnesis-x.y.z.tar.gz" }, { "name": "anamnesis-x.y.z-py2-non-any.whl", "url": "https://files.pythonhosted.org/.../anamnesis-x.y.z-py2-none-any.whl"}, { "name": "anamnesis-x.y.z-py3-none-any.whl", "url": "https://files.pythonhosted.org/.../anamnesis-x.y.z-py3-none-any.whl"}] } }' \
--request POST "https://vcs.ynic.york.ac.uk/api/v4/projects/230/releases"
```
After Uploading
---------------
* Test that you can pip install the toolbox in a clean virtualenv:
```
mkdir /tmp/anamnesis-test
cd /tmp/anamnesis/test
virtualenv -p /usr/bin/python3 .
. bin/activate
pip3 install anamnesis
```
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment