Skip to content

Commit 374a617

Browse files
authored
Replaced poetry build system with hatch. (#9)
* Replaced poetry build system with hatch. * Fixed __subclasscheck__ and __instancecheck__ signatures. * Updated RTD workflow.
1 parent 06456d4 commit 374a617

File tree

18 files changed

+334
-1495
lines changed

18 files changed

+334
-1495
lines changed

.github/workflows/ci.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
---
2+
name: CI
3+
4+
on:
5+
push:
6+
pull_request:
7+
workflow_dispatch:
8+
9+
jobs:
10+
tests:
11+
name: Run tox on ${{ matrix.python-version }}
12+
runs-on: ubuntu-latest
13+
env:
14+
USING_COVERAGE: '3.7,3.8,3.9,3.10,3.11'
15+
16+
strategy:
17+
matrix:
18+
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
19+
20+
steps:
21+
- uses: actions/checkout@v3
22+
- uses: actions/setup-python@v4
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install dependencies
26+
run: |
27+
python -VV
28+
python -m site
29+
python -m pip install --upgrade pip setuptools wheel
30+
python -m pip install --upgrade coverage[toml] tox tox-gh-actions
31+
32+
- name: Run tox targets for ${{ matrix.python-version }}
33+
run: python -m tox
34+
35+
- name: Upload coverage data
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: coverage-data
39+
path: .coverage.*
40+
if-no-files-found: ignore
41+
42+
coverage:
43+
name: Combine & check coverage.
44+
runs-on: ubuntu-latest
45+
needs: tests
46+
47+
steps:
48+
- uses: actions/checkout@v3
49+
50+
- uses: actions/setup-python@v4
51+
with:
52+
python-version: ${{env.PYTHON_LATEST}}
53+
54+
- run: python -m pip install --upgrade coverage[toml]
55+
56+
- uses: actions/download-artifact@v3
57+
with:
58+
name: coverage-data
59+
60+
- name: Combine coverage & fail if it's <100%.
61+
run: |
62+
python -m coverage combine
63+
python -m coverage html --skip-covered --skip-empty
64+
# Report and write to summary.
65+
python -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
66+
67+
- name: Upload HTML report if check failed.
68+
uses: actions/upload-artifact@v3
69+
with:
70+
name: html-report
71+
path: htmlcov
72+
if: ${{ failure() }}
73+
74+
- name: Upload coverage to Codecov
75+
uses: codecov/codecov-action@v2
76+
with:
77+
fail_ci_if_error: true
78+
79+
docs:
80+
name: Build docs & run doctests
81+
runs-on: ubuntu-latest
82+
steps:
83+
- uses: actions/checkout@v3
84+
- uses: actions/setup-python@v4
85+
with:
86+
# Keep in sync with tox.ini/docs & readthedocs.yml
87+
python-version: "3.8"
88+
- run: python -m pip install --upgrade wheel tox
89+
90+
- run: python -m tox -e docs

.github/workflows/docs.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: RTD
2+
on:
3+
pull_request_target:
4+
types: [opened, synchronize, reopened]
5+
6+
permissions:
7+
pull-requests: write
8+
9+
jobs:
10+
documentation-links:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: readthedocs/actions/preview@v1
14+
with:
15+
project-slug: "pygopher-interfaces"

.github/workflows/lint.yml

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

.github/workflows/publish.yml

Lines changed: 41 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,47 @@
1-
name: publish
1+
# This workflow will upload a Python Package using Twine when a release is created
2+
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries
3+
4+
name: Upload Python Package
25

36
on:
4-
push:
5-
tags:
6-
- v*
7+
release:
8+
types: [published]
9+
10+
permissions:
11+
contents: read
712

813
jobs:
9-
upload:
10-
name: Publish to PyPI
14+
deploy:
15+
1116
runs-on: ubuntu-latest
17+
1218
steps:
13-
- uses: actions/checkout@master
14-
15-
- name: Set up Python 3.10
16-
uses: actions/setup-python@master
17-
with:
18-
python-version: "3.10"
19-
20-
- name: Install Poetry
21-
run: python -m pip install --upgrade pip poetry
22-
23-
- name: Build distribution packages
24-
run: poetry build
25-
26-
- name: Publish distribution packages to Test PyPI
27-
uses: pypa/gh-action-pypi-publish@master
28-
with:
29-
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
30-
repository_url: https://test.pypi.org/legacy/
31-
skip_existing: true
32-
verbose: true
33-
34-
- name: Publish package to PyPI
35-
if: startsWith(github.ref, 'refs/tags')
36-
uses: pypa/gh-action-pypi-publish@release/v1
37-
with:
38-
password: ${{ secrets.PYPI_API_TOKEN }}
39-
verbose: true
19+
- uses: actions/checkout@v3
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v3
23+
with:
24+
python-version: '3.10'
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install hatch
30+
31+
- name: Build package
32+
run: python -m hatch build
33+
34+
- name: Publish distribution packages to Test PyPI
35+
uses: pypa/gh-action-pypi-publish@master
36+
with:
37+
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
38+
repository_url: https://test.pypi.org/legacy/
39+
skip_existing: true
40+
verbose: true
41+
42+
- name: Publish package to PyPI
43+
if: startsWith(github.ref, 'refs/tags')
44+
uses: pypa/gh-action-pypi-publish@release/v1
45+
with:
46+
password: ${{ secrets.PYPI_API_TOKEN }}
47+
verbose: true

.github/workflows/test.yml

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

.pre-commit-config.yaml

Lines changed: 30 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,33 @@
1+
---
2+
ci:
3+
autoupdate_schedule: monthly
4+
#
5+
#default_language_version:
6+
# python: python3.10
7+
18
repos:
2-
- repo: local
9+
- repo: https://github.com/psf/black
10+
rev: 22.12.0
311
hooks:
4-
- id: pylint
5-
name: pylint
6-
entry: poetry run pylint
7-
language: system
8-
types:
9-
- python
10-
- id: mypy
11-
name: mypy
12-
entry: poetry run mypy
13-
language: system
14-
types:
15-
- python
16-
exclude: ^tests/
17-
- id: flake8
18-
name: flake8
19-
entry: poetry run flake8
20-
language: system
21-
types:
22-
- python
23-
- id: isort
24-
name: isort
25-
entry: poetry run isort
26-
language: system
27-
types:
28-
- python
2912
- id: black
30-
name: black
31-
entry: poetry run black
32-
language: system
33-
types:
34-
- python
13+
14+
- repo: https://github.com/PyCQA/isort
15+
rev: 5.11.4
16+
hooks:
17+
- id: isort
18+
additional_dependencies: [toml]
19+
20+
- repo: https://github.com/PyCQA/flake8
21+
rev: 6.0.0
22+
hooks:
23+
- id: flake8
24+
additional_dependencies: [flake8-cognitive-complexity]
25+
26+
- repo: https://github.com/pre-commit/pre-commit-hooks
27+
rev: v4.4.0
28+
hooks:
29+
- id: trailing-whitespace
30+
- id: end-of-file-fixer
31+
- id: debug-statements
32+
- id: check-toml
33+
- id: check-yaml

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sphinx:
44
configuration: docs/source/conf.py
55

66
python:
7-
version: 3.7
7+
version: 3.8
88
install:
99
- method: pip
1010
path: .

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ All notable changes to this project will be documented in this file.
66
The format is based on `Keep a Changelog <https://keepachangelog.com/en/1.0.0/>`_,
77
and this project adheres to `Semantic Versioning <https://semver.org/spec/v2.0.0.html>`_.
88

9+
0.1.3 - 2023-01-02
10+
------------------
11+
12+
- Replaced the Poetry build system with Hatch.
13+
14+
915
0.1.2 - 2022-10-27
1016
------------------
1117

README.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ To create an interface class, use the ``Interface`` metaclass.
5959
True
6060
6161
62-
.. |status| image:: https://github.com/mrogaski/pygopher-interfaces/actions/workflows/pipeline.yml/badge.svg
62+
.. |status| image:: https://github.com/mrogaski/pygopher-interfaces/workflows/CI/badge.svg?branch=main
6363
:alt: Status
64-
:target: https://github.com/mrogaski/pygopher-interfaces/actions
64+
:target: https://github.com/mrogaski/pygopher-interfaces/actions?workflow=CI
6565

6666
.. |pypi| image:: https://img.shields.io/pypi/pyversions/pygopher-interfaces
6767
:alt: PyPI - Python Version
@@ -82,4 +82,3 @@ To create an interface class, use the ``Interface`` metaclass.
8282
.. |analysis| image:: https://app.codacy.com/project/badge/Grade/0516015cd3f94d66b7a7c8203255b6de
8383
:alt: Code Quality
8484
:target: https://www.codacy.com/gh/mrogaski/pygopher-interfaces/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=mrogaski/pygopher-interfaces&amp;utm_campaign=Badge_Grade
85-

docs/source/changelog.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
.. include:: ../../CHANGELOG.rst
1+
.. include:: ../../CHANGELOG.rst

0 commit comments

Comments
 (0)