Skip to content

Commit 997f481

Browse files
authored
Add developer docs and fix release process (#92)
* Add developer docs * Fix Github Action that releases on Pypi * Fix environment name
1 parent 213ab86 commit 997f481

3 files changed

Lines changed: 85 additions & 20 deletions

File tree

.github/workflows/release.yml

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release
1+
name: Publish Python 🐍 distribution 📦 to PyPI
22

33
on:
44
push:
@@ -7,33 +7,47 @@ on:
77

88
jobs:
99
build:
10+
name: Build distribution 📦
1011
if: github.repository == 'mozilla-services/python-dockerflow'
1112
runs-on: ubuntu-latest
1213

1314
steps:
14-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1516
with:
1617
fetch-depth: 0
1718

1819
- name: Set up Python
19-
uses: actions/setup-python@v2
20+
uses: actions/setup-python@v5
2021
with:
2122
python-version: 3.8
2223

23-
- name: Install dependencies
24-
run: |
25-
python -m pip install -U pip
26-
python -m pip install -U setuptools twine wheel
27-
28-
- name: Build packages
29-
run: |
30-
python setup.py --version
31-
python setup.py sdist --format=gztar bdist_wheel
32-
twine check dist/*
33-
34-
- name: Upload packages to PyPI
35-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
36-
run: twine upload dist/*
37-
env:
38-
TWINE_USERNAME: ${{ secrets.TWINE_USERNAME }}
39-
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
24+
- name: Install pypa/build
25+
run: python3 -m pip install build
26+
27+
- name: Build a binary wheel and a source tarball
28+
run: python3 -m build
29+
30+
- name: Store the distribution packages
31+
uses: actions/upload-artifact@v3
32+
with:
33+
name: python-package-distributions
34+
path: dist/
35+
36+
publish-to-pypi:
37+
name: Publish Python 🐍 distribution 📦 to PyPI
38+
needs:
39+
- build
40+
runs-on: ubuntu-latest
41+
environment:
42+
name: release
43+
url: https://pypi.org/p/dockerflow
44+
permissions:
45+
id-token: write
46+
steps:
47+
- name: Download all the dists
48+
uses: actions/download-artifact@v4
49+
with:
50+
name: python-package-distributions
51+
path: dist/
52+
- name: Publish distribution 📦 to PyPI
53+
uses: pypa/gh-action-pypi-publish@release/v1

docs/development.rst

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Development
2+
===========
3+
4+
5+
Setup
6+
-----
7+
8+
**Requirements**
9+
10+
- `tox <https://tox.wiki>`_
11+
- `Redis <https://redis.io/>`_
12+
13+
14+
Run tests
15+
---------
16+
17+
Run a local Redis:
18+
19+
::
20+
21+
docker run redis -p 6379:6379
22+
23+
Run the test suite:
24+
25+
::
26+
27+
tox -v
28+
29+
For a specific framework or version (see ``tox.ini`` for available environments):
30+
31+
::
32+
33+
tox -e py311-fl22
34+
35+
Pass arguments to ``pytest`` using the ``--`` delimiter:
36+
37+
::
38+
39+
tox -e py311-fl22 -- -x tests/flask/test_flask.py
40+
41+
42+
Release
43+
-------
44+
45+
1. Update the changelog in ``docs/changelog.rst``
46+
2. Tag using `Calver <https://calver.org/>`_
47+
3. Push tag to Github
48+
4. Create release entry in repository
49+
50+
A Github Action will be triggered and publish the package to Pypi.

docs/index.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ Contents
6464
:maxdepth: 2
6565
:glob:
6666

67+
development
6768
authors
6869
changelog
6970
logging

0 commit comments

Comments
 (0)