Skip to content

Commit 93b75c7

Browse files
committed
BiocSetup configuration
1 parent a252dc2 commit 93b75c7

File tree

7 files changed

+168
-16
lines changed

7 files changed

+168
-16
lines changed

.github/workflows/publish-pypi.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# This workflow will install Python dependencies, run tests and lint with a single version of Python
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
3+
4+
name: Publish to PyPI
5+
6+
on:
7+
push:
8+
tags: "*"
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- name: Set up Python 3.11
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: 3.11
21+
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox
26+
27+
- name: Test with tox
28+
run: |
29+
tox
30+
31+
- name: Build docs
32+
run: |
33+
tox -e docs
34+
35+
- run: touch ./docs/_build/html/.nojekyll
36+
37+
- name: GH Pages Deployment
38+
uses: JamesIves/github-pages-deploy-action@v4
39+
with:
40+
branch: gh-pages # The branch the action should deploy to.
41+
folder: ./docs/_build/html
42+
clean: true # Automatically remove deleted files from the deploy branch
43+
44+
- name: Build Project and Publish
45+
run: |
46+
python -m tox -e clean,build
47+
48+
- name: Publish package
49+
uses: pypa/[email protected]
50+
with:
51+
user: __token__
52+
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/run-tests.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Run tests
2+
3+
on:
4+
push:
5+
branches: [master]
6+
pull_request:
7+
branches: [master]
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
15+
16+
name: Python ${{ matrix.python-version }}
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
cache: "pip"
25+
26+
- name: Install dependencies
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install tox
30+
31+
- name: Test with tox
32+
run: |
33+
tox

.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>/scruncher.svg?branch=main)](https://cirrus-ci.com/github/<USER>/scruncher)
5-
[![ReadTheDocs](https://readthedocs.org/projects/scruncher/badge/?version=latest)](https://scruncher.readthedocs.io/en/stable/)
6-
[![Coveralls](https://img.shields.io/coveralls/github/<USER>/scruncher/main.svg)](https://coveralls.io/r/<USER>/scruncher)
71
[![PyPI-Server](https://img.shields.io/pypi/v/scruncher.svg)](https://pypi.org/project/scruncher/)
8-
[![Conda-Forge](https://img.shields.io/conda/vn/conda-forge/scruncher.svg)](https://anaconda.org/conda-forge/scruncher)
9-
[![Monthly Downloads](https://pepy.tech/badge/scruncher/month)](https://pepy.tech/project/scruncher)
10-
[![Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Twitter)](https://twitter.com/scruncher)
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/BiocPy/scruncher/actions/workflows/pypi-test.yml/badge.svg)
143

154
# scruncher
165

176
> Add a short description here!
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/scruncher/)
13+
14+
```bash
15+
pip install scruncher
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+
extend-ignore = ["F821"]
16+
17+
[tool.ruff.pydocstyle]
18+
convention = "google"
19+
20+
[tool.ruff.format]
21+
docstring-code-format = true
22+
docstring-code-line-length = 20
23+
24+
[tool.ruff.per-file-ignores]
25+
"__init__.py" = ["E402", "F401"]

0 commit comments

Comments
 (0)