Skip to content

Commit e14c429

Browse files
committed
BiocSetup configuration
1 parent 92dbedd commit e14c429

7 files changed

Lines changed: 208 additions & 16 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags: "*"
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
permissions:
11+
id-token: write
12+
repository-projects: write
13+
contents: write
14+
pages: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Set up Python 3.12
20+
uses: actions/setup-python@v5
21+
with:
22+
python-version: 3.12
23+
24+
- name: Install dependencies
25+
run: |
26+
python -m pip install --upgrade pip
27+
pip install tox
28+
29+
- name: Test with tox
30+
run: |
31+
tox
32+
33+
- name: Build Project and Publish
34+
run: |
35+
python -m tox -e clean,build
36+
37+
# This uses the trusted publisher workflow so no token is required.
38+
- name: Publish to PyPI
39+
uses: pypa/gh-action-pypi-publish@release/v1
40+
41+
- name: Build docs
42+
run: |
43+
tox -e docs
44+
45+
- run: touch ./docs/_build/html/.nojekyll
46+
47+
- name: GH Pages Deployment
48+
uses: JamesIves/github-pages-deploy-action@v4
49+
with:
50+
branch: gh-pages # The branch the action should deploy to.
51+
folder: ./docs/_build/html
52+
clean: true # Automatically remove deleted files from the deploy branch

.github/workflows/run-tests.yml

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Test the library
2+
3+
on:
4+
push:
5+
branches:
6+
- master # for legacy repos
7+
- main
8+
pull_request:
9+
branches:
10+
- master # for legacy repos
11+
- main
12+
workflow_dispatch: # Allow manually triggering the workflow
13+
schedule:
14+
# Run roughly every 15 days at 00:00 UTC
15+
# (useful to check if updates on dependencies break the package)
16+
- cron: "0 0 1,16 * *"
17+
18+
permissions:
19+
contents: read
20+
21+
concurrency:
22+
group: >-
23+
${{ github.workflow }}-${{ github.ref_type }}-
24+
${{ github.event.pull_request.number || github.sha }}
25+
cancel-in-progress: true
26+
27+
jobs:
28+
test:
29+
strategy:
30+
matrix:
31+
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
32+
platform:
33+
- ubuntu-latest
34+
- macos-latest
35+
- windows-latest
36+
runs-on: ${{ matrix.platform }}
37+
name: Python ${{ matrix.python }}, ${{ matrix.platform }}
38+
steps:
39+
- uses: actions/checkout@v4
40+
41+
- uses: actions/setup-python@v5
42+
id: setup-python
43+
with:
44+
python-version: ${{ matrix.python }}
45+
46+
- name: Install dependencies
47+
run: |
48+
python -m pip install --upgrade pip
49+
pip install tox coverage
50+
51+
- name: Run tests
52+
run: >-
53+
pipx run --python '${{ steps.setup-python.outputs.python-path }}'
54+
tox
55+
-- -rFEx --durations 10 --color yes --cov --cov-branch --cov-report=xml # pytest args
56+
57+
- name: Check for codecov token availability
58+
id: codecov-check
59+
shell: bash
60+
run: |
61+
if [ ${{ secrets.CODECOV_TOKEN }} != '' ]; then
62+
echo "codecov=true" >> $GITHUB_OUTPUT;
63+
else
64+
echo "codecov=false" >> $GITHUB_OUTPUT;
65+
fi
66+
67+
- name: Upload coverage reports to Codecov with GitHub Action
68+
uses: codecov/codecov-action@v5
69+
if: ${{ steps.codecov-check.outputs.codecov == 'true' }}
70+
env:
71+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
72+
slug: ${{ github.repository }}
73+
flags: ${{ matrix.platform }} - py${{ matrix.python }}

.pre-commit-config.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
exclude: '^docs/conf.py'
2+
3+
repos:
4+
- repo: https://github.com/pre-commit/pre-commit-hooks
5+
rev: v5.0.0
6+
hooks:
7+
- id: trailing-whitespace
8+
- id: check-added-large-files
9+
- id: check-ast
10+
- id: check-json
11+
- id: check-merge-conflict
12+
- id: check-xml
13+
- id: check-yaml
14+
- id: debug-statements
15+
- id: end-of-file-fixer
16+
- id: requirements-txt-fixer
17+
- id: mixed-line-ending
18+
args: ['--fix=auto'] # replace 'auto' with 'lf' to enforce Linux/Mac line endings or 'crlf' for Windows
19+
20+
- repo: https://github.com/astral-sh/ruff-pre-commit
21+
# Ruff version.
22+
rev: v0.8.2
23+
hooks:
24+
- id: ruff
25+
args: [--fix, --exit-non-zero-on-fix]
26+
- id: ruff-format
27+
28+
## Check for misspells in documentation files:
29+
# - repo: https://github.com/codespell-project/codespell
30+
# rev: v2.2.5
31+
# hooks:
32+
# - id: codespell

README.md

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
<!-- These are examples of badges you might want to add to your README:
2-
please update the URLs accordingly
3-
4-
[![Built Status](https://api.cirrus-ci.com/github/<USER>/experimenthub.svg?branch=main)](https://cirrus-ci.com/github/<USER>/experimenthub)
5-
[![ReadTheDocs](https://readthedocs.org/projects/experimenthub/badge/?version=latest)](https://experimenthub.readthedocs.io/en/stable/)
6-
[![Coveralls](https://img.shields.io/coveralls/github/<USER>/experimenthub/main.svg)](https://coveralls.io/r/<USER>/experimenthub)
71
[![PyPI-Server](https://img.shields.io/pypi/v/experimenthub.svg)](https://pypi.org/project/experimenthub/)
8-
[![Conda-Forge](https://img.shields.io/conda/vn/conda-forge/experimenthub.svg)](https://anaconda.org/conda-forge/experimenthub)
9-
[![Monthly Downloads](https://pepy.tech/badge/experimenthub/month)](https://pepy.tech/project/experimenthub)
10-
[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Twitter)](https://twitter.com/experimenthub)
11-
-->
12-
13-
[![Project generated with PyScaffold](https://img.shields.io/badge/-PyScaffold-005CA0?logo=pyscaffold)](https://pyscaffold.org/)
2+
![Unit tests](https://github.com/YOUR_ORG_OR_USERNAME/experimenthub/actions/workflows/run-tests.yml/badge.svg)
143

154
# experimenthub
165

176
> Access Bioconductor's experimenthub resources
187
198
A longer description of your project goes here...
209

10+
## Install
11+
12+
To get started, install the package from [PyPI](https://pypi.org/project/experimenthub/)
13+
14+
```bash
15+
pip install experimenthub
16+
```
2117

22-
<!-- pyscaffold-notes -->
18+
<!-- biocsetup-notes -->
2319

2420
## Note
2521

26-
This project has been set up using PyScaffold 4.6. For details and usage
27-
information on PyScaffold see https://pyscaffold.org/.
22+
This project has been set up using [BiocSetup](https://github.com/biocpy/biocsetup)
23+
and [PyScaffold](https://pyscaffold.org/).

docs/conf.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,4 +301,24 @@
301301
"pyscaffold": ("https://pyscaffold.org/en/stable", None),
302302
}
303303

304-
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
304+
print(f"loading configurations for {project} {version} ...", file=sys.stderr)
305+
306+
# -- Biocsetup configuration -------------------------------------------------
307+
308+
# Enable execution of code chunks in markdown
309+
extensions.remove('myst_parser')
310+
extensions.append('myst_nb')
311+
312+
# Less verbose api documentation
313+
extensions.append('sphinx_autodoc_typehints')
314+
315+
autodoc_default_options = {
316+
"special-members": True,
317+
"undoc-members": True,
318+
"exclude-members": "__weakref__, __dict__, __str__, __module__",
319+
}
320+
321+
autosummary_generate = True
322+
autosummary_imported_members = True
323+
324+
html_theme = "furo"

docs/requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,6 @@
44
# sphinx_rtd_theme
55
myst-parser[linkify]
66
sphinx>=3.2.1
7+
myst-nb
8+
furo
9+
sphinx-autodoc-typehints

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,19 @@ build-backend = "setuptools.build_meta"
77
# For smarter version schemes and other configuration options,
88
# check out https://github.com/pypa/setuptools_scm
99
version_scheme = "no-guess-dev"
10+
11+
[tool.ruff]
12+
line-length = 120
13+
src = ["src"]
14+
exclude = ["tests"]
15+
lint.extend-ignore = ["F821"]
16+
17+
[tool.ruff.lint.pydocstyle]
18+
convention = "google"
19+
20+
[tool.ruff.format]
21+
docstring-code-format = true
22+
docstring-code-line-length = 20
23+
24+
[tool.ruff.lint.per-file-ignores]
25+
"__init__.py" = ["E402", "F401"]

0 commit comments

Comments
 (0)