Skip to content
Merged
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
21 changes: 3 additions & 18 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,28 +1,13 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = biocframe
# omit = bad_file.py

[paths]
source =
src/
*/site-packages/
source = src
omit = tests/*

[report]
# Regexes for lines to exclude from consideration
exclude_lines =
# Have to re-enable the standard pragma
pragma: no cover

# Don't complain about missing debug-only code:
def __repr__
if self\.debug

# Don't complain if tests don't hit defensive assertion code:
if self.debug:
raise AssertionError
raise NotImplementedError

# Don't complain if non-runnable code isn't run:
if 0:
if __name__ == .__main__.:
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"

- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
labels:
- "dependencies"
16 changes: 16 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pre-commit

on:
pull_request:
push:
branches: [main]

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: pre-commit/action@v3.0.1
Comment on lines +10 to +16
107 changes: 78 additions & 29 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,101 @@
name: Publish to PyPI
name: Publish to PyPI and GitHub Pages

on:
push:
tags: "*"

jobs:
build:
build-and-test:
name: Build and Test
runs-on: ubuntu-latest
permissions:
id-token: write
repository-projects: write
contents: write
pages: write

steps:
- uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: Install tox
run: uv tool install tox --with tox-uv

- name: Test with tox
run: |
tox
- name: Test
run: tox -e default

- name: Build Project and Publish
run: |
python -m tox -e clean,build
- name: Build Project
run: tox -e build

# This uses the trusted publisher workflow so no token is required.
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
- name: Store the distribution packages
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/

build-docs:
Comment on lines +9 to +39
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Install tox
run: uv tool install tox --with tox-uv

- name: Build docs
run: |
tox -e docs
run: tox -e docs

- name: Add .nojekyll
run: touch ./docs/_build/html/.nojekyll

- run: touch ./docs/_build/html/.nojekyll
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v3
with:
path: ./docs/_build/html

- name: GH Pages Deployment
uses: JamesIves/github-pages-deploy-action@v4
publish-pypi:
Comment on lines +40 to +69
name: Publish to PyPI
needs: build-and-test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/biocframe
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v4
with:
branch: gh-pages # The branch the action should deploy to.
folder: ./docs/_build/html
clean: true # Automatically remove deleted files from the deploy branch
name: python-package-distributions
path: dist/

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1

deploy-pages:
name: Deploy GitHub Pages
needs: build-docs
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
22 changes: 13 additions & 9 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,21 +38,25 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
id: setup-python
- name: Set up uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}

- name: Install tox
run: uv tool install tox --with tox-uv

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
run: uv sync --all-extras --python ${{ matrix.python }}

- name: Run tests
run: >-
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
tox
-- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml # pytest args
run: |
tox -e default -- --cov --cov-branch --cov-report=xml

- name: Check for codecov token availability
id: codecov-check
Expand Down
56 changes: 56 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,59 @@ MANIFEST
.venv*/
.conda*/
.python-version

# Byte-compiled / optimized / DLL files
__pycache__/
*$py.class
# C extensions
# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
# PyInstaller
*.manifest
*.spec
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.cache
nosetests.xml
*.cover
*.py,cover
.hypothesis/
cover/
# Sphinx documentation
docs/_build/
# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/
# mypy, ruff, etc
.mypy_cache/
.ruff_cache/
.pyre/
# Editors
.vscode/
.idea/
*.swp
*.swo
15 changes: 12 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,12 @@ repos:

- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.15.6
rev: v0.16.2
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
# Run the linter.
- id: ruff-check
args: [--fix, --exit-zero]
# Run the formatter.
- id: ruff-format

## If like to embrace black styles even in the docs:
Expand All @@ -51,3 +53,10 @@ repos:
# rev: v2.2.5
# hooks:
# - id: codespell

- repo: https://github.com/PyCQA/bandit
rev: 1.7.9
hooks:
- id: bandit
args: ["-c", "pyproject.toml"]
additional_dependencies: ["bandit[toml]"]
23 changes: 0 additions & 23 deletions .readthedocs.yml

This file was deleted.

4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 0.8.0

- Package migrated to hatch+uv using the `hatchit` package.

## Version 0.7.0 - 0.7.3

- Major update to type hints throughout the module for better type safety and consistency.
Expand Down
Loading
Loading