Skip to content

Commit 16dfd08

Browse files
committed
ci ...
1 parent e4c9e03 commit 16dfd08

File tree

2 files changed

+72
-33
lines changed

2 files changed

+72
-33
lines changed

.github/workflows/python-package.yml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,36 +40,4 @@ jobs:
4040
python -m pip install scipy
4141
pip install -e .
4242
pytest
43-
- name: Install build tools
44-
run: |
45-
pip install build
46-
- name: Build the package
47-
run: |
48-
python -m build
49-
- name: Store the distribution packages
50-
uses: actions/upload-artifact@v4
51-
with:
52-
name: python-package-distributions
53-
path: dist/
54-
55-
publish-to-pypi:
56-
name: >-
57-
Publish Python 🐍 distribution 📦 to PyPI
58-
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes
59-
needs:
60-
- build
61-
runs-on: ubuntu-latest
62-
environment:
63-
name: pypi
64-
url: https://pypi.org/p/incrementalstats # Replace <package-name> with your PyPI project name
65-
permissions:
66-
id-token: write # IMPORTANT: mandatory for trusted publishing
67-
68-
steps:
69-
- name: Download all the dists
70-
uses: actions/download-artifact@v4
71-
with:
72-
name: python-package-distributions
73-
path: dist/
74-
- name: Publish distribution 📦 to PyPI
75-
uses: pypa/gh-action-pypi-publish@release/v1
43+
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
3+
4+
name: Python publish
5+
6+
on:
7+
push:
8+
tags:
9+
- 'v*' # Only run on version tags like v1.2.3
10+
11+
jobs:
12+
build:
13+
14+
runs-on: ubuntu-latest
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
python-version: ["3.x"]
19+
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Set up Python ${{ matrix.python-version }}
23+
uses: actions/setup-python@v3
24+
with:
25+
python-version: ${{ matrix.python-version }}
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
python -m pip install flake8 pytest
30+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
31+
- name: Lint with flake8
32+
run: |
33+
# stop the build if there are Python syntax errors or undefined names
34+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35+
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
36+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
37+
- name: Test with pytest
38+
run: |
39+
python -m pip install scipy
40+
pip install -e .
41+
pytest
42+
- name: Install build tools
43+
run: |
44+
pip install build
45+
- name: Build the package
46+
run: |
47+
python -m build
48+
- name: Store the distribution packages
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: python-package-distributions
52+
path: dist/
53+
54+
publish-to-pypi:
55+
needs:
56+
- build
57+
runs-on: ubuntu-latest
58+
environment:
59+
name: pypi
60+
url: https://pypi.org/p/incrementalstats
61+
permissions:
62+
id-token: write
63+
64+
steps:
65+
- name: Download all the dists
66+
uses: actions/download-artifact@v4
67+
with:
68+
name: python-package-distributions
69+
path: dist/
70+
- name: Publish distribution 📦 to PyPI
71+
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)