Skip to content

Commit

Permalink
Refactor repo to match cookiecutter 🍪
Browse files Browse the repository at this point in the history
  • Loading branch information
todofixthis committed Oct 19, 2024
1 parent de88e13 commit bda4945
Show file tree
Hide file tree
Showing 31 changed files with 2,540 additions and 1,572 deletions.
16 changes: 16 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# https://docs.github.com/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
version: 2
updates:
# Auto-update Python project dependencies.
# Note that we set package ecosystem to "pip" even though we're using poetry.
# :see: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file#package-ecosystem
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"

# Auto-update GitHub Actions dependencies.
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
42 changes: 27 additions & 15 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,36 +1,50 @@
# https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
name: CI

on:
push: ~

jobs:
build:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
# Note: Use quotes to avoid float cast - especially important if the
# version number ends with 0!
- "3.10"
- "3.11"
- "3.13"
- "3.12"
- "3.11"

steps:
- name: Clone repo
uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
# https://github.com/actions/setup-python#caching-packages-dependencies
cache: pip
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .
pip install poetry
poetry install --with=ci
- name: Run tests
run: python -m unittest
run: poetry run pytest

# type-check:
# runs-on: ubuntu-latest
#
# steps:
# - name: Clone repo
# uses: actions/checkout@v3
# - name: Set up Python
# uses: actions/setup-python@v4
# with:
# python-version: "3.13"
# - name: Install dependencies
# run: |
# pip install poetry
# poetry install --with=ci
# - name: Type checking
# run: poetry run mypy src test

docs:
runs-on: ubuntu-latest
Expand All @@ -41,15 +55,13 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v4
with:
# https://github.com/actions/setup-python#caching-packages-dependencies
cache: pip
python-version: "3.12"
python-version: "3.13"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install .[docs-builder]
pip install poetry
poetry install --with=ci
- name: Check docs build
run: |
cd docs
mkdir -p _static
make html
poetry run make html
90 changes: 9 additions & 81 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,92 +1,20 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so
__pycache__
*.pyc

# Distribution / packaging
.Python
env/
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
*.egg-info/
.installed.cfg
*.egg

# Part of the unit tests.
!/test/*.egg-info

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
build
dist
*.egg-info

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy
# dotenv
.env

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# dotenv
.env
# Tox
.tox

# virtualenv
venv/
ENV/

# Spyder project settings
.spyderproject

# Rope project settings
.ropeproject
18 changes: 14 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,21 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "latest"

python:
install:
- requirements: docs/requirements.txt
# Install the package, so that Sphinx can generate autodocs.
# https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
jobs:
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install --with=ci

sphinx:
configuration: docs/conf.py
24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

3 changes: 0 additions & 3 deletions MANIFEST.in

This file was deleted.

Loading

0 comments on commit bda4945

Please sign in to comment.