Skip to content

Commit fa7f8ab

Browse files
committed
Update to pyproject.toml, poetry, and update docs to use yaml config
1 parent ee656d8 commit fa7f8ab

26 files changed

Lines changed: 2590 additions & 516 deletions

.coveragerc

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

setup.cfg renamed to .flake8

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
[metadata]
2-
description-file = README.rst
3-
4-
[tool:pytest]
5-
testpaths = tests
6-
norecursedirs = .git
7-
81
[flake8]
92
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
103
doctests = True

.github/workflows/ci.yml

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,15 @@ name: CI
22

33
on:
44
push:
5+
branches: ["master"]
56
pull_request:
67
branches: ["master"]
78

9+
env:
10+
POETRY_VERSION: 1.6.1
11+
TOX_VERSION: 4.11.3
12+
COVERALLS_VERSION: 3.3.1
13+
814
jobs:
915
linting:
1016
name: "Perform linting checks"
@@ -19,14 +25,42 @@ jobs:
1925
python-version: "${{ matrix.python-version }}"
2026
- name: "Install dependencies"
2127
run: |
22-
python -m pip install --upgrade pip
23-
pip install -U tox
28+
python3 -m pip install --upgrade pip
29+
python3 -m pip install --user pipx
30+
python3 -m pipx ensurepath
31+
pipx install poetry==$POETRY_VERSION
32+
pipx install tox==$TOX_VERSION
2433
- name: Lint with tox
2534
run: |
2635
tox
2736
env:
2837
TOXENV: lint
2938

39+
docs:
40+
name: "Build docs"
41+
needs: linting
42+
runs-on: ubuntu-latest
43+
strategy:
44+
matrix:
45+
python-version: ["3.11"]
46+
steps:
47+
- uses: "actions/checkout@v2"
48+
- uses: "actions/setup-python@v2"
49+
with:
50+
python-version: "${{ matrix.python-version }}"
51+
- name: "Install dependencies"
52+
run: |
53+
python3 -m pip install --upgrade pip
54+
python3 -m pip install --user pipx
55+
python3 -m pipx ensurepath
56+
pipx install poetry==$POETRY_VERSION
57+
pipx install tox==$TOX_VERSION
58+
- name: Make docs with tox
59+
run: |
60+
tox
61+
env:
62+
TOXENV: docs
63+
3064
tests:
3165
name: tests
3266
needs: linting
@@ -47,8 +81,12 @@ jobs:
4781
python-version: ${{ matrix.python-version }}
4882
- name: Install dependencies
4983
run: |
50-
python -m pip install --upgrade pip
51-
pip install -U tox coveralls
84+
python3 -m pip install --upgrade pip
85+
python3 -m pip install --user pipx
86+
python3 -m pipx ensurepath
87+
pipx install poetry==$POETRY_VERSION
88+
pipx install tox==$TOX_VERSION
89+
pipx install coveralls==$COVERALLS_VERSION
5290
- name: Prepare toxenv
5391
id: toxenv
5492
run: |

.github/workflows/pythonpublish.yml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,10 @@ jobs:
2121
- name: Install dependencies
2222
run: |
2323
python -m pip install --upgrade pip
24-
pip install setuptools wheel twine
24+
python3 -m pip install --user pipx
25+
python3 -m pipx ensurepath
26+
pipx install poetry==1.6.1
2527
- name: Build and publish
26-
env:
27-
TWINE_USERNAME: __token__
28-
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
2928
run: |
30-
python setup.py sdist bdist_wheel
31-
twine upload dist/*
29+
poetry build
30+
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}

.pre-commit-config.yaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
repos:
2+
- repo: https://github.com/python-poetry/poetry
3+
rev: 1.6.0
4+
hooks:
5+
- id: poetry-check
6+
27
- repo: https://github.com/pycqa/flake8
38
rev: 6.0.0
49
hooks:
@@ -14,13 +19,10 @@ repos:
1419
types: [python]
1520
require_serial: true
1621
files: ^ring_doorbell/
17-
args:
18-
- --rcfile=pylintrc
1922

2023
- repo: https://github.com/python/black
2124
rev: 23.3.0
2225
hooks:
2326
- id: black
2427
files: ^ring_doorbell/|^tests/|^test.py|^scripts/
25-
args:
26-
- --check
28+

.readthedocs.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Read the Docs configuration file for Sphinx projects
2+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3+
4+
# Required
5+
version: 2
6+
7+
# Set the OS, Python version and other tools you might need
8+
build:
9+
os: ubuntu-22.04
10+
tools:
11+
python: "3.11"
12+
# You can also specify other tool versions:
13+
# nodejs: "20"
14+
# rust: "1.70"
15+
# golang: "1.20"
16+
17+
# Build documentation in the "docs/" directory with Sphinx
18+
sphinx:
19+
configuration: docs/source/conf.py
20+
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
21+
# builder: "dirhtml"
22+
# Fail on all warnings to avoid broken references
23+
# fail_on_warning: true
24+
25+
# Optionally build your docs in additional formats such as PDF and ePub
26+
# formats:
27+
# - pdf
28+
# - epub
29+
30+
formats: all
31+
32+
# Optional but recommended, declare the Python requirements required
33+
# to build your documentation
34+
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
35+
# python:
36+
# install:
37+
# - requirements: docs/requirements.txt
38+
python:
39+
install:
40+
- method: pip
41+
path: .
42+
extra_requirements:
43+
- docs

0 commit comments

Comments
 (0)