Skip to content

Commit

Permalink
Set a strict python minimum version for install, add automated pypi d…
Browse files Browse the repository at this point in the history
…eployment (alchemistry#194)

* Set a strict python minimum version for install (fix alchemistry#193)
* add deploy workflow for automatic uploads to testpypi (release tag) and pypi (GitHub release)
* clean up CI file
* update AUTHORS and CHANGELOG
* update release management notes https://github.com/alchemistry/alchemlyb/wiki/Developer-Guide#release-management
  • Loading branch information
IAlibay authored Jun 7, 2022
1 parent 0d701d1 commit 9153bbd
Show file tree
Hide file tree
Showing 6 changed files with 83 additions and 15 deletions.
21 changes: 10 additions & 11 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ on:
branches:
- "master"


concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}"
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true


defaults:
run:
shell: bash -l {0}


jobs:
test:
runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +32,7 @@ jobs:
python-version: ["3.7", "3.8", "3.9", "3.10"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3

# More info on options: https://github.com/conda-incubator/setup-miniconda
- uses: mamba-org/provision-with-micromamba@main
Expand All @@ -34,31 +41,23 @@ jobs:
environment-name: test
extra-specs: |
python=${{ matrix.python-version }}
pytest=${{ matrix.pytest }}
- name: Install alchemtest
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install https://github.com/alchemistry/alchemtest/archive/master.zip
- name: Install package (with no dependencies)
# conda setup requires this special shell
shell: bash -l {0}
run: |
python -m pip install . --no-deps
- name: Run tests
# conda setup requires this special shell
shell: bash -l {0}

run: |
pytest -v --cov=alchemlyb --cov-report=xml --color=yes src/alchemlyb/tests
env:
MPLBACKEND: agg

- name: Codecov
uses: codecov/codecov-action@v1.5.2
uses: codecov/codecov-action@v2
with:
name: codecov-${{ matrix.os }}-py${{ matrix.python-version }}
file: ./coverage.xml
Expand Down
64 changes: 64 additions & 0 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Build and upload to PyPI

on:
push:
branches:
- master
tags:
- "*"
release:
types:
- published


concurrency:
group: "${{ github.ref }}-${{ github.head_ref }}-${{ github.workflow }}"
cancel-in-progress: true


defaults:
run:
shell: bash -l {0}


jobs:
build_wheels:
environment: deploy
if: "github.repository == 'alchemistry/alchemlyb'"
name: Build pure Python wheel and tarball
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: setup_miniconda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: 3.8
auto-update-conda: true
add-pip-as-python-dependency: true
architecture: x64

- name: install_deps
run: |
python -m pip install build
- name: build
run: |
python -m build --sdist --wheel --outdir dist/
- name: publish_testpypi
# Upload to testpypi on every tag
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/

- name: publish_pypi
if: github.event_name == 'release' && github.event.action == 'published'
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
3 changes: 3 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ Chronological list of authors
- Alexander Schlaich (@schlaicha)
- Jérôme Hénin (@jhenin)
- Thomas T. Joseph (@ttjoseph)

2022
- Irfan Alibay (@IAlibay)
4 changes: 4 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ The rules for this file:
* 0.7.0

Changes
- Deployment to PyPI is now done automatically using github actions
(Issue #193)
- gmx parser now defaults to dropping NaN and corrupted lines (filter=True)
(#171, PR #183)

Expand All @@ -28,6 +30,8 @@ Enhancements
incomplete/corrupted lines (#126, #171) with filter=True.

Fixes
- Fixes setup.py and setup.cfg to prevent installations with Python versions
lower than 3.7 (Issue #193)
- added AutoMBAR to convergence analysis (#189)


Expand Down
5 changes: 1 addition & 4 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
[bdist_wheel]
universal=1

[versioneer]
VCS = git
style = pep440
versionfile_source = src/alchemlyb/_version.py
versionfile_build = alchemlyb/_version.py
tag_prefix =
parentdir_prefix = alchemlyb-
parentdir_prefix = alchemlyb-
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
license='BSD',
long_description=open('README.rst').read(),
long_description_content_type='text/x-rst',
python_requires='>=3.7',
tests_require = ['pytest', 'alchemtest'],
install_requires=['numpy', 'pandas>=1.2,!=1.3.0', 'pymbar>=3.0.5,<4',
'scipy', 'scikit-learn', 'matplotlib']
Expand Down

0 comments on commit 9153bbd

Please sign in to comment.