Skip to content

Commit cadaa88

Browse files
authored
First steps (#1)
* stub repo * copy over scripts and tweak; install deps * dev configuration: tests pass * CI
1 parent 699ebe6 commit cadaa88

23 files changed

Lines changed: 594 additions & 2 deletions

.coveragerc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[run]
2+
# All files under source are checked, even if not otherwise referenced.
3+
source = .
4+
5+
# More strict: Check transitions between lines, not just individual lines.
6+
branch = True
7+
8+
[report]
9+
show_missing = True
10+
skip_covered = True
11+
fail_under = 100

.flake8

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
exclude = .git,.venv,.venv-*,__pycache__
3+
4+
# Config recommended by black:
5+
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#bugbear
6+
max-line-length = 80
7+
extend-select = B950
8+
extend-ignore = E203,E501,E701
9+
10+
per-file-ignores =
11+
# Ignore undefined names in templates.
12+
**/no-tests/*.py:F821,F401,E302

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Bug
3+
about: Something is broken.
4+
type: 'Bug'
5+
6+
---
7+
8+
Please provide relevant environment details, a minimal reproducer for the bug, and the expected behavior.

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: Feature
3+
about: Something is missing.
4+
type: 'Feature'
5+
6+
---
7+
8+
Besides simply describing a new feature, it may help to include who would use this feature, and what problem they're trying to solve.

.github/ISSUE_TEMPLATE/question.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
name: Question
3+
about: Something is unclear.
4+
type: 'Task'
5+
6+
---

.github/workflows/test.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-22.04
12+
strategy:
13+
matrix:
14+
python-version:
15+
- '3.10'
16+
- '3.13'
17+
requirements-file:
18+
- 'requirements-dev.txt' # pinned, for predictability
19+
- 'requirements-dev.in' # un-pinned, so we catch problems early
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python ${{ matrix.python-version }}
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: ${{ matrix.python-version }}
29+
30+
- name: Install flit
31+
run: pip install flit
32+
33+
- name: Install package
34+
run: flit install
35+
36+
- name: Install dev dependencies
37+
run: pip install -r ${{ matrix.requirements-file }}
38+
39+
- name: Test
40+
run: scripts/ci.sh

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# MacOS
2+
.DS_Store
3+
14
# Byte-compiled / optimized / DLL files
25
__pycache__/
36
*.py[codz]
@@ -182,9 +185,9 @@ cython_debug/
182185
.abstra/
183186

184187
# Visual Studio Code
185-
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
188+
# Visual Studio Code specific template is maintained in a separate VisualStudioCode.gitignore
186189
# that can be found at https://github.com/github/gitignore/blob/main/Global/VisualStudioCode.gitignore
187-
# and can be added to the global gitignore or merged into this file. However, if you prefer,
190+
# and can be added to the global gitignore or merged into this file. However, if you prefer,
188191
# you could uncomment the following to ignore the entire vscode folder
189192
# .vscode/
190193

.pre-commit-config.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v2.3.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
# Using this mirror lets us use mypyc-compiled black, which is about 2x faster
9+
- repo: https://github.com/psf/black-pre-commit-mirror
10+
rev: 24.8.0
11+
hooks:
12+
- id: black
13+
# It is recommended to specify the latest version of Python
14+
# supported by your project here, or alternatively use
15+
# pre-commit's default_language_version, see
16+
# https://pre-commit.com/#top_level-default_language_version
17+
language_version: python3.11
18+
- repo: https://github.com/pycqa/isort
19+
rev: 6.0.1
20+
hooks:
21+
- id: isort
22+
name: isort (python)

.pytest.ini

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[pytest]
2+
3+
filterwarnings =
4+
# Treat warnings as errors,
5+
error
6+
7+
addopts = --doctest-glob '*.md' --doctest-modules
8+
9+
# If an xfail starts passing unexpectedly, that should count as a failure:
10+
xfail_strict=true

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# CHANGELOG

0 commit comments

Comments
 (0)