From 56fae2850658fbf7fa8616ae8a41d7c2c233de27 Mon Sep 17 00:00:00 2001 From: David Bensoussan Date: Sun, 23 Feb 2020 11:32:03 -0300 Subject: [PATCH 1/4] feat: make it pip compatible --- papirus/__init__.py | 1 - setup.py | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/papirus/__init__.py b/papirus/__init__.py index d74ce8d..0719624 100644 --- a/papirus/__init__.py +++ b/papirus/__init__.py @@ -1,4 +1,3 @@ -__version__ = '1.0.0' from papirus.lm75b import LM75B from papirus.epd import EPD as Papirus from papirus.text import PapirusText diff --git a/setup.py b/setup.py index c8dd7b8..494f5ad 100644 --- a/setup.py +++ b/setup.py @@ -1,10 +1,9 @@ #! /usr/bin/env python from distutils.core import setup -import papirus setup(name='papirus', - version=papirus.__version__, + version='1.0.0', description="PaPiRus API", author='PiSupply', author_email='sales@pi-supply.com', From e1273d1255296dcc8028d7e5c80c6f8b0cf317b3 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Wed, 4 Jan 2023 04:05:03 +0000 Subject: [PATCH 2/4] Create publish-to-pypi.yml --- .github/workflows/publish-to-pypi.yml | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 .github/workflows/publish-to-pypi.yml diff --git a/.github/workflows/publish-to-pypi.yml b/.github/workflows/publish-to-pypi.yml new file mode 100644 index 0000000..5013135 --- /dev/null +++ b/.github/workflows/publish-to-pypi.yml @@ -0,0 +1,54 @@ +name: Publish Python 🐍 distribution 📦 to PyPI + +on: + release: + types: [created] + workflow_dispatch: + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distribution 📦 to PyPI + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - 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/ . + + - uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./dist/* + + - name: Get Latest Release + id: latest_version + uses: abatilo/release-info-action@v1.3.2 + with: + owner: PiSupply + repo: PaPiRus + + - name: Upload binaries to release + uses: svenstaro/upload-release-action@v2 + with: + repo_token: ${{ secrets.GITHUB_TOKEN }} + file: ./dist/* + tag: ${{ steps.latest_version.outputs.latest_tag }} + overwrite: true + file_glob: true + + - name: Publish distribution 📦 to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.PYPI_API_TOKEN }} From 2be1d4a06c3c3c2d4bd0362a897f3f639f615c9a Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Wed, 4 Jan 2023 04:06:50 +0000 Subject: [PATCH 3/4] Create publish-to-pypi-test.yml --- .github/workflows/publish-to-pypi-test.yml | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/publish-to-pypi-test.yml diff --git a/.github/workflows/publish-to-pypi-test.yml b/.github/workflows/publish-to-pypi-test.yml new file mode 100644 index 0000000..aa701fd --- /dev/null +++ b/.github/workflows/publish-to-pypi-test.yml @@ -0,0 +1,36 @@ +name: Publish Python 🐍 distribution 📦 to TestPyPI + +on: [push] + +jobs: + build-n-publish: + name: Build and publish Python 🐍 distribution 📦 to TestPyPI + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + + - name: Set up Python 3.7 + uses: actions/setup-python@v4 + with: + python-version: 3.7 + + - 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/ . + + - uses: actions/upload-artifact@v3 + with: + name: wheels + path: ./dist/* + + - name: Publish distribution 📦 to Test PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + if: github.ref == 'refs/heads/master' From 3842337cfaa52fe3bcb221e09924b88c5573bcc0 Mon Sep 17 00:00:00 2001 From: Aaron Shaw Date: Wed, 4 Jan 2023 04:07:55 +0000 Subject: [PATCH 4/4] Create linting.yml --- .github/workflows/linting.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 .github/workflows/linting.yml diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..b4ba753 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,21 @@ +name: Python Flake8 + +on: [push, pull_request] + +jobs: + build: + + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + - name: Set up Python 3.8 + uses: actions/setup-python@v4 + with: + python-version: 3.8 + - name: Setup flake8 annotations + uses: rbialon/flake8-annotations@v1 + - name: Lint with flake8 + run: | + pip install flake8 + flake8 . --count --max-complexity=10 --statistics