Skip to content

Commit 61a67dd

Browse files
authored
Merge pull request #310 from yuriishizawa/master
Start moving build system to `poetry`
2 parents f23a541 + 63f9a44 commit 61a67dd

File tree

8 files changed

+873
-56
lines changed

8 files changed

+873
-56
lines changed

.github/workflows/build.yml

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,30 @@
11
name: Build and upload to PyPI
2-
3-
# Build on every branch push, tag push, and pull request change:
4-
# on: [push, pull_request]
5-
# on: [pull_request]
6-
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
72
on:
8-
release:
9-
types: [published]
3+
release:
4+
types: [published]
105

116
jobs:
12-
build-n-publish:
7+
build-and-publish:
138
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
14-
runs-on: ubuntu-18.04
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
python-version: [3.10]
13+
poetry-version: [1.5.0]
14+
os: [ubuntu-latest]
15+
runs-on: ${{ matrix.os }}
1516
steps:
1617
- uses: actions/checkout@v4
17-
- name: Set up Python 3.10
18-
uses: actions/[email protected]
18+
- uses: actions/[email protected]
1919
with:
20-
python-version: 3.10
21-
- name: Install pypa/build
22-
run: >-
23-
python -m
24-
pip install
25-
build
26-
--user
27-
- name: Build a binary wheel and a source tarball
28-
run: >-
29-
python -m
30-
build
31-
--sdist
32-
--wheel
33-
--outdir dist/
34-
.
35-
- name: Publish distribution 📦 to PyPI
36-
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
37-
uses: pypa/gh-action-pypi-publish@master
20+
python-version: ${{ matrix.python-version }}
21+
- name: Run image
22+
uses: abatilo/[email protected]
3823
with:
39-
password: ${{ secrets.PYPI_API_TOKEN }}
40-
# repository_url: https://pypi.org/legacy/
24+
poetry-version: ${{ matrix.poetry-version }}
25+
- name: Publish
26+
env:
27+
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
28+
run: |
29+
poetry config pypi-token.pypi $PYPI_TOKEN
30+
poetry publish --build

.github/workflows/testing.yml

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,24 +9,19 @@ jobs:
99
strategy:
1010
matrix:
1111
python-version: ["3.9", "3.10", "3.11"]
12+
poetry-version: [1.5.0]
1213

1314
steps:
1415
- uses: actions/checkout@v4
1516
- name: Set up Python ${{ matrix.python-version }}
1617
uses: actions/[email protected]
1718
with:
1819
python-version: ${{ matrix.python-version }}
19-
- name: Install dependencies
20-
run: |
21-
python -m pip install --upgrade pip
22-
pip install openpiv flake8 pytest
23-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
24-
# - name: Lint with flake8
25-
# run: |
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
31-
run: |
32-
pytest
20+
- name: Install poetry
21+
uses: abatilo/[email protected]
22+
with:
23+
poetry-version: ${{ matrix.poetry-version }}
24+
- name: Install the project dependencies
25+
run: poetry install
26+
- name: Run the automated tests (for example)
27+
run: poetry run pytest openpiv -v

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ notifications:
66
email: false
77

88
install:
9-
- pip install -q numpy pytest
10-
- pip install -e .
9+
- pip install poetry
10+
- poetry install --with=tests
1111

1212
script:
13-
- pytest openpiv
13+
- poetry run pytest openpiv

INSTALL

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,13 @@ Use PyPI and pip
3636

3737
Downloads the code from PyPI and runs the setup for you with installation and Cython (if preinstalled)
3838

39+
40+
Use Poetry
41+
================
42+
43+
poetry add openpiv
44+
45+
3946
Bleeding edge development version
4047
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4148

README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,16 @@ Use PyPI: <https://pypi.python.org/pypi/OpenPIV>:
3737
## Or `conda`
3838

3939
conda install -c alexlib openpiv
40+
41+
## Or [Poetry](https://python-poetry.org/)
42+
43+
poetry add openpiv
4044

4145

4246
### To build from source
4347

48+
<!-- TODO: Change this build method to use poetry -->
49+
4450
Download the package from the Github: https://github.com/OpenPIV/openpiv-python/archive/master.zip
4551
or clone using git
4652

@@ -87,7 +93,8 @@ These and many additional examples are in another repository: [OpenPIV-Python-Ex
8793
11. [David Bohringer](https://github.com/davidbhr)
8894
12. [Erich Zimmer](https://github.com/ErichZimmer)
8995
13. [Peter Vennemann](https://github.com/eguvep)
90-
14. [Lento Manickathan](https://github.com/lento234)
96+
14. [Lento Manickathan](https://github.com/lento234)
97+
15. [Yuri Ishizawa](https://github.com/yuriishizawa)
9198

9299

93100
Copyright statement: `smoothn.py` is a Python version of `smoothn.m` originally created by D. Garcia [https://de.mathworks.com/matlabcentral/fileexchange/25634-smoothn], written by Prof. Lewis and available on Github [https://github.com/profLewis/geogg122/blob/master/Chapter5_Interpolation/python/smoothn.py]. We include a version of it in the `openpiv` folder for convenience and preservation. We are thankful to the original authors for releasing their work as an open source. OpenPIV license does not relate to this code. Please communicate with the authors regarding their license.

0 commit comments

Comments
 (0)