Skip to content

Commit 1dcf4c5

Browse files
authored
Merge pull request #28 from dbrattli/pyproject-toml
feat: refactor to pyproject.toml
2 parents e057264 + 23fc33c commit 1dcf4c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+1746
-2999
lines changed

.github/workflows/python-package.yml

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,25 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
python-version: [3.9]
17+
python-version: [3.9, "3.10"]
1818

1919
steps:
2020
- uses: actions/checkout@v2
21+
2122
- name: Set up Python ${{ matrix.python-version }}
2223
uses: actions/setup-python@v2
2324
with:
2425
python-version: ${{ matrix.python-version }}
26+
2527
- name: Install dependencies
2628
run: |
27-
python -m pip install --upgrade pip
28-
pip install flake8 pytest
29-
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
30-
- name: Lint with flake8
29+
pip install poetry
30+
poetry install
31+
32+
- name: Code checks
3133
run: |
32-
# stop the build if there are Python syntax errors or undefined names
33-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
34-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
35-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
34+
poetry run pre-commit run --all-files --show-diff-on-failure
35+
3636
- name: Test with pytest
3737
run: |
38-
pytest --cov --cov-report xml
39-
- name: Upload coverage to Codecov
40-
uses: codecov/codecov-action@v1
41-
with:
42-
token: ${{ secrets.CODECOV_TOKEN }}
43-
file: ./coverage.xml
44-
flags: unittests
45-
name: codecov-umbrella
46-
fail_ci_if_error: true
38+
poetry run pytest

.github/workflows/python-publish.yml

Lines changed: 30 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,39 @@
1-
# This workflows will upload a Python Package using Twine when a release is created
2-
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
1+
# This workflows will upload a Python Package using Poetry when a release is created
32

4-
name: Upload Python Package
3+
name: Publish Package
54

65
on:
76
release:
87
types: [created]
98

109
jobs:
11-
deploy:
12-
10+
publish:
1311
runs-on: ubuntu-latest
14-
12+
name: "Publish library"
1513
steps:
16-
- uses: actions/checkout@v2
17-
- name: Set up Python
18-
uses: actions/setup-python@v2
19-
with:
20-
python-version: '3.x'
21-
- name: Install dependencies
22-
run: |
23-
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
25-
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
28-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
29-
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
14+
- name: Check out
15+
uses: actions/checkout@v3
16+
with:
17+
token: "${{ secrets.GITHUB_TOKEN }}"
18+
fetch-depth: 0
19+
20+
- name: Setup Python Env
21+
uses: actions/setup-python@v3
22+
with:
23+
python-version: "3.9"
24+
25+
- name: Install dependencies
26+
run: pip install poetry dunamai
27+
28+
- name: Set version
29+
run: |
30+
VERSION=$(dunamai from any --no-metadata --style pep440)
31+
poetry version $VERSION
32+
echo "__version__ = \"$VERSION\"" > aioreactive/_version.py
33+
34+
- name: Build package
35+
run: poetry build
36+
37+
- name: Release to PyPI
38+
run: |
39+
poetry publish -u __token__ -p ${{ secrets.PYPI_API_TOKEN }} || echo 'Version exists'

.gitignore

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ TestResults/Rx.TE.Tests.mdf
5050
TestResults/Rx.TE.Tests_log.ldf
5151
*.user
5252

53-
# Cloud9
54-
.c9
55-
5653
# PyCharm
5754
.idea
5855
.zedstate
@@ -63,3 +60,5 @@ TestResults/Rx.TE.Tests_log.ldf
6360
.ionide
6461

6562
coverage.xml
63+
64+
.vscode/

.pre-commit-config.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
repos:
2+
- hooks:
3+
- args:
4+
- --remove-all-unused-imports
5+
- --in-place
6+
id: autoflake
7+
repo: https://github.com/humitos/mirrors-autoflake
8+
rev: v1.1
9+
- hooks:
10+
- id: isort
11+
repo: https://github.com/timothycrosley/isort
12+
rev: 5.10.1
13+
- hooks:
14+
- id: black
15+
repo: https://github.com/psf/black
16+
rev: 22.1.0
17+
- hooks:
18+
- id: flake8
19+
exclude: (^docs/|^examples/|^notebooks/|^tests/)
20+
repo: https://gitlab.com/pycqa/flake8
21+
rev: 3.9.2
22+
- hooks:
23+
- id: pyright
24+
name: pyright
25+
entry: pyright
26+
language: node
27+
pass_filenames: false
28+
types: [python]
29+
additional_dependencies: ["pyright@1.1.231"]
30+
repo: local

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10.0

.vscode/settings.json

Lines changed: 0 additions & 24 deletions
This file was deleted.

LICENSE.txt

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
11
The MIT License (MIT)
22
Copyright (c) 2016 Børge Lanes, Dag Brattli.
33

4-
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:
4+
Permission is hereby granted, free of charge, to any person obtaining a copy of this
5+
software and associated documentation files (the "Software"), to deal in the Software
6+
without restriction, including without limitation the rights to use, copy, modify,
7+
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
8+
permit persons to whom the Software is furnished to do so, subject to the following
9+
conditions:
510

6-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
11+
The above copyright notice and this permission notice shall be included in all copies or
12+
substantial portions of the Software.
713

8-
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.
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
16+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
17+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
18+
OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
19+
OTHER DEALINGS IN THE SOFTWARE.

aioreactive.pyproj

Lines changed: 0 additions & 116 deletions
This file was deleted.

aioreactive.sln

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)