Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MAINT] Add workflow to autodeploy to PyPi #568

Merged
merged 4 commits into from
Aug 21, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,28 @@ jobs:
- codecov/upload:
file: /tmp/src/coverage/coverage.xml

deploy:
docker:
- image: continuumio/miniconda3
steps:
- checkout
- run:
name: init .pypirc
command: |
echo -e "[pypi]" >> ~/.pypirc
echo -e "username = $PYPI_USER" >> ~/.pypirc
echo -e "password = $PYPI_PASSWORD" >> ~/.pypirc
- run:
name: create package
command: |
python setup.py sdist
python setup.py bdist_wheel
- run:
name: upload to pypi
command: |
pip install twine
twine upload dist/*

workflows:
version: 2.1
build_test:
Expand Down Expand Up @@ -283,3 +305,11 @@ workflows:
- four-echo
- five-echo
- t2smap
- deploy:
requires:
- merge_coverage
filters:
tags:
only: /[0-9]+(\.[0-9a-zA-Z]+)*/
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only thing I'm not 100% sure about is the chosen regex for our tags. In NiMARE and PyMARE, we're using the simpler /[0-9]+(\.[0-9]+)*/, but I didn't think that would catch the alpha and rc releases we sometimes make.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we'd have to decide on a naming convention for us to make a foolproof regex, so maybe we can talk about it on the call?
I tested this and it seemed pretty reasonable for anything I could think of.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@emdupre can correct me, but I believe our current working standard is to add a[0-9] (for alpha releases) or rc[0-9] (for release candidates) on those occasions we don't have regular releases. That said, I agree that we can/should talk about it on the call.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, let's discuss today ! But in general I'd prefer alpha or rc, rather than both... But I'm guilty of having used both so far, so we should definitely standardize ! Another reason to automate :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've opened #570 for the vote.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With our decision about the rc convention, could we modify this regex?

branches:
ignore: /.*/
5 changes: 2 additions & 3 deletions docs/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -219,13 +219,12 @@ releasing your own Python projects!
#. Create a new release, using the GitHub `guide for creating a release on GitHub`_.
`Release-drafter`_ should have already drafted release notes listing all
changes since the last release; check to make sure these are correct.
#. Pulling from the ``master`` branch, locally build a new copy of tedana and
`upload it to PyPi`_.

We have set up tedana so that releases automatically mint a new DOI with Zenodo;
a guide for doing this integration is available `here`_.
We have also set up the repository so that tagged releases automatically deploy
to PyPi (for pip installation).

.. _`upload it to PyPi`: https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives
.. _`guide for creating a release on GitHub`: https://help.github.com/articles/creating-releases/
.. _`Release-drafter`: https://github.com/apps/release-drafter
.. _here: https://guides.github.com/activities/citable-code/