|
| 1 | +Introduction |
| 2 | +============ |
| 3 | + |
| 4 | +This documentation provides a guide for mdgo administrators. The following |
| 5 | +assumes you are using miniconda or Anaconda. |
| 6 | + |
| 7 | +Releases |
| 8 | +======== |
| 9 | + |
| 10 | +The general procedure to releasing mdgo comprises the following steps: |
| 11 | + |
| 12 | +1. Wait for all unittests to pass on CircleCI. |
| 13 | +2. Update and edit change log. |
| 14 | +3. Release PyPI versions + doc. |
| 15 | +4. Release conda versions. |
| 16 | + |
| 17 | +Initial setup |
| 18 | +------------- |
| 19 | + |
| 20 | +Install some conda tools first:: |
| 21 | + |
| 22 | + conda install --yes conda-build anaconda-client |
| 23 | + conda config --add channels matsci |
| 24 | + |
| 25 | +Mdgo uses `invoke <http://www.pyinvoke.org/>`_ to automate releases. You will |
| 26 | +also need sphinx. Install these using:: |
| 27 | + |
| 28 | + pip install --upgrade invoke sphinx |
| 29 | + |
| 30 | +For 2018, we will release both py27 and py37 versions of mdgo. Create |
| 31 | +environments for py37 using conda:: |
| 32 | + |
| 33 | + conda create --yes -n py37 python=3.7 |
| 34 | + |
| 35 | +For each env, install required packages followed by dev install for |
| 36 | +mdgo:: |
| 37 | + |
| 38 | + conda activate py37 |
| 39 | + pip install -r requirements.txt |
| 40 | + pip install -r requirements-optional.txt |
| 41 | + python setup.py develop |
| 42 | + |
| 43 | +Add your PyPI username and password and GITHUB_RELEASE_TOKEN into your |
| 44 | +environment:: |
| 45 | + |
| 46 | + export TWINE_USERNAME=PYPIUSERNAME |
| 47 | + export TWINE_PASSWORD=PYPIPASSWORD |
| 48 | + export GITHUB_RELEASES_TOKEN=TOKEN_YOU_GET_FROM_GITHUB |
| 49 | + |
| 50 | +You may want to add these to your .bash_profile to avoid having to type these |
| 51 | +each time. |
| 52 | + |
| 53 | +Machine-specific issues |
| 54 | +~~~~~~~~~~~~~~~~~~~~~~~ |
| 55 | + |
| 56 | +The above instructions are general, but there are some known issues that are |
| 57 | +machine-specific: |
| 58 | + |
| 59 | +* It can be useful to `pip install --upgrade pip twine setuptools` (this may |
| 60 | + be necessary if there are authentication errors when connecting to PyPI). |
| 61 | + |
| 62 | +Doing the release |
| 63 | +----------------- |
| 64 | + |
| 65 | +Ensure appropriate environment variables are set including `DISCOURSE_API_USERNAME`, |
| 66 | +`DISCOURSE_API_KEY` and `GITHUB_RELEASES_TOKEN`. |
| 67 | + |
| 68 | +First update the change log. The autogenerated change log is simply a list of |
| 69 | +commit messages since the last version. Make sure to edit the log for brevity |
| 70 | +and to attribute significant features to appropriate developers:: |
| 71 | + |
| 72 | + conda activate py37 |
| 73 | + invoke update-changelog |
| 74 | + |
| 75 | +Then, do the release with the following sequence of commands (you can put them |
| 76 | +in a bash script in your PATH somewhere):: |
| 77 | + |
| 78 | + conda activate py37 |
| 79 | + invoke release --nodoc |
| 80 | + invoke update-doc |
| 81 | + conda deactivate |
| 82 | + python setup.py develop |
| 83 | + |
| 84 | +Double check that the releases are properly done on Pypi. If you are releasing |
| 85 | +on a Mac, you should see a mdgo.version.tar.gz and two wheels (Py37 and |
| 86 | +P). There will be a py37 wheel for Windows that is generated by Appveyor. |
| 87 | + |
| 88 | +Materials.sh |
| 89 | +------------ |
| 90 | + |
| 91 | +Fork and clone the `materials.sh <https://github.com/materialsvirtuallab/materials.sh>`_. |
| 92 | +This repo contains the conda skeletons to build the conda versions for various |
| 93 | +matsci codes on the Anaconda `matsci channel <https://anaconda.org/matsci>`_. |
| 94 | + |
| 95 | +The first time this is run, you may need to `pip install beautifulsoup4`. |
| 96 | + |
| 97 | +If you doing this for the first time, make sure conda-build and anaconda-client |
| 98 | +are installed:: |
| 99 | + |
| 100 | + conda install --yes conda-build anaconda-client |
| 101 | + |
| 102 | +Update the mdgo meta.yaml:: |
| 103 | + |
| 104 | + invoke update-pypi mdgo |
| 105 | + |
| 106 | +Build the mac versions manually:: |
| 107 | + |
| 108 | + invoke build-conda mdgo |
| 109 | + |
| 110 | +Commit and push to repo, which will build the Linux and Windows versions. |
| 111 | + |
| 112 | +Check that the `matsci channel <https://anaconda.org/matsci>`_ versions are |
| 113 | +properly updated. |
0 commit comments