Skip to content

Commit d4db057

Browse files
authored
Merge branch 'main' into main
2 parents a22dea7 + 36b04a5 commit d4db057

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2566
-1054
lines changed

.github/workflows/ci.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
jobs:
10+
test:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
fail-fast: true
14+
matrix:
15+
os: [ubuntu-latest, macos-latest]
16+
python-version: ["3.10", "3.11", "3.12", "3.13"]
17+
18+
steps:
19+
- uses: actions/checkout@v4
20+
21+
- name: Set up Python
22+
uses: actions/setup-python@v5
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
26+
- name: Cache pip
27+
uses: actions/cache@v4
28+
with:
29+
path: ~/.cache/pip
30+
key: ${{ runner.os }}-pip-${{ hashFiles('**/*requirements*.txt') }}
31+
restore-keys: |
32+
${{ runner.os }}-pip-
33+
34+
- name: Install dependencies
35+
run: |
36+
pip install --upgrade pip
37+
pip install -r requirements-dev.txt
38+
39+
- name: Run tests
40+
run: |
41+
pytest
42+
43+
# Run pre-commit only on Python 3.13 + ubuntu.
44+
- name: Run pre-commit hooks
45+
if: ${{ matrix.python-version == '3.13' && matrix.os == 'ubuntu-latest' }}
46+
run: |
47+
pre-commit run --all-files

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
release:
5+
types: [created] # Trigger only when a release is created
6+
workflow_dispatch: # Allows manual triggering of the workflow
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
# Step 1: Check out the code
14+
- name: Checkout code
15+
uses: actions/checkout@v4
16+
17+
# Step 2: Set up Python
18+
- name: Set up Python
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: 3.13
22+
23+
# Step 3: Install dependencies for building and publishing
24+
- name: Install build tools
25+
run: |
26+
pip install --upgrade pip
27+
pip install build twine
28+
29+
# Step 4: Build the package
30+
- name: Build the package
31+
run: |
32+
python -m build
33+
34+
# Step 5: Publish to PyPI
35+
- name: Publish to PyPI
36+
env:
37+
TWINE_USERNAME: __token__
38+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
39+
run: |
40+
python -m twine check dist/*
41+
python -m twine upload --skip-existing dist/*

.github/workflows/unitest.yml

Lines changed: 0 additions & 33 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ venv/
131131
ENV/
132132
env.bak/
133133
venv.bak/
134+
.python-version
134135

135136
# Spyder project settings
136137
.spyderproject

.pre-commit-config.yaml

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v5.0.0
4+
hooks:
5+
# Files
6+
- id: check-added-large-files
7+
description: "Prevent large files from being committed."
8+
args: ["--maxkb=10000"]
9+
- id: check-case-conflict
10+
description: "Check for files that would conflict in case-insensitive filesystems."
11+
- id: fix-byte-order-marker
12+
description: "Remove utf-8 byte order marker."
13+
- id: mixed-line-ending
14+
description: "Replace mixed line ending."
15+
16+
# Links
17+
- id: destroyed-symlinks
18+
description: "Detect symlinks which are changed to regular files with a content of a path which that symlink was pointing to."
19+
20+
# File files for parseable syntax: python
21+
- id: check-ast
22+
23+
# File and line endings
24+
- id: end-of-file-fixer
25+
description: "Ensure that a file is either empty, or ends with one newline."
26+
- id: trailing-whitespace
27+
description: "Trim trailing whitespace."
28+
29+
# Python
30+
- id: check-docstring-first
31+
description: "Check a common error of defining a docstring after code."
32+
- id: requirements-txt-fixer
33+
description: "Sort entries in requirements.txt."
34+
35+
- repo: https://github.com/MarcoGorelli/absolufy-imports
36+
rev: v0.3.1
37+
hooks:
38+
- id: absolufy-imports
39+
description: "Automatically convert relative imports to absolute. (Use `args: [--never]` to revert.)"
40+
41+
- repo: https://github.com/psf/black
42+
rev: 24.10.0
43+
hooks:
44+
- id: black
45+
46+
- repo: https://github.com/asottile/pyupgrade
47+
rev: v3.19.1
48+
hooks:
49+
- id: pyupgrade
50+
description: "Automatically upgrade syntax for newer versions."
51+
args: [--py3-plus, --py36-plus, --py38-plus, --py39-plus, --py310-plus]
52+
53+
- repo: https://github.com/pre-commit/pygrep-hooks
54+
rev: v1.10.0
55+
hooks:
56+
- id: python-check-blanket-noqa
57+
description: "Enforce that `noqa` annotations always occur with specific codes. Sample annotations: `# noqa: F401`, `# noqa: F401,W203`."
58+
- id: python-check-blanket-type-ignore
59+
description: "Enforce that `# type: ignore` annotations always occur with specific codes. Sample annotations: `# type: ignore[attr-defined]`, `# type: ignore[attr-defined, name-defined]`."
60+
- id: python-use-type-annotations
61+
description: "Enforce that python3.6+ type annotations are used instead of type comments."
62+
63+
- repo: https://github.com/PyCQA/isort
64+
rev: 5.13.2
65+
hooks:
66+
- id: isort
67+
description: "Sort imports alphabetically, and automatically separated into sections and by type."
68+
69+
- repo: https://github.com/hadialqattan/pycln
70+
rev: v2.4.0
71+
hooks:
72+
- id: pycln
73+
description: "Remove unused import statements."
74+
75+
- repo: https://github.com/djlint/djLint
76+
rev: v1.36.4
77+
hooks:
78+
- id: djlint-reformat-jinja
79+
80+
- repo: https://github.com/igorshubovych/markdownlint-cli
81+
rev: v0.43.0
82+
hooks:
83+
- id: markdownlint
84+
description: "Lint markdown files."
85+
args: ["--disable=line-length"]

CODE_OF_CONDUCT.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ representative at an online or offline event.
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
6262
reported to the community leaders responsible for enforcement at
63-
romain@coderamp.io.
63+
<romain@coderamp.io>.
6464
All complaints will be reviewed and investigated promptly and fairly.
6565

6666
All community leaders are obligated to respect the privacy and security of the
@@ -114,15 +114,13 @@ the community.
114114

115115
## Attribution
116116

117-
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
118118
version 2.0, available at
119-
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
119+
<https://www.contributor-covenant.org/version/2/0/code_of_conduct.html>.
120120

121121
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122122
enforcement ladder](https://github.com/mozilla/diversity).
123123

124-
[homepage]: https://www.contributor-covenant.org
125-
126124
For answers to common questions about this code of conduct, see the FAQ at
127-
https://www.contributor-covenant.org/faq. Translations are available at
128-
https://www.contributor-covenant.org/translations.
125+
<https://www.contributor-covenant.org/faq>. Translations are available at
126+
<https://www.contributor-covenant.org/translations>.

0 commit comments

Comments
 (0)