Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
PiotrMachowski committed Aug 16, 2023
0 parents commit 9c259c7
Show file tree
Hide file tree
Showing 17 changed files with 1,187 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
ko_fi: piotrmachowski
custom: ["buycoffee.to/piotrmachowski", "paypal.me/PiMachowski", "revolut.me/314ma"]
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: "weekly"
29 changes: 29 additions & 0 deletions .github/workflows/automerge.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
name: 'Automatically merge master -> dev'

on:
push:
branches:
- master

jobs:
build:
name: Automatically merge master to dev
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
name: Git checkout
with:
fetch-depth: 0
- name: Merge master -> dev
run: |
git config user.name "GitHub Actions"
git config user.email "PiotrMachowski@users.noreply.github.com"
if (git checkout dev)
then
git merge --ff-only master || git merge --no-commit master
git commit -m "Automatically merge master -> dev" || echo "No commit needed"
git push origin dev
else
echo "No dev branch"
fi
42 changes: 42 additions & 0 deletions .github/workflows/code_quality.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Code Quality

on:
pull_request:
branches:
- master
push:

jobs:
code_quality:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
strategy:
matrix:
include:
- id: black
name: Check code with black
- id: isort
name: Check code with isort
- id: pylint
name: Check code with pylint
- id: mypy
name: Check code with mypy
steps:
- name: Checkout the repository
uses: actions/checkout@v3

- name: Set up Python 3
uses: actions/setup-python@v4
id: python
with:
python-version: "3.11"

- name: Install workflow dependencies
run: |
pip install -r .github/workflows/requirements.txt
- name: Install Python dependencies
run: poetry install --no-interaction

- name: Run ${{ matrix.id }} checks
run: poetry run ${{ matrix.id }} src
38 changes: 38 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: "CodeQL"

on:
push:
branches: [master]
pull_request:
branches: [master]
schedule:
- cron: "21 5 * * 0"

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write

strategy:
fail-fast: false
matrix:
language: ["python"]

steps:
- name: Checkout repository
uses: actions/checkout@v3.5.3

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}

- name: Autobuild
uses: github/codeql-action/autobuild@v2

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
43 changes: 43 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Publish release

on:
release:
types: [published]

jobs:
build-and-publish-pypi:
name: Builds and publishes release to PyPI
runs-on: ubuntu-latest
outputs:
version: ${{ steps.vars.outputs.tag }}
steps:
- uses: actions/checkout@v3.5.3

- name: Set up Python 3.11
uses: actions/setup-python@v4.7.0
with:
python-version: "3.11"

- name: Install workflow dependencies
run: |
pip install -r .github/workflows/requirements.txt
- name: Install dependencies
run: poetry install --no-interaction

- name: Set package version
run: |
version="${{ github.event.release.tag_name }}"
version="${version,,}"
version="${version#v}"
poetry version --no-interaction "${version}"
- name: Build package
run: poetry build --no-interaction

- name: Publish to PyPi
env:
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}
run: |
poetry config pypi-token.pypi "${PYPI_TOKEN}"
poetry publish --no-interaction
2 changes: 2 additions & 0 deletions .github/workflows/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pip==23.2.1
poetry==1.5.1
160 changes: 160 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
# 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/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
Loading

0 comments on commit 9c259c7

Please sign in to comment.