-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: poetry and python ci actions added.
feat: pre-commit added fix: pre-commit file changes made Signed-off-by: Onuralp SEZER <thunderbirdtr@fedoraproject.org>
- Loading branch information
1 parent
796344d
commit b5b0701
Showing
10 changed files
with
1,339 additions
and
15 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,53 @@ | ||
# Python version list : https://github.com/actions/python-versions/blob/main/versions-manifest.json | ||
# | ||
name: Python-CI | ||
on: [push, pull_request, workflow_dispatch] | ||
jobs: | ||
ci: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
python-version: ["3.8", "3.9", "3.10","3.11.1"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v2.6.0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v1 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Build the docker-compose stack | ||
run: docker-compose -f docker-compose.yml up -d | ||
|
||
- name: Check running containers | ||
run: docker ps -a | ||
|
||
|
||
- name: Set up a virtual environment for Python ${{ matrix.python-version }} | ||
run: | | ||
python -m pip install --upgrade virtualenv | ||
virtualenv venv | ||
source venv/bin/activate | ||
which python | ||
- name: Install the base dependencies | ||
run: | | ||
source venv/bin/activate | ||
python -m pip install --upgrade poetry | ||
- name: Check the correctness of the project config | ||
run: | | ||
source venv/bin/activate | ||
poetry check | ||
- name: Install the packages | ||
run: | | ||
source venv/bin/activate | ||
poetry install | ||
- name: Check the quality of the code | ||
run: | | ||
source venv/bin/activate | ||
pytest |
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 @@ | ||
name: Release to PyPi | ||
on: | ||
push: | ||
tags: | ||
- 'v[0-9]+.[0-9]+.[0-9]+' | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-n-publish: | ||
name: Build and publish to PyPI | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout source | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: "3.8" | ||
|
||
- name: Build source and wheel distributions | ||
run: | | ||
python -m pip install --upgrade build twine | ||
python -m build | ||
twine check --strict dist/* | ||
- name: Publish distribution to PyPI | ||
uses: pypa/gh-action-pypi-publish@master | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_API_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 |
---|---|---|
|
@@ -136,4 +136,4 @@ dist/ | |
.dist/ | ||
*.sessions | ||
*.session | ||
*.session-journal | ||
*.session-journal |
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,56 @@ | ||
# See https://pre-commit.com for more information | ||
# See https://pre-commit.com/hooks.html for more hooks | ||
repos: | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.4.0 | ||
hooks: | ||
- id: check-added-large-files | ||
exclude: ^logo/ | ||
- id: check-toml | ||
- id: check-yaml | ||
args: | ||
- --unsafe | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
- repo: https://github.com/asottile/pyupgrade | ||
rev: v3.3.1 | ||
hooks: | ||
- id: pyupgrade | ||
args: | ||
- --py3-plus | ||
- --keep-runtime-typing | ||
- repo: https://github.com/charliermarsh/ruff-pre-commit | ||
rev: v0.0.216 | ||
hooks: | ||
- id: ruff | ||
args: | ||
- --fix | ||
- repo: https://github.com/pycqa/isort | ||
rev: 5.11.4 | ||
hooks: | ||
- id: isort | ||
name: isort (python) | ||
- id: isort | ||
name: isort (cython) | ||
types: [cython] | ||
- id: isort | ||
name: isort (pyi) | ||
types: [pyi] | ||
- repo: https://github.com/psf/black | ||
rev: 22.12.0 | ||
hooks: | ||
- id: black | ||
- repo: https://github.com/PyCQA/bandit | ||
rev: '1.7.4' | ||
hooks: | ||
- id: bandit | ||
args: ["-c", "pyproject.toml"] | ||
additional_dependencies: ["bandit[toml]"] | ||
- repo: https://github.com/PyCQA/autoflake | ||
rev: v2.0.0 | ||
hooks: | ||
- id: autoflake | ||
|
||
ci: | ||
autofix_commit_msg: fix(pre-commit): 🎨 Auto format from pre-commit.com hooks | ||
autoupdate_commit_msg: dev(pre-commit):⬆ pre-commit autoupdate |
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
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
Oops, something went wrong.