Skip to content

Commit 2431431

Browse files
authored
Configure GitHub actions for build and deploy to PyPI (#107)
Configure GitHub actions for build and deploy to PyPI
2 parents 613cca4 + 1547377 commit 2431431

File tree

4 files changed

+44
-68
lines changed

4 files changed

+44
-68
lines changed

.github/workflows/main.yml

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,54 @@
11
name: build
22

3-
on: [push]
3+
on: [push, pull_request]
44

55
jobs:
66
build:
77

88
runs-on: ubuntu-latest
9+
910
strategy:
11+
fail-fast: false
1012
matrix:
11-
python-version: [2.7, 3.5, 3.6, 3.7, 3.8]
12-
13+
python: ["2.7", "3.5", "3.6", "3.7", "3.8"]
14+
1315
steps:
14-
- uses: actions/checkout@v2
15-
- name: Set up Python ${{ matrix.python-version }}
16+
- uses: actions/checkout@v1
17+
- name: Set up Python
1618
uses: actions/setup-python@v1
1719
with:
18-
python-version: ${{ matrix.python-version }}
19-
- name: Install dependencies
20+
python-version: ${{ matrix.python }}
21+
- name: Install tox
2022
run: |
2123
python -m pip install --upgrade pip
22-
pip install -r requirements.txt
23-
- name: Lint with flake8
24+
pip install tox
25+
- name: Test
2426
run: |
25-
pip install flake8
26-
# stop the build if there are Python syntax errors or undefined names
27-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
28-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
29-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
30-
- name: Test with pytest
27+
tox -e py
28+
29+
deploy:
30+
31+
if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')
32+
33+
runs-on: ubuntu-latest
34+
35+
needs: build
36+
37+
steps:
38+
- uses: actions/checkout@v1
39+
- name: Set up Python
40+
uses: actions/setup-python@v1
41+
with:
42+
python-version: "3.7"
43+
- name: Install wheel
3144
run: |
32-
pip install pytest
33-
pytest
45+
python -m pip install --upgrade pip
46+
pip install --upgrade wheel setuptools
47+
- name: Build package
48+
run: |
49+
python setup.py sdist bdist_wheel
50+
- name: Publish package to PyPI
51+
uses: pypa/gh-action-pypi-publish@master
52+
with:
53+
user: __token__
54+
password: ${{ secrets.pypi_token }}

.travis.yml

Lines changed: 0 additions & 50 deletions
This file was deleted.

README.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
pytest-flask
22
============
33

4-
|PyPI version| |conda-forge version| |Python versions| |Documentation status|
4+
|PyPI version| |conda-forge version| |Python versions| |ci| |Documentation status|
55

66
An extension of `pytest <http://pytest.org/>`__ test runner which
77
provides a set of useful tools to simplify testing and development
@@ -44,6 +44,10 @@ suggestion.
4444
:target: https://anaconda.org/conda-forge/pytest-flask
4545
:alt: conda-forge version
4646

47+
.. |ci| image:: https://github.com/pytest-dev/pytest-flask/workflows/build/badge.svg
48+
:target: https://github.com/pytest-dev/pytest-flask/actions
49+
:alt: CI status
50+
4751
.. |Python versions| image:: https://img.shields.io/pypi/pyversions/pytest-flask.svg
4852
:target: https://pypi.org/project/pytest-flask
4953
:alt: PyPi downloads

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ def read(*parts):
170170
'Programming Language :: Python :: 3.5',
171171
'Programming Language :: Python :: 3.6',
172172
'Programming Language :: Python :: 3.7',
173+
'Programming Language :: Python :: 3.8',
173174
'Topic :: Software Development :: Testing',
174175
'Topic :: Software Development :: Libraries :: Python Modules',
175176
],

0 commit comments

Comments
 (0)