Skip to content

Commit

Permalink
Merge pull request #28 from dbrattli/pyproject-toml
Browse files Browse the repository at this point in the history
feat: refactor to pyproject.toml
  • Loading branch information
dbrattli committed Mar 22, 2022
2 parents e057264 + 23fc33c commit 1dcf4c5
Show file tree
Hide file tree
Showing 61 changed files with 1,746 additions and 2,999 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,33 +14,25 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.9]
python-version: [3.9, "3.10"]

steps:
- uses: actions/checkout@v2

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Lint with flake8
pip install poetry
poetry install
- name: Code checks
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
poetry run pre-commit run --all-files --show-diff-on-failure
- name: Test with pytest
run: |
pytest --cov --cov-report xml
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
poetry run pytest
52 changes: 30 additions & 22 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,39 @@
# This workflows will upload a Python Package using Twine when a release is created
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
# This workflows will upload a Python Package using Poetry when a release is created

name: Upload Python Package
name: Publish Package

on:
release:
types: [created]

jobs:
deploy:

publish:
runs-on: ubuntu-latest

name: "Publish library"
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
- name: Check out
uses: actions/checkout@v3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
fetch-depth: 0

- name: Setup Python Env
uses: actions/setup-python@v3
with:
python-version: "3.9"

- name: Install dependencies
run: pip install poetry dunamai

- name: Set version
run: |
VERSION=$(dunamai from any --no-metadata --style pep440)
poetry version $VERSION
echo "__version__ = \"$VERSION\"" > aioreactive/_version.py
- name: Build package
run: poetry build

- name: Release to PyPI
run: |
poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} || echo 'Version exists'
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,6 @@ TestResults/Rx.TE.Tests.mdf
TestResults/Rx.TE.Tests_log.ldf
*.user

# Cloud9
.c9

# PyCharm
.idea
.zedstate
Expand All @@ -63,3 +60,5 @@ TestResults/Rx.TE.Tests_log.ldf
.ionide

coverage.xml

.vscode/
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- hooks:
- args:
- --remove-all-unused-imports
- --in-place
id: autoflake
repo: https://github.com/humitos/mirrors-autoflake
rev: v1.1
- hooks:
- id: isort
repo: https://github.com/timothycrosley/isort
rev: 5.10.1
- hooks:
- id: black
repo: https://github.com/psf/black
rev: 22.1.0
- hooks:
- id: flake8
exclude: (^docs/|^examples/|^notebooks/|^tests/)
repo: https://gitlab.com/pycqa/flake8
rev: 3.9.2
- hooks:
- id: pyright
name: pyright
entry: pyright
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright@1.1.231"]
repo: local
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10.0
24 changes: 0 additions & 24 deletions .vscode/settings.json

This file was deleted.

17 changes: 14 additions & 3 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@
The MIT License (MIT)
Copyright (c) 2016 Børge Lanes, Dag Brattli.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or
substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
116 changes: 0 additions & 116 deletions aioreactive.pyproj

This file was deleted.

20 changes: 0 additions & 20 deletions aioreactive.sln

This file was deleted.

0 comments on commit 1dcf4c5

Please sign in to comment.