Skip to content

Commit

Permalink
DX: push to PyPI on releases (#34)
Browse files Browse the repository at this point in the history
* DOC: add PyPI badges
* DOC: update installation instructions
  • Loading branch information
redeboer authored Dec 15, 2022
1 parent 54f1448 commit 441a6ea
Show file tree
Hide file tree
Showing 5 changed files with 44 additions and 4 deletions.
5 changes: 5 additions & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,14 @@
"Jpsi",
"Kallen",
"MAINT",
"PyPI",
"absl",
"arange",
"aslatex",
"autoscale",
"autoupdate",
"axvline",
"bdist",
"caplog",
"cloudpickle",
"codecov",
Expand Down Expand Up @@ -105,7 +107,9 @@
"pycache",
"pygments",
"redeboer",
"sdist",
"seealso",
"setuptools",
"sharey",
"startswith",
"textwrap",
Expand All @@ -127,6 +131,7 @@
"Breit",
"Bugg",
"Clebsch",
"Colab",
"ComPWA",
"Conda",
"Dalitz",
Expand Down
24 changes: 23 additions & 1 deletion .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
if: startsWith(github.ref, 'refs/tags')
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@master
- uses: actions/checkout@v3
- name: Configure Git credentials
run: |
git config --global user.name "GitHub Action"
Expand All @@ -29,3 +29,25 @@ jobs:
MINOR_VERSION_BRANCH="${BASH_REMATCH[1]}.${BASH_REMATCH[2]}.x"
git push origin HEAD:refs/heads/$MINOR_VERSION_BRANCH --force
fi
pypi:
name: Publish to PyPI
if: startsWith(github.ref, 'refs/tags')
needs: push
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ repos:
hooks:
- id: check-dev-files
args:
- --no-cd
- --no-docs
- --no-prettierrc
- --pin-requirements=bimonthly
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

[![GPLv3+ license](https://img.shields.io/badge/License-GPLv3+-blue.svg)](https://www.gnu.org/licenses/gpl-3.0-standalone.html)

[![PyPI package](https://badge.fury.io/py/ampform-dpd.svg)](https://pypi.org/project/ampform-dpd)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/ampform-dpd)](https://pypi.org/project/ampform-dpd)

[![Documentation build status](https://github.com/ComPWA/ampform-dpd/workflows/CI-docs/badge.svg)](https://github.com/ComPWA/ampform-dpd/actions/workflows/ci-docs.yml?query=branch%3Amain+workflow%3Aci-docs)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/ComPWA/ampform-dpd/main.svg)](https://results.pre-commit.ci/latest/github/ComPWA/ampform-dpd/main)
[![Test coverage](https://codecov.io/gh/ComPWA/ampform-dpd/branch/main/graph/badge.svg)](https://codecov.io/gh/ComPWA/ampform-dpd)
Expand Down
15 changes: 13 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,28 @@
```

[![Supported Python versions](https://img.shields.io/pypi/pyversions/ampform-dpd)](https://pypi.org/project/ampform-dpd)
[![Google Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/github/ComPWA/ampform/blob/main)
[![Binder](https://static.mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/ComPWA/ampform/main?filepath=docs)

This Python package is a (temporary) extension of [AmpForm](https://ampform.rtfd.io) and provides a symbolic implementation of Dalitz-plot decomposition ([10.1103/PhysRevD.101.034033](https://journals.aps.org/prd/abstract/10.1103/PhysRevD.101.034033)) with [SymPy](https://www.sympy.org/en/index.html). It has been extracted from the [ComPWA/polarimetry](https://github.com/ComPWA/polarimetry) repository, which is not yet public.

## Installation

The fastest way of installing this package is through PyPI:

```shell
python3 -m pip install git+https://github.com/ComPWA/ampform-dpd@stable
python3 -m pip install ampform-dpd
```

This installs the latest version that you can find on the [`stable`](https://github.com/ComPWA/ampform-dpd/tree/stable) branch. The latest version on the [`main`](https://github.com/ComPWA/ampform/tree/main) branch
can be installed as follows:

```shell
python3 -m pip install git+https://github.com/ComPWA/ampform@main
```

This installs the latest version that you can find on the [`stable`](https://github.com/ComPWA/ampform-dpd/tree/stable) branch. You can substitute `stable` in the above command with `main` or any of the [tags](https://github.com/ComPWA/ampform-dpd/tags) listed under the [releases](https://github.com/ComPWA/ampform-dpd/releases). In a similar way, you can list `ampform-dpd` as a dependency of your application in either `setup.cfg` or a `requirements.txt` file as:
You can substitute `stable` in the above command with `main` or any of the [tags](https://github.com/ComPWA/ampform-dpd/tags) listed under the [releases](https://github.com/ComPWA/ampform-dpd/releases). In a similar way, you can list `ampform-dpd` as a dependency of your application in either `setup.cfg` or a `requirements.txt` file as:

```text
ampform-dpd @ git+https://github.com/ComPWA/ampform-dpd@main
Expand Down

0 comments on commit 441a6ea

Please sign in to comment.