Skip to content

Commit

Permalink
Merge pull request #287 from sdb9696/migrate_to_pyproject
Browse files Browse the repository at this point in the history
Update to pyproject.toml, poetry, and update docs to use yaml config
  • Loading branch information
sdb9696 committed Sep 26, 2023
2 parents ee656d8 + fa7f8ab commit 60f8bf8
Show file tree
Hide file tree
Showing 26 changed files with 2,590 additions and 516 deletions.
8 changes: 0 additions & 8 deletions .coveragerc

This file was deleted.

7 changes: 0 additions & 7 deletions setup.cfg → .flake8
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
[metadata]
description-file = README.rst

[tool:pytest]
testpaths = tests
norecursedirs = .git

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
Expand Down
46 changes: 42 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,15 @@ name: CI

on:
push:
branches: ["master"]
pull_request:
branches: ["master"]

env:
POETRY_VERSION: 1.6.1
TOX_VERSION: 4.11.3
COVERALLS_VERSION: 3.3.1

jobs:
linting:
name: "Perform linting checks"
Expand All @@ -19,14 +25,42 @@ jobs:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -U tox
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Lint with tox
run: |
tox
env:
TOXENV: lint

docs:
name: "Build docs"
needs: linting
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.11"]
steps:
- uses: "actions/checkout@v2"
- uses: "actions/setup-python@v2"
with:
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
- name: Make docs with tox
run: |
tox
env:
TOXENV: docs

tests:
name: tests
needs: linting
Expand All @@ -47,8 +81,12 @@ jobs:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -U tox coveralls
python3 -m pip install --upgrade pip
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==$POETRY_VERSION
pipx install tox==$TOX_VERSION
pipx install coveralls==$COVERALLS_VERSION
- name: Prepare toxenv
id: toxenv
run: |
Expand Down
11 changes: 5 additions & 6 deletions .github/workflows/pythonpublish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,10 @@ jobs:
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python3 -m pip install --user pipx
python3 -m pipx ensurepath
pipx install poetry==1.6.1
- name: Build and publish
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
poetry build
poetry publish -u __token__ -p ${{ secrets.PYPI_TOKEN }}
10 changes: 6 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
repos:
- repo: https://github.com/python-poetry/poetry
rev: 1.6.0
hooks:
- id: poetry-check

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
Expand All @@ -14,13 +19,10 @@ repos:
types: [python]
require_serial: true
files: ^ring_doorbell/
args:
- --rcfile=pylintrc

- repo: https://github.com/python/black
rev: 23.3.0
hooks:
- id: black
files: ^ring_doorbell/|^tests/|^test.py|^scripts/
args:
- --check

43 changes: 43 additions & 0 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Read the Docs configuration file for Sphinx projects
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the OS, Python version and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
# You can also specify other tool versions:
# nodejs: "20"
# rust: "1.70"
# golang: "1.20"

# Build documentation in the "docs/" directory with Sphinx
sphinx:
configuration: docs/source/conf.py
# You can configure Sphinx to use a different builder, for instance use the dirhtml builder for simpler URLs
# builder: "dirhtml"
# Fail on all warnings to avoid broken references
# fail_on_warning: true

# Optionally build your docs in additional formats such as PDF and ePub
# formats:
# - pdf
# - epub

formats: all

# Optional but recommended, declare the Python requirements required
# to build your documentation
# See https://docs.readthedocs.io/en/stable/guides/reproducible-builds.html
# python:
# install:
# - requirements: docs/requirements.txt
python:
install:
- method: pip
path: .
extra_requirements:
- docs

0 comments on commit 60f8bf8

Please sign in to comment.