Skip to content

Commit

Permalink
Merge pull request #37 from OpenPIV/master
Browse files Browse the repository at this point in the history
merge from upstream
  • Loading branch information
alexlib committed Mar 7, 2024
2 parents 836426b + 61a67dd commit 66270e3
Show file tree
Hide file tree
Showing 8 changed files with 873 additions and 56 deletions.
52 changes: 21 additions & 31 deletions .github/workflows/build.yml
@@ -1,40 +1,30 @@
name: Build and upload to PyPI

# Build on every branch push, tag push, and pull request change:
# on: [push, pull_request]
# on: [pull_request]
# Alternatively, to publish when a (published) GitHub Release is created, use the following:
on:
release:
types: [published]
release:
types: [published]

jobs:
build-n-publish:
build-and-publish:
name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
python-version: [3.10]
poetry-version: [1.5.0]
os: [ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
uses: actions/setup-python@v4.5.0
- uses: actions/setup-python@v4.5.0
with:
python-version: 3.10
- name: Install pypa/build
run: >-
python -m
pip install
build
--user
- name: Build a binary wheel and a source tarball
run: >-
python -m
build
--sdist
--wheel
--outdir dist/
.
- name: Publish distribution 📦 to PyPI
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
uses: pypa/gh-action-pypi-publish@master
python-version: ${{ matrix.python-version }}
- name: Run image
uses: abatilo/actions-poetry@v2.0.0
with:
password: ${{ secrets.PYPI_API_TOKEN }}
# repository_url: https://pypi.org/legacy/
poetry-version: ${{ matrix.poetry-version }}
- name: Publish
env:
PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_TOKEN
poetry publish --build
23 changes: 9 additions & 14 deletions .github/workflows/testing.yml
Expand Up @@ -9,24 +9,19 @@ jobs:
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
poetry-version: [1.5.0]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4.5.0
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install openpiv flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
# - name: Lint with flake8
# run: |
# # stop the build if there are Python syntax errors or undefined names
# flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
# flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with pytest
run: |
pytest
- name: Install poetry
uses: abatilo/actions-poetry@v2.0.0
with:
poetry-version: ${{ matrix.poetry-version }}
- name: Install the project dependencies
run: poetry install
- name: Run the automated tests (for example)
run: poetry run pytest openpiv -v
6 changes: 3 additions & 3 deletions .travis.yml
Expand Up @@ -6,8 +6,8 @@ notifications:
email: false

install:
- pip install -q numpy pytest
- pip install -e .
- pip install poetry
- poetry install --with=tests

script:
- pytest openpiv
- poetry run pytest openpiv
7 changes: 7 additions & 0 deletions INSTALL
Expand Up @@ -36,6 +36,13 @@ Use PyPI and pip

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


Use Poetry
================

poetry add openpiv


Bleeding edge development version
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
9 changes: 8 additions & 1 deletion README.md
Expand Up @@ -37,10 +37,16 @@ Use PyPI: <https://pypi.python.org/pypi/OpenPIV>:
## Or `conda`

conda install -c alexlib openpiv

## Or [Poetry](https://python-poetry.org/)

poetry add openpiv


### To build from source

<!-- TODO: Change this build method to use poetry -->

Download the package from the Github: https://github.com/OpenPIV/openpiv-python/archive/master.zip
or clone using git

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


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.
Expand Down

0 comments on commit 66270e3

Please sign in to comment.