Skip to content

Commit 673d8ea

Browse files
Repo after creation
1 parent 87cdd74 commit 673d8ea

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1197
-0
lines changed

.bumpversion.cfg

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
[bumpversion]
2+
current_version = 0.0.1-dev
3+
commit = False
4+
tag = False
5+
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>[a-z]+))?
6+
serialize =
7+
{major}.{minor}.{patch}-{release}
8+
{major}.{minor}.{patch}
9+
10+
[bumpversion:part:release]
11+
optional_value = prod
12+
first_value = dev
13+
values =
14+
dev
15+
prod
16+
17+
[bumpversion:file:./src/default/VERSION]

.coveragerc

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[run]
2+
branch = True
3+
source =
4+
src
5+
6+
omit =
7+
*__init__*
8+
*__version__*
9+
*/thirdparty/**
10+
11+
[report]
12+
exclude_lines =
13+
pragma: no cover
14+
if __name__ == .__main__.
15+
show_missing = True

.dockerignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**/venv/
2+
docs/
3+
tests/
4+
ci/
5+
.vscode/
6+
.idea/
7+
.pytest_cache/

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is a standard to preconfigure editors
2+
# check: https://editorconfig.org/
3+
root = true
4+
5+
# 4 space indentation
6+
[*.py]
7+
charset = utf-8
8+
indent_style = space
9+
indent_size = 4
10+
trim_trailing_whitespace = true
11+
insert_final_newline = false
12+
end_of_line = lf

.flake8

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
[flake8]
2+
ignore=
3+
# line too long - is to be checked by black
4+
E501,
5+
# E203 (spaces around :)
6+
E203,
7+
# and W503 (line break before binary operator) are output as a result of Black formatting
8+
W503
9+
10+
dictionaries=en_US,python,technical
11+
docstring-convention=google
12+
spellcheck-targets=comments

.github/workflows/ci.yml

+200
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,200 @@
1+
name: Continuous Integration
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
pull_request:
7+
8+
jobs:
9+
lints:
10+
name: Run linters
11+
runs-on: ubuntu-latest
12+
timeout-minutes: 15
13+
permissions:
14+
contents: read
15+
checks: write
16+
pull-requests: write
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v4
20+
with:
21+
python-version: "3.11"
22+
23+
- name: Cache pre-commit
24+
uses: actions/cache@v3
25+
with:
26+
path: ~/.cache/pre-commit
27+
key: pre-commit-3|${{ env.pythonLocation }}|${{ hashFiles('.pre-commit-config.yaml') }}
28+
29+
- name: Install pre-commit
30+
run: pip3 install pre-commit
31+
32+
- name: Run pre-commit checks
33+
run: pre-commit run --all-files --show-diff-on-failure --color always
34+
35+
- name: Run Trivy vulnerability scanner
36+
uses: aquasecurity/trivy-action@master
37+
with:
38+
scan-type: "fs"
39+
ignore-unfixed: true
40+
exit-code: 0 # change if you want to fail build on vulnerabilities
41+
severity: "CRITICAL,HIGH,MEDIUM"
42+
format: "table"
43+
output: "trivy-scanning-results.txt"
44+
45+
- name: Format trivy message
46+
run: |
47+
echo "Trivy scanning results." >> trivy.txt
48+
cat trivy-scanning-results.txt >> trivy.txt
49+
50+
- name: Add trivy report to PR
51+
uses: thollander/actions-comment-pull-request@v2
52+
continue-on-error: true
53+
if: ${{ github.event_name == 'pull_request' }}
54+
with:
55+
filePath: trivy.txt
56+
reactions: ""
57+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
58+
comment_tag: trivy
59+
60+
- name: Create venv
61+
run: . ./setup_dev_env.sh
62+
63+
- name: Check licenses
64+
run: ./check_licenses.sh
65+
66+
- name: Generate pip freeze
67+
run: |
68+
source venv/bin/activate
69+
pip freeze > requirements-freeze.txt
70+
71+
- name: Publish Artefacts
72+
uses: actions/upload-artifact@v3
73+
if: always()
74+
continue-on-error: true
75+
with:
76+
name: results
77+
path: |
78+
requirements-freeze.txt
79+
licenses.txt
80+
trivy-scanning-results.txt
81+
retention-days: 30
82+
83+
- name: Publish Test Report
84+
uses: actions/upload-artifact@v3
85+
if: always()
86+
continue-on-error: true
87+
with:
88+
name: test-report
89+
path: report.xml
90+
retention-days: 10
91+
92+
- name: Validate package build
93+
run: |
94+
source venv/bin/activate
95+
python -m pip install -U build
96+
python -m build
97+
98+
- name: Publish Package
99+
uses: actions/upload-artifact@v3
100+
continue-on-error: true
101+
if: success()
102+
with:
103+
name: packages
104+
path: dist/**
105+
retention-days: 3
106+
107+
tests:
108+
name: Run tests
109+
runs-on: ubuntu-latest
110+
timeout-minutes: 15
111+
permissions:
112+
checks: write
113+
pull-requests: write
114+
contents: write # required for advanced coverage reporting (to keep branch)
115+
strategy:
116+
fail-fast: false # do not stop all jobs if one fails
117+
matrix:
118+
include:
119+
- python-version: "3.11"
120+
steps:
121+
- uses: actions/checkout@v4
122+
- name: Set up Python ${{ matrix.python-version }}
123+
uses: actions/setup-python@v4
124+
with:
125+
python-version: ${{ matrix.python-version }}
126+
127+
- name: Cache Dependencies
128+
uses: actions/cache@v3
129+
with:
130+
path: ~/.cache/pip
131+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}-${{ hashFiles('**/setup.cfg') }}-${{ hashFiles('**/pyproject.toml') }}
132+
restore-keys: |
133+
${{ runner.os }}-pip-
134+
135+
- name: Install Dependencies
136+
run: pip install -r requirements-dev.txt
137+
138+
- name: Run Tests With Coverage
139+
run: |
140+
# run with coverage to not execute tests twice
141+
coverage run -m pytest -v -p no:warnings --junitxml=report.xml tests/
142+
coverage report
143+
coverage xml
144+
145+
- name: Test Report
146+
uses: mikepenz/action-junit-report@v4
147+
continue-on-error: true
148+
if: always()
149+
with:
150+
report_paths: 'report.xml'
151+
152+
- name: Publish Test Report
153+
uses: actions/upload-artifact@v3
154+
continue-on-error: true
155+
if: always()
156+
with:
157+
name: test-report
158+
path: report.xml
159+
retention-days: 10
160+
161+
# simpler version for code coverage reporting
162+
# - name: Produce Coverage report
163+
# uses: 5monkeys/cobertura-action@v13
164+
# continue-on-error: true
165+
# with:
166+
# path: coverage.xml
167+
# minimum_coverage: 70
168+
# fail_below_threshold: false
169+
170+
# more complex version for better coverage reporting
171+
- name: Produce the coverage report
172+
uses: insightsengineering/coverage-action@v2
173+
continue-on-error: true
174+
with:
175+
# Path to the Cobertura XML report.
176+
path: coverage.xml
177+
# Minimum total coverage, if you want to the
178+
# workflow to enforce it as a standard.
179+
# This has no effect if the `fail` arg is set to `false`.
180+
threshold: 60
181+
# Fail the workflow if the minimum code coverage
182+
# reuqirements are not satisfied.
183+
fail: false
184+
# Publish the rendered output as a PR comment
185+
publish: true
186+
# Create a coverage diff report.
187+
diff: true
188+
# Branch to diff against.
189+
# Compare the current coverage to the coverage
190+
# determined on this branch.
191+
diff-branch: ${{ github.event.repository.default_branch }}
192+
# make report togglable
193+
togglable-report: true
194+
# This is where the coverage reports for the
195+
# `diff-branch` are stored.
196+
# Branch is created if it doesn't already exist'.
197+
diff-storage: _xml_coverage_reports
198+
# A custom title that can be added to the code
199+
# coverage summary in the PR comment.
200+
coverage-summary-title: "Code Coverage Summary"

.github/workflows/documentation.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Build documentation
2+
3+
on:
4+
push:
5+
branches: [main, master]
6+
7+
jobs:
8+
pages:
9+
runs-on: ubuntu-latest
10+
container: python:3.11
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Cache Dependencies
17+
uses: actions/cache@v3
18+
with:
19+
path: ~/.cache/pip
20+
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements-dev.txt') }}
21+
restore-keys: |
22+
${{ runner.os }}-pip-
23+
24+
# for best results, it is better to generate
25+
# documentation within development environment
26+
- name: Create venv
27+
run: . ./setup_dev_env.sh
28+
29+
- name: Build docs
30+
run: ./build_docs.sh
31+
32+
- name: Deploy
33+
uses: peaceiris/actions-gh-pages@v3
34+
with:
35+
github_token: ${{ secrets.GITHUB_TOKEN }}
36+
publish_dir: ./public

.gitignore

+84
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
# Directories
2+
.vscode/
3+
.idea/
4+
.neptune/
5+
.pytest_cache/
6+
.mypy_cache/
7+
venv/
8+
__pycache__/
9+
**.egg-info/
10+
11+
# Byte-compiled / optimized / DLL files
12+
__pycache__/
13+
*.py[cod]
14+
*$py.class
15+
16+
# C extensions
17+
*.so
18+
19+
# Distribution / packaging
20+
.Python
21+
env/
22+
build/
23+
develop-eggs/
24+
dist/
25+
downloads/
26+
eggs/
27+
.eggs/
28+
lib/
29+
lib64/
30+
parts/
31+
sdist/
32+
var/
33+
*.egg-info/
34+
.installed.cfg
35+
*.egg
36+
37+
# Sphinx documentation
38+
docs/_build/
39+
public/
40+
# autogenerated package license table
41+
docs/licenses_table.rst
42+
43+
# license dump file
44+
licenses.txt
45+
46+
# File formats
47+
*.onnx
48+
*.pyc
49+
*.pt
50+
*.pth
51+
*.pkl
52+
*.mar
53+
*.torchscript
54+
**/.ipynb_checkpoints
55+
**/dist/
56+
**/checkpoints/
57+
**/outputs/
58+
59+
# Other env files
60+
.python-version
61+
pyvenv.cfg
62+
pip-selfcheck.json
63+
64+
65+
# Unit test / coverage reports
66+
htmlcov/
67+
.tox/
68+
.coverage
69+
.coverage.*
70+
.cache
71+
nosetests.xml
72+
coverage.xml
73+
*,cover
74+
.hypothesis/
75+
76+
# dotenv
77+
.env
78+
79+
# coverage and pytest reports
80+
coverage.xml
81+
report.xml
82+
83+
# CMake
84+
cmake-build-*/

.libraries-whitelist.txt

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pkg_resources

0 commit comments

Comments
 (0)