Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.11", "3.12", "3.13"]

steps:
- uses: actions/checkout@v4
Expand Down
202 changes: 74 additions & 128 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,143 +1,89 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

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

# 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/
.nox/
__pypackages__/
.cache
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.dmypy.json
.DS_Store
.eggs/
.env
.hypothesis/
.idea/
.installed.cfg
.ipynb_checkpoints
.mypy_cache/
.nox/
.pdm-build/
.pdm-python
.pdm.toml
.pybuilder/
.pyre/
.pytest_cache/
cover/

# Translations
.Python
.python-version
.pytype/
.ropeproject
.scrapy
.spyderproject
.spyproject
.tox/
.venv
.vscode
.webassets-cache
*.bak
*.cover
*.egg
*.egg-info/
*.log
*.manifest
*.mo
*.orig
*.pot

# Django stuff:
*.log
local_settings.py
*.py,cover
*.py[cod]
*.sage.py
*.so
*.spec
*.sqlite3
**/.DS_Store
*~
*$py.class
/site
archive
build/
celerybeat-schedule
celerybeat.pid
cover/
coverage.xml
cython_debug/
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
develop-eggs/
dist/
dmypy.json
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# package/env management
.python-version
.env
.venv
downloads/
eggs/
env/
venv/
ENV/
*.bak
htmlcov/
instance/
ipython_config.py
lib/
lib64/
local_settings.py
MANIFEST
nosetests.xml
parts/
pdm.lock
pip-delete-this-directory.txt
pip-log.txt
Pipfile.lock
poetry.lock
pdm.lock
.pdm.toml
.pdm-python
.pdm-build/
profile_default/
sdist/
share/python-wheels/
target/
uv.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# IDEs
.idea/
.vscode

# misc
*.orig
archive
*~
**/.DS_Store
var/
venv/
wheels/
13 changes: 13 additions & 0 deletions .mailmap
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# I pick the account with the most modified files in git shortlog -sne
# This is used by Git to consolidate the users who used multiple accounts
Andreas Prlic <[email protected]> Andreas Prlic <[email protected]>
Andreas Prlic <[email protected]> Andreas Prlic <[email protected]>
Caitlin Gong <[email protected]> Caitlin Gong <[email protected]>
Katie Stahl <[email protected]> katie stahl <[email protected]>
Manuel Holtgrewe <[email protected]> Manuel Holtgrewe <[email protected]>
Meng <[email protected]> Meng Wang <[email protected]>
Reece Hart <[email protected]> Reece Hart <[email protected]>
Reece Hart <[email protected]> Reece Hart <[email protected]>
Reece Hart <[email protected]> Reece Hart <[email protected]>
Reece Hart <[email protected]> Reece Hart <[email protected]>
Rudy Rico <[email protected]> Rudolph Rico <[email protected]>
71 changes: 41 additions & 30 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ endif
SHELL:=zsh -eu -o pipefail -o null_glob
SELF:=$(firstword $(MAKEFILE_LIST))

VE_DIR=venv
VE_DIR:=.venv
PY_VERSION:=3.13

SRC_DIRS:=src
TEST_DIRS:=tests
DOC_TESTS:=src ./README.md
DOC_TESTS:=${SRC_DIRS} # ./README.md


############################################################################
Expand All @@ -40,22 +42,18 @@ devready:

#=> venv: make a Python 3 virtual environment
${VE_DIR}:
python3 --version
python3 -mvenv $@; \
source $@/bin/activate; \
python3 -m ensurepip --upgrade; \
pip install --upgrade pip setuptools wheel

uv venv --python ${PY_VERSION} $@

#=> develop: install package in develop mode
.PHONY: develop
develop:
pip install -e ".[dev,tests]"
uv sync --extra dev --extra tests
pre-commit install

#=> install: install package
.PHONY: install
install:
pip install "."
uv sync

#=> build: make sdist and wheel
.PHONY: build
Expand All @@ -72,42 +70,39 @@ build: %:
#=> test-docs: test example code in docs
.PHONY: test test-code test-docs
test:
pytest --cov src
test-docs:
pytest docs
pytest --cov ${SRC_DIRS}
test-code:
pytest src
pytest ${TEST_DIRS}
test-docs:
pytest ${DOC_TESTS}
stest:
pytest -vvv -s -k ${t}
test-%:
pytest -m '$*' src
pytest -m '$*' ${TEST_DIRS}

#=> tox -- run all tox tests
tox:
tox
uvx tox

#=> cqa: execute code quality tests
cqa:
ruff format --check
ruff check

#=> reformat: reformat code
.PHONY: reformat
reformat:
ruff check --fix
ruff format
uvx ruff format --check
uvx ruff check

############################################################################
#= UTILITY TARGETS

#=> rename: rename files and substitute content for new repo name
.PHONY: rename
rename:
./sbin/rename-package
#=> reformat: reformat code
.PHONY: reformat
reformat:
uvx ruff check --fix
uvx ruff format

#=> docs -- make sphinx docs
.PHONY: docs
docs: develop
# RTD makes json. Build here to ensure that it works.
make -C doc html json
make -C docs html json

############################################################################
#= CLEANUP
Expand All @@ -116,6 +111,8 @@ docs: develop
.PHONY: clean
clean:
rm -frv **/*~ **/*.bak
-make -C docs $@
-make -C examples $@

#=> cleaner: remove files and directories that are easily rebuilt
.PHONY: cleaner
Expand All @@ -126,17 +123,31 @@ cleaner: clean
rm -frv **/*.pyc
rm -frv **/*.orig
rm -frv **/*.rej
-make -C docs $@
-make -C examples $@

#=> cleanest: remove files and directories that require more time/network fetches to rebuild
#=> cleanest: remove files and directories that are more expensive to rebuild
.PHONY: cleanest
cleanest: cleaner
rm -frv .eggs .tox venv
-make -C docs $@
-make -C examples $@

#=> distclean: remove untracked files and other detritus
.PHONY: distclean
distclean: cleanest
git clean -df


############################################################################
#= Repo renamer

#=> rename: rename files and substitute content for new repo name
.PHONY: rename
rename:
./sbin/rename-package


## <LICENSE>
## Copyright 2023 Source Code Committers
##
Expand Down
Loading
Loading