Skip to content

Commit

Permalink
Merge pull request #213 from Minipada/pip
Browse files Browse the repository at this point in the history
feat: make it pip compatible
  • Loading branch information
shawaj authored Jan 4, 2023
2 parents b20996a + 3842337 commit 13579fc
Show file tree
Hide file tree
Showing 5 changed files with 112 additions and 3 deletions.
21 changes: 21 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions .github/workflows/publish-to-pypi-test.yml
Original file line number Diff line number Diff line change
@@ -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'
54 changes: 54 additions & 0 deletions .github/workflows/publish-to-pypi.yml
Original file line number Diff line number Diff line change
@@ -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 }}
1 change: 0 additions & 1 deletion papirus/__init__.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -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',
Expand Down

0 comments on commit 13579fc

Please sign in to comment.