Skip to content

Commit

Permalink
Init project
Browse files Browse the repository at this point in the history
Test units

Correction parse json

Init new pytest exception

Correction pytest config and pytester error (fail without reason)

Correction publish/secret CI/CD

Update Markdown

Docs + readthedocs

Update README

Tox & CI/CD Add Python

Update tests & Add date tests

Ruff linting & Ruff format

Update docs

Update dependencies

Update CI/CD

Correction gitigngore
  • Loading branch information
Athroniaeth committed Jan 17, 2024
1 parent d7c9381 commit 27a91f1
Show file tree
Hide file tree
Showing 75 changed files with 2,932 additions and 102 deletions.
115 changes: 115 additions & 0 deletions .github/workflows/development.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
name: development

on:
push:
branches:
- 'development'
- 'feature/*'
tags: ['v*']
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
pull_request:
branches:
- 'development'
- 'feature/*'
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'

jobs:
ruff-format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Mypy (Static Type Checking)
run: poetry run mypy src

ruff-lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Ruff (Linting)
run: poetry run ruff check ./src ./tests

bandit-security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Bandit (Security Analysis)
run: poetry run bandit -c pyproject.toml -r src

pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Pytest (Tests and Coverage)
run: poetry run pytest


coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: 3.12

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Pytest (Tests)
run: poetry run coverage run --source=src -m pytest

- name: Run Coverage (Report)
run: poetry run coverage report -m --fail-under=50
59 changes: 59 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: main

on:
push:
branches:
- 'main'
tags: ['v*']
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'
pull_request:
branches:
- 'main'
paths:
- 'src/**'
- 'tests/**'
- '.github/workflows/**'

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install --with dev

- name: Run Ruff (Formatting)
run: poetry run ruff format ./src ./tests

- name: Run Ruff (Linting)
run: poetry run ruff check --exit-zero ./src ./tests

- name: Run Bandit (Security Analysis)
run: poetry run bandit -c pyproject.toml -r src

- name: Run Mypy (Static Type Checking)
run: poetry run mypy src

- name: Run Pytest (Tests)
run: poetry run coverage run --source=src -m pytest

- name: Run Coverage (Report)
run: poetry run coverage report -m --fail-under=50
73 changes: 73 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
name: release

on:
push:
branches:
- 'release/*'
tags: ['v*']
pull_request:
branches:
- 'release/*'

jobs:
build-and-test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.8', '3.9', '3.10', '3.11', '3.12']

steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}

- name: Install Poetry
run: pip install poetry

- name: Install Dependencies
run: poetry install

- name: Run Ruff (Formatting)
run: poetry run ruff format ./src ./tests

- name: Run Ruff (Linting)
run: poetry run ruff check ./src ./tests

- name: Run Bandit (Security Analysis)
run: poetry run bandit -c pyproject.toml -r src

- name: Run Mypy (Static Type Checking)
run: poetry run mypy src

- name: Run Pytest (Tests)
run: poetry run coverage run --source=src -m pytest

- name: Run Coverage (Report)
run: poetry run coverage report -m --fail-under=50

publish:
needs: build-and-test
runs-on: ubuntu-latest
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.12'

- name: Install Poetry
run: pip install poetry

- name: Build and Publish
env:
PYPI_API_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
run: |
poetry config pypi-token.pypi $PYPI_API_TOKEN
poetry publish --build
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
.pytest_lock/
cover/

# Translations
Expand Down Expand Up @@ -158,5 +159,5 @@ cython_debug/
# 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/

.idea/
.idea/workspace.xml
8 changes: 0 additions & 8 deletions .idea/.gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions .idea/dataSources.local.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/dataSources.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 1 addition & 37 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 0 additions & 8 deletions .idea/modules.xml

This file was deleted.

14 changes: 7 additions & 7 deletions .idea/pytest-lock.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 27a91f1

Please sign in to comment.