Skip to content

Commit

Permalink
Feat: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanofusai committed Sep 30, 2024
0 parents commit e85bda9
Show file tree
Hide file tree
Showing 17 changed files with 617 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: /
schedule:
interval: daily
target-branch: main
- package-ecosystem: pip
directory: /
schedule:
interval: daily
target-branch: main
61 changes: 61 additions & 0 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: CI/CD Pipeline
on:
push:
pull_request:
release:
types:
- published
permissions:
contents: read
jobs:
run-tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- 3.12
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Set up uv
uses: astral-sh/setup-uv@v3
with:
version: 0.4.7
enable-cache: true
cache-dependency-glob: .requirements/testing.txt
- name: Install requirements
run: uv pip install -r .requirements/testing.txt
env:
UV_SYSTEM_PYTHON: 1
- name: Run tests
run: pytest
publish-to-pypi:
if: github.event_name == 'release' && github.event.action == 'published'
needs: run-tests
runs-on: ubuntu-latest
environment: release
permissions:
id-token: write
strategy:
matrix:
python-version:
- 3.12
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@release/v1.8
153 changes: 153 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# 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

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__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/
92 changes: 92 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
ci:
skip:
- pip-compile
default_language_version:
python: python3.12
repos:
# Generic file checks and fixes
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: end-of-file-fixer
- id: file-contents-sorter
files: ^\.requirements/base\.in$
- id: file-contents-sorter
files: ^\.requirements/development\.in$
- id: file-contents-sorter
files: ^\.requirements/testing\.in$
- id: name-tests-test
exclude: ^tests/conftest\.py$
# Specific checks and fixes for different file types
- repo: https://github.com/markdownlint/markdownlint
rev: 41fc308f0d7f2647f0ae2c2d3826f48e42d964f4
hooks:
- id: markdownlint
args:
- -r
- ~MD013
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: check-toml
- repo: https://github.com/adrienverge/yamllint
rev: f0c0c7586b97809289bdcfe83a66363330b645d8
hooks:
- id: yamllint
args:
- -d
- "{extends: default, rules: {comments: {min-spaces-from-content: 1}, document-start: {present: false}, line-length: disable}}"
- repo: https://github.com/google/yamlfmt
rev: v0.13.0
hooks:
- id: yamlfmt
args:
- -formatter
- eof_newline=true
# Specific checks and fixes for Python files
- repo: https://github.com/asottile/pyupgrade
rev: v3.17.0
hooks:
- id: pyupgrade
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.6.5
hooks:
- id: ruff
args:
- --fix
- id: ruff-format
# Specific checks and fixes for Git
- repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
args:
- -c
- title-match-regex.regex=^(Build|Bump|Chore|Ci|Docs|Feat|Fix|Perf|Refactor|Revert|Style|Test):\s[a-z].*$
- --ignore=B6
- --msg-filename
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.6.0
hooks:
- id: no-commit-to-branch
args:
- --branch
- main
# Dependency management
- repo: https://github.com/astral-sh/uv-pre-commit
rev: 0.4.10
hooks:
- id: pip-compile
files: ^\.requirements\/(base|development)\.(in|txt)$
args:
- .requirements/base.in
- .requirements/development.in
- -o
- .requirements/development.txt
- id: pip-compile
files: ^\.requirements\/(base|testing)\.(in|txt)$
args:
- .requirements/base.in
- .requirements/testing.in
- -o
- .requirements/testing.txt
4 changes: 4 additions & 0 deletions .requirements/base.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pydantic
pytest
pytest-mock
pyyaml
2 changes: 2 additions & 0 deletions .requirements/development.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pre-commit
ruff
46 changes: 46 additions & 0 deletions .requirements/development.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# This file was autogenerated by uv via the following command:
# uv pip compile .requirements/base.in .requirements/development.in -o .requirements/development.txt
annotated-types==0.7.0
# via pydantic
cfgv==3.4.0
# via pre-commit
distlib==0.3.8
# via virtualenv
filelock==3.16.1
# via virtualenv
identify==2.6.1
# via pre-commit
iniconfig==2.0.0
# via pytest
nodeenv==1.9.1
# via pre-commit
packaging==24.1
# via pytest
platformdirs==4.3.6
# via virtualenv
pluggy==1.5.0
# via pytest
pre-commit==3.8.0
# via -r .requirements/development.in
pydantic==2.9.2
# via -r .requirements/base.in
pydantic-core==2.23.4
# via pydantic
pytest==8.3.3
# via
# -r .requirements/base.in
# pytest-mock
pytest-mock==3.14.0
# via -r .requirements/base.in
pyyaml==6.0.2
# via
# -r .requirements/base.in
# pre-commit
ruff==0.6.8
# via -r .requirements/development.in
typing-extensions==4.12.2
# via
# pydantic
# pydantic-core
virtualenv==20.26.6
# via pre-commit
2 changes: 2 additions & 0 deletions .requirements/testing.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pytest-cov
pytest-xdist
Loading

0 comments on commit e85bda9

Please sign in to comment.