Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
janheinrichmerker committed Jul 3, 2024
0 parents commit d60c9e6
Show file tree
Hide file tree
Showing 9 changed files with 984 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: pip
directory: /
schedule:
interval: weekly
- package-ecosystem: github-actions
directory: /
schedule:
interval: monthly
16 changes: 16 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- octocat
categories:
- title: "🪲 Bug Fixes"
labels:
- bug
- title: "✨ New Features"
labels:
- enhancement
- title: "📄 Other Changes"
labels:
- "*"
190 changes: 190 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,190 @@
name: CI

on:
push:

jobs:
python-build:
name: "🏗️ Build Python wheels"
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "🧰 Install Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
run: pip install build twine
- name: "🏗️ Build Python wheels"
run: python -m build
- name: "🧪 Check package bundles"
run: twine check dist/*
- name: "📤 Upload Python wheels"
uses: actions/upload-artifact@v4
if: matrix.python == '3.11'
with:
name: wheels
path: dist
python-code-check:
name: 🔍 Check Python code
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- name: 📥 Check-out
uses: actions/checkout@v4
- name: 🧰 Install Python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: 🧰 Install dependencies
run: pip install .[tests]
- name: 🔍 Check Python code
run: ruff check .
python-typing:
name: "🔍 Check Python static typing"
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "🧰 Install Protoc"
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
run: pip install .[tests]
- name: "🔍 Check Python static typing"
run: mypy .
python-security:
name: "🔍 Check Python code security"
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "🧰 Install Protoc"
run: sudo apt install protobuf-compiler
- name: "🧰 Install Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
run: pip install .[tests]
- name: "🔍 Check Python code security"
run: bandit -c pyproject.toml -r .
python-test:
name: "🧪 Test Python code"
strategy:
matrix:
python:
- "3.8"
- "3.9"
- "3.10"
- "3.11"
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "🧰 Install Python"
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
cache: pip
cache-dependency-path: pyproject.toml
- name: "🧰 Install dependencies"
run: pip install .[tests]
- name: "🧪 Test Python code"
run: pytest --cov --cov-report=xml .
- name: "📤 Upload coverage to Codecov"
uses: codecov/codecov-action@v4
if: matrix.python == '3.11'
with:
token: ${{ secrets.CODECOV_TOKEN }}
python-publish:
name: "🚀 Publish Python wheels"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- python-build
- python-code-
- python-typing
- python-security
- python-test
runs-on: ubuntu-latest
permissions:
id-token: write
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "📥 Download Python wheels"
uses: actions/download-artifact@v4
with:
name: wheels
path: dist
- name: "🚀 Publish Python wheels"
uses: pypa/gh-action-pypi-publish@release/v1
github-release:
name: "🚀 Create GitHub release"
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
needs:
- python-build
- python-code-
- python-typing
- python-security
- python-test
- python-publish
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: "📥 Check-out"
uses: actions/checkout@v4
- name: "📥 Download Python wheels"
uses: actions/download-artifact@v4
with:
name: wheels
path: dist
- name: "🚀 Create GitHub release"
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
files: dist/*
fail_on_unmatched_files: true
draft: false
prerelease: false
generate_release_notes: true
167 changes: 167 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,intellij
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode,intellij

### Intellij ###
.idea
*.iml

### Python ###
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace

# Local History for Visual Studio Code
.history/

### VisualStudioCode Patch ###
# Ignore all local history of files
.history
.ionide

# Support for Project snippet scope
!.vscode/*.code-snippets

# End of https://www.toptal.com/developers/gitignore/api/python,visualstudiocode,intellij
Loading

0 comments on commit d60c9e6

Please sign in to comment.