-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit f4ec797
Showing
20 changed files
with
768 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
POETRY_VERSION=1.7.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
version: 2 | ||
updates: | ||
|
||
- package-ecosystem: github-actions | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: '00:00' | ||
timezone: UTC | ||
open-pull-requests-limit: 10 | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
labels: | ||
- "dependabot" | ||
- "dependencies" | ||
|
||
- package-ecosystem: pip | ||
directory: "/" | ||
schedule: | ||
interval: daily | ||
time: '00:00' | ||
timezone: UTC | ||
open-pull-requests-limit: 10 | ||
commit-message: | ||
prefix: "chore" | ||
include: "scope" | ||
labels: | ||
- "dependabot" | ||
- "dependencies" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name: Changelog Verifier | ||
|
||
on: | ||
pull_request: | ||
types: [opened, edited, review_requested, synchronize, reopened, ready_for_review, labeled, unlabeled] | ||
|
||
jobs: | ||
# Enforces the update of a changelog file on every pull request | ||
verify-changelog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dangoslen/changelog-enforcer@v3 | ||
with: | ||
skipLabels: "autocut, skip-changelog" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Checks | ||
|
||
on: | ||
push: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-20.04, windows-latest, macos-latest] | ||
python-version: ["3.10", "3.11", "3.12"] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: extractions/setup-just@v1 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Run tests | ||
run: just test | ||
|
||
lint: | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: extractions/setup-just@v1 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Run lint | ||
run: just lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Dependabot PR actions | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize, reopened, labeled, unlabeled] | ||
|
||
jobs: | ||
dependabot: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
contents: write | ||
|
||
if: ${{ github.actor == 'dependabot[bot]' }} | ||
steps: | ||
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Update the changelog | ||
uses: dangoslen/dependabot-changelog-helper@v3 | ||
with: | ||
version: 'Unreleased' | ||
|
||
- name: Commit the changes | ||
uses: stefanzweifel/git-auto-commit-action@v5 | ||
with: | ||
commit_message: "chore(changelog): automatic update to add dependabot deps bump" | ||
branch: ${{ github.head_ref }} | ||
commit_user_name: dependabot[bot] | ||
commit_user_email: [email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Link Checker | ||
|
||
on: | ||
push: | ||
|
||
jobs: | ||
linkchecker: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: lychee Link Checker | ||
id: lychee | ||
uses: lycheeverse/lychee-action@v1 | ||
with: | ||
args: --accept=200,403,429 "**/*.html" "**/*.md" "**/*.txt" "**/*.json" --exclude "file:///github/workspace/*" --exclude-path "tests/" --exclude-mail | ||
fail: true | ||
env: | ||
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: Lint PR Title | ||
|
||
on: | ||
pull_request_target: | ||
types: | ||
- opened | ||
- edited | ||
- synchronize | ||
|
||
permissions: | ||
pull-requests: read | ||
|
||
jobs: | ||
main: | ||
name: Validate PR title | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: amannn/action-semantic-pull-request@v5 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
scopes: | | ||
playbook | ||
scripts | ||
tasks | ||
dependabot | ||
workflows | ||
publish | ||
readme | ||
changelog | ||
deps | ||
requireScope: false | ||
validateSingleCommit: true | ||
validateSingleCommitMatchesPrTitle: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: Publish | ||
|
||
on: push | ||
|
||
jobs: | ||
build: | ||
name: Build distribution 📦 | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.x" | ||
- name: Install pypa/build | ||
run: >- | ||
python3 -m | ||
pip install | ||
build | ||
--user | ||
- name: Build a binary wheel and a source tarball | ||
run: python3 -m build | ||
- name: Store the distribution packages | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
|
||
publish-to-pypi: | ||
name: >- | ||
Publish Python 🐍 distribution 📦 to PyPI | ||
if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes | ||
needs: | ||
- build | ||
runs-on: ubuntu-latest | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/magic_combo | ||
permissions: | ||
id-token: write # IMPORTANT: mandatory for trusted publishing | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
github-release: | ||
name: >- | ||
Sign the Python 🐍 distribution 📦 with Sigstore | ||
and upload them to GitHub Release | ||
needs: | ||
- publish-to-pypi | ||
runs-on: ubuntu-latest | ||
|
||
permissions: | ||
contents: write # IMPORTANT: mandatory for making GitHub Releases | ||
id-token: write # IMPORTANT: mandatory for sigstore | ||
|
||
steps: | ||
- name: Download all the dists | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: python-package-distributions | ||
path: dist/ | ||
- name: Sign the dists with Sigstore | ||
uses: sigstore/[email protected] | ||
with: | ||
inputs: >- | ||
./dist/*.tar.gz | ||
./dist/*.whl | ||
- name: Upload artifact signatures to GitHub Release | ||
env: | ||
GITHUB_TOKEN: ${{ github.token }} | ||
# Upload to GitHub Release using the `gh` CLI. | ||
# `dist/` contains the built packages, and the | ||
# sigstore-produced signatures and certificates. | ||
run: >- | ||
gh release create | ||
'${{ github.ref_name }}' dist/** | ||
--title 'v${{ github.ref_name }}' | ||
--generate-notes | ||
--repo '${{ github.repository }}' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
|
||
# User-specific stuff | ||
.idea/ | ||
.vscode/ | ||
|
||
# Python-specific ignores | ||
venv/ | ||
*.pyc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: fix-byte-order-marker # Prevents weird UTF-8 encoding edge cases | ||
- id: check-case-conflict # Check if case-insensitive filesystems would bork | ||
- id: check-docstring-first # Check for if docstring was misplaced | ||
- id: check-executables-have-shebangs | ||
- id: check-json # Checks for valid json | ||
- id: check-merge-conflict # Checks strings that look like a committed merge conflict | ||
- id: check-xml # Checks for valid xml | ||
- id: check-yaml # Checks for valid yaml | ||
- id: end-of-file-fixer # Checks for ending with a newline | ||
- id: mixed-line-ending # Consistent LF or CRLF | ||
- id: trailing-whitespace # No trailing whitespace | ||
- repo: https://github.com/codespell-project/codespell | ||
rev: v2.2.5 | ||
hooks: | ||
- id: codespell | ||
args: ["--toml", "pyproject.toml"] | ||
additional_dependencies: | ||
- tomli | ||
- repo: https://github.com/psf/black | ||
rev: 23.9.1 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/isort | ||
rev: 5.12.0 | ||
hooks: | ||
- id: isort | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: 1.7.5 | ||
hooks: | ||
- id: bandit | ||
args: ["--configfile", "pyproject.toml"] | ||
additional_dependencies: | ||
- bandit[toml] | ||
#- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# rev: v0.0.282 | ||
# hooks: | ||
# - id: ruff | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.4.1 | ||
hooks: | ||
- id: mypy | ||
args: ["--config-file", "pyproject.toml"] | ||
additional_dependencies: | ||
- tomli | ||
exclude: tests | ||
- repo: local | ||
hooks: | ||
- id: lower-case-only | ||
name: lower case only | ||
entry: filenames must be lower-case or lower_case only | ||
language: fail | ||
files: '[^a-z0-9._/-]' | ||
exclude: | | ||
(?x)^( | ||
CHANGELOG.md| | ||
CONTRIBUTING.md| | ||
CREDITS.md| | ||
LICENSE.md| | ||
README.md| | ||
Justfile | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# CHANGELOG | ||
Inspired from [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) | ||
|
||
## [Unreleased] | ||
### Added | ||
### Changed | ||
### Deprecated | ||
### Removed | ||
### Fixed | ||
### Security | ||
### Dependencies |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env -S just --justfile | ||
|
||
set dotenv-load := true | ||
|
||
export PIP_REQUIRE_VIRTUALENV := "true" | ||
|
||
# === Variables === | ||
|
||
# Poetry variables | ||
poetry_version := env_var('POETRY_VERSION') | ||
|
||
# === Commands === | ||
|
||
# Display all commands | ||
@default: | ||
echo "OS: {{ os() }} - ARCH: {{ arch() }}\n" | ||
just --list | ||
|
||
# Install poetry | ||
@install-poetry: | ||
if [ -z $(command -v poetry) ]; then curl -sSL https://install.python-poetry.org | python3 - --version {{ poetry_version }}; fi | ||
|
||
# Install the package | ||
install: install-poetry | ||
poetry install | ||
|
||
# Run formatters | ||
fmt: install | ||
poetry run pre-commit run -a | ||
|
||
# Run tests | ||
test *FILES: install | ||
poetry run pytest {{ FILES }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
Copyright © 2023-present Florian Vazelle | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
Oops, something went wrong.