Skip to content

Commit

Permalink
Merge pull request #4 from grobbles/feature/add_test_pypi_to_pipeline
Browse files Browse the repository at this point in the history
Feature/add test pypi to pipeline
  • Loading branch information
grobbles committed May 27, 2022
2 parents 6447629 + e53d78c commit ee449a0
Show file tree
Hide file tree
Showing 4 changed files with 127 additions and 18 deletions.
72 changes: 72 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: CI / CD

on:
push:
branches:
- main
- release

jobs:
build-and-publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest flake8
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: Build coverage file
run: |
coverage run -m pytest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2

- 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 Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

- name: Publish distribution 📦 to PyPI
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.PYPI_API_TOKEN }}
skip_existing: true
35 changes: 32 additions & 3 deletions .github/workflows/build.yml → .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,37 +1,66 @@
name: CI / CD

on: [push, pull_request]
on: [ push, pull_request ]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
python-version: [ "3.7", "3.8", "3.9", "3.10" ]

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest flake8
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: Build coverage file
run: |
coverage run -m pytest
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v2
uses: codecov/codecov-action@v2

- 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 Test PyPI
uses: pypa/gh-action-pypi-publish@master
with:
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true
verbose: true
2 changes: 0 additions & 2 deletions LICENSE → LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
The MIT License (MIT)

Copyright (c) 2022 Uwe Roder

Permission is hereby granted, free of charge, to any person obtaining a copy
Expand Down
36 changes: 23 additions & 13 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@
with open("requirements.txt", "r") as requirements_file:
requirements.append(requirements_file.read())

# How mature is this project? Common values are
# 1 - Planning
# 2 - Development
# 3 - Alpha
# 4 - Beta
# 5 - Production/Stable
# 'License :: OSI Approved :: MIT License',
# 'Development Status :: 3 - Alpha',
# "Intended Audience :: Developers",
# "Topic :: Communications",
# "Topic :: Utilities"
# "Programming Language :: Python",
classifiers = [
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
]

setuptools.setup(
name="SmartSignals",
version="0.0.0",
Expand All @@ -17,18 +36,9 @@
long_description_content_type="text/markdown",
url="https://github.com/grobbles/SmartSignals",
packages=["smart_signals"],
classifiers=[
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"Topic :: Communications",
"Topic :: Utilities"
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
],
keywords=["signals", "events", "slot", "qt"],
license='MIT',
# classifiers=classifiers,
python_requires='>=3.7',
keywords=["smart_signals", "SmartSignals", "signals", "events", "slot", "qt"],
install_requires=requirements
)

0 comments on commit ee449a0

Please sign in to comment.