Skip to content

Commit

Permalink
Merge pull request #394 from biosustain/pypi_tidyup
Browse files Browse the repository at this point in the history
Feat: Workflow for releasing new versions of maud and setup.cfg fix
  • Loading branch information
teddygroves authored Jun 30, 2022
2 parents 1709b26 + c50d16d commit bdb5e12
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 13 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release Maud

on:
push:
# Sequence of patterns matched against refs/tags
tags:
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10

jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build package
run: python setup.py sdist bdist_wheel
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Create GitHub release
uses: actions/create-release@v1
env:
# This token is set by gh actions
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: ${{ github.ref }}
draft: false
prerelease: false
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ First create a fresh Python 3.7 virtual environment and then activate it:
python3.7 -m virtualenv maud_venv # choose any name you like!
source maud_venv/bin/activate
To install the latest Maud and its python dependencies to your new virtual
environment from the latest master branch, run this command:
To install Maud and its python dependencies to your new virtual environment, run
this command:

.. code-block:: console
pip install https://github.com/biosustain/Maud/archive/master.zip
pip install maud-metabolic-models
Cmdstanpy depends on `cmdstan <https://github.com/stan-dev/cmdstan>`_,
which in turn requires a c++ toolchain. Fortunately, cmdstanpy comes with
Expand Down
7 changes: 4 additions & 3 deletions docs/usage/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,19 @@ Releasing versions
==================

To release a new version of Maud, edit the field :code:`version` in the file
:code:`setup.cfg`, then make a pull request with this change.
:code:`setup.cfg`, then make a pull request with this change. The version name
should start with a letter v, e.g. :code:`v0.2.1`,

Once the changes are merged into the :code:`origin/master` branch, add a tag
with the new version number to your local :code:`master` branch, for example
like this:

.. code:: bash
git tag 0.2.1
git tag v0.2.1
Now push the new tag to github:

.. code:: bash
git push origin "0.2.1"
git push origin "v0.2.1"
4 changes: 2 additions & 2 deletions docs/usage/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ then activate it, run the following commands:
source maud_venv/bin/activate
To install the latest Maud and its python dependencies to your new virtual
environment from the latest master branch, run this command:
environment, run this command:

.. code-block:: console
pip install https://github.com/biosustain/Maud/archive/master.zip
pip install maud-metabolic-models
Cmdstanpy depends on `cmdstan <https://github.com/stan-dev/cmdstan>`, which
in turn requires a c++ toolchain. Fortunately, cmdstanpy comes with commands
Expand Down
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
[metadata]
name = maud
name = maud-metabolic-models
url = https://github.com/biosustain/Maud
download_url = https://pypi.org/project/maud/
download_url = https://pypi.org/project/maud-metabolic-models/
author = Novo Nordisk Foundation Center for Biosustainability, Technical University of Denmark
author_email = [email protected]
version = 0.3.2
# Please consult https://pypi.org/classifiers/ for a full list.
version = 0.3.1
classifiers =
Development Status :: 2 - Pre-Alpha
Intended Audience :: Science/Research
License :: OSI Approved :: GNU General Public License version 3
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Natural Language :: English
Operating System :: MacOS :: MacOS X
Operating System :: Microsoft :: Windows :: Windows 10
Expand All @@ -36,7 +36,7 @@ install_requires =
matplotlib
jinja2
toml
cmdstanpy@git+https://github.com/stan-dev/cmdstanpy.git@develop
cmdstanpy == 1.0.3
click
depinfo == 1.7.0
tqdm
Expand Down

0 comments on commit bdb5e12

Please sign in to comment.