-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modernise python package management (#166)
- Use `flit` instead of `setuptools`. - Replace `setup.json` & `setup.py` with `pyproject.toml`. - Update publish workflow. - Remove `MANIFEST.in`. - Remove an obsolete test for the version agreement.
- Loading branch information
1 parent
aaf3fe9
commit 23881a7
Showing
9 changed files
with
94 additions
and
210 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,104 +1,34 @@ | ||
--- | ||
name: Publish on Test PyPI and PyPI | ||
name: Publish on PyPI | ||
|
||
on: | ||
push: | ||
branches: | ||
# Commits pushed to release/ branches are published on Test PyPI if they | ||
# have a new version number. | ||
- release/** | ||
tags: | ||
# Tags that start with the "v" prefix are published on PyPI. | ||
- v* | ||
push: | ||
tags: | ||
# After vMajor.Minor.Patch _anything_ is allowed (without "/") ! | ||
- v[0-9]+.[0-9]+.[0-9]+* | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
|
||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install pypa/build | ||
run: python -m pip install build | ||
|
||
- name: Build a binary wheel and a source tarball | ||
run: >- | ||
python -m | ||
build | ||
--sdist | ||
--wheel | ||
--outdir dist/ | ||
- name: Upload distribution artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: release | ||
path: dist/ | ||
|
||
|
||
publish-test: | ||
|
||
name: Build and publish on TestPyPI | ||
if: startsWith(github.ref, 'refs/heads/release/') | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: Test PyPI | ||
url: https://test.pypi.org/project/aiida-cp2k/ | ||
|
||
steps: | ||
- uses: actions/download-artifact@v2 | ||
name: Download distribution artifact | ||
with: | ||
name: release | ||
path: dist/ | ||
|
||
- name: Publish distribution on Test PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: startsWith(github.ref, 'refs/heads/release/') | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
repository_url: https://test.pypi.org/legacy/ | ||
skip_existing: true | ||
|
||
publish: | ||
|
||
name: Build and publish on PyPI | ||
if: startsWith(github.ref, 'refs/tags') | ||
needs: [build] | ||
runs-on: ubuntu-latest | ||
|
||
environment: | ||
name: PyPI | ||
url: https://pypi.org/project/aiida-cp2k/ | ||
|
||
steps: | ||
|
||
- uses: actions/download-artifact@v2 | ||
name: Download distribution artifact | ||
with: | ||
name: release | ||
path: dist/ | ||
|
||
- uses: softprops/[email protected] | ||
name: Create release | ||
if: startsWith(github.ref, 'refs/tags/v') | ||
with: | ||
files: | | ||
dist/* | ||
generate_release_notes: true | ||
|
||
- name: Publish distribution on PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_TOKEN }} | ||
publish: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'aiidateam/aiida-cp2k' | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.8' | ||
- name: Install flit | ||
run: pip install flit~=3.4 | ||
- name: Build and publish | ||
run: flit publish | ||
env: | ||
FLIT_USERNAME: __token__ | ||
FLIT_PASSWORD: ${{ secrets.PYPI_API_TOKEN }} | ||
- uses: softprops/[email protected] | ||
name: Create release | ||
with: | ||
files: | | ||
dist/* | ||
generate_release_notes: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.