Skip to content

Commit

Permalink
Merge pull request #816 from maxcountryman/project
Browse files Browse the repository at this point in the history
update project layout and tools
  • Loading branch information
davidism authored Nov 1, 2023
2 parents 9862fb0 + 7556ec7 commit 2ddd5ed
Show file tree
Hide file tree
Showing 45 changed files with 411 additions and 1,703 deletions.
23 changes: 16 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
day: "monday"
time: "16:00"
timezone: "UTC"
- package-ecosystem: 'github-actions'
directory: '/'
schedule:
interval: 'monthly'
groups:
github-actions:
patterns:
- '*'
- package-ecosystem: 'pip'
directory: '/requirements/'
schedule:
interval: 'monthly'
groups:
python-requirements:
patterns:
- '*'
18 changes: 13 additions & 5 deletions .github/workflows/lock.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,25 @@
name: 'Lock threads'
name: 'Lock inactive closed issues'
# Lock closed issues that have not received any further activity for two weeks.
# This does not close open issues, only humans may do that. We find that it is
# easier to respond to new issues with fresh examples rather than continuing
# discussions on old issues.

on:
schedule:
- cron: '0 0 * * *'

permissions:
issues: write
pull-requests: write

concurrency:
group: lock

jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v4
- uses: dessant/lock-threads@be8aa5be94131386884a6da4189effda9b14aa21
with:
github-token: ${{ github.token }}
issue-inactive-days: 14
pr-inactive-days: 14
issue-lock-reason: ''
pr-lock-reason: ''
18 changes: 9 additions & 9 deletions .github/workflows/pre-commit.yaml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
name: pre-commit
on:
pull_request:
push:
branches: [main]
branches:
- main
pull_request:
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- run: pip install -r requirements/style.txt
- uses: pre-commit/action@v3.0.0
python-version: '3.x'
cache: pip
cache-dependency-path: requirements*/*.txt
- uses: pre-commit/action@646c83fcd040023954eafda54b4db0192ce70507
21 changes: 7 additions & 14 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,15 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.10'
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install -r requirements/ci-release.txt
python-version: '3.x'
cache: pip
cache-dependency-path: requirements*/*.txt
- run: pip install build
- run: python -m build
- run: twine check dist/*
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@v1.8.10
uses: pypa/gh-action-pypi-publish@b7f401de30cb6434a1e19f805ff006643653240e
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
43 changes: 21 additions & 22 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,37 +4,36 @@ on:
branches:
- main
pull_request:
branches:
- main
jobs:
tests:
name: ${{ matrix.name }}
name: ${{ matrix.python }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
include:
- {name: '3.11', python: '3.11', tox: py311 }
- {name: '3.10', python: '3.10', tox: py310}
- {name: '3.9', python: '3.9', tox: py39}
- {name: '3.8', python: '3.8', tox: py38}
- {name: 'PyPy', python: 'pypy-3.9', tox: pypy39}
- {name: 'Minimum Versions', python: '3.9', tox: py-min}
python: ['3.12', '3.11', '3.10', '3.9', '3.8']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: ${{ matrix.python }}
cache: 'pip'
cache-dependency-path: 'requirements/*.txt'
- name: update pip
run: |
pip install -U wheel
pip install -U setuptools
python -m pip install -U pip
- run: pip install -r requirements/ci-tests.txt
- run: tox -e ${{ matrix.tox }}
allow-prereleases: true
cache: pip
cache-dependency-path: requirements*/*.txt
- run: pip install tox coveralls
- run: tox run -e py${{ matrix.python }}
- run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.tox != 'style' }}
min:
name: Minimum Versions
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
- uses: actions/setup-python@61a6322f88396a6271a6ee3565807d608ecaddd1
with:
python-version: '3.8'
cache: pip
cache-dependency-path: requirements*/*.txt
- run: pip install tox
- run: tox run -e py-min
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,11 @@
__pycache__/
*.pyc
.pytest_cache/
.ruff_cache/
.tox/
.coverage
.coverage.*
htmlcov/
docs/_build/
*.egg-info
build/
dist/
venv/
32 changes: 7 additions & 25 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,34 +1,16 @@
ci:
autoupdate_schedule: monthly
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
hooks:
- id: pyupgrade
args: ["--py37-plus"]
- repo: https://github.com/asottile/reorder_python_imports
rev: v3.12.0
hooks:
- id: reorder-python-imports
additional_dependencies: ["setuptools>60.9"]
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-implicit-str-concat
- repo: https://github.com/peterdemin/pip-compile-multi
rev: v2.6.3
hooks:
- id: pip-compile-multi-verify
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: fix-byte-order-marker
- id: trailing-whitespace
- id: end-of-file-fixer
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
version: 2
build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"
python: '3.12'
python:
install:
- requirements: requirements/docs.txt
Expand Down
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ Unreleased
- Bump to Flask >= 2.3.0.
- Bump to Werkzeug >= 2.3.2.
- Remove previously deprecated code. #694
- Use modern `pyproject.toml` project metadata. Use flit_core instead of setuptools as
build backend.
- Use `datetime.now(timezone.utc)` instead of deprecated `datetime.utcnow`. #758


Expand Down
9 changes: 0 additions & 9 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit 2ddd5ed

Please sign in to comment.