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
4 changes: 2 additions & 2 deletions .coveragerc
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
# .coveragerc to control coverage.py
[run]
branch = True
source = biocutils
# omit = bad_file.py
source = src
omit = tests/*

[paths]
source =
Expand Down
15 changes: 15 additions & 0 deletions .github/dependabot.yml
Original file line numberDiff line numberDiff 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 numberDiff line numberDiff 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@v7
- uses: actions/setup-python@v5
with:
python-version: '3.12'
- uses: pre-commit/action@v3.0.1
Comment on lines +10 to +16
99 changes: 69 additions & 30 deletions .github/workflows/publish-pypi.yml
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,91 @@
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
- uses: actions/checkout@v7

- 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: python -m pip install tox

- 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 +34
name: Build Documentation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7

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

- name: Install tox
run: python -m pip install tox

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

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

- name: GH Pages Deployment
uses: JamesIves/github-pages-deploy-action@v4
- name: Upload Pages artifact
uses: actions/upload-pages-artifact@v5
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
path: ./docs/_build/html

publish-pypi:
Comment on lines +35 to +59
name: Publish to PyPI
needs: build-and-test
runs-on: ubuntu-latest
environment:
name: pypi
url: https://pypi.org/p/biocutils
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v8
with:
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@v5
19 changes: 8 additions & 11 deletions .github/workflows/run-tests.yml
Original file line numberDiff line numberDiff line change
Expand Up@@ -36,21 +36,18 @@
runs-on: ${{ matrix.platform }}
name: Python ${{ matrix.python }}, ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v7

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

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox coverage
- name: Install tox
run: python -m pip install tox coverage

- 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

Expand All@@ -65,9 +62,9 @@
fi

- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v5
uses: codecov/codecov-action@v7
if: ${{ steps.codecov-check.outputs.codecov == 'true' }}
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
token: ${{ secrets.CODECOV_TOKEN }}
slug: ${{ github.repository }}
flags: ${{ matrix.platform }} - py${{ matrix.python }}
56 changes: 56 additions & 0 deletions .gitignore
Original file line numberDiff line numberDiff line change
Expand Up@@ -53,3 +53,59 @@ docs/html
.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 numberDiff line numberDiff 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]"]
27 changes: 0 additions & 27 deletions .readthedocs.yml

This file was deleted.

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

## Version 0.5.0

- Migate the package to `hatch`.

## Version 0.4.0 - 0.4.2

- Implemented R's `split()` utility to split a sequence by a grouping factor.
Expand Down
Loading
Loading