Skip to content

Commit 6a4d27e

Browse files
committed
Initial commit
0 parents  commit 6a4d27e

Some content is hidden

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

41 files changed

+1943
-0
lines changed

.github/actions/job-setup/action.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Job Setup
2+
description: Environment setup for jobs.
3+
4+
inputs:
5+
install-dependencies:
6+
description: Install sub-dependencies
7+
default: ""
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v4
13+
- name: Set up Python
14+
uses: actions/setup-python@v5
15+
with:
16+
python-version: "3.9"
17+
- name: Install Dependencies
18+
shell: bash
19+
run: pip install -e ".[${{ inputs.install-dependencies }}]"

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "pip"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
time: "13:00"
8+
target-branch: "main"
9+
versioning-strategy: "increase"
10+
ignore:
11+
- dependency-name: "*"
12+
update-types: ["version-update:semver-major"]

.github/workflows/format.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Formatting
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Code formatting
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
- name: Setup
18+
uses: ./.github/actions/job-setup
19+
with:
20+
install-dependencies: format
21+
- name: Run import formatter
22+
run: isort .
23+
- name: Run code formatter
24+
run: black .
25+
- name: Commit changes
26+
uses: stefanzweifel/git-auto-commit-action@v5
27+
with:
28+
commit_message: Apply formatting.

.github/workflows/lint.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Linting
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Code linting
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Setup
16+
uses: ./.github/actions/job-setup
17+
with:
18+
install-dependencies: test
19+
- name: Run linter
20+
run: pylint example_python_package

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Testing
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
10+
11+
jobs:
12+
build:
13+
name: Code testing
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v4
18+
- name: Setup
19+
uses: ./.github/actions/job-setup
20+
with:
21+
install-dependencies: test
22+
- name: Run tests
23+
run: pytest
24+
- name: Static type checking
25+
run: mypy .
26+
- name: Coveralls GitHub Action
27+
uses: coverallsapp/github-action@v2
28+
with:
29+
github-token: ${{ secrets.GITHUB_TOKEN }}
30+
file: reports/pytest/coverage.xml
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Vulnerability Scanning
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
name: Vulnerability scanning
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
- name: Setup
16+
uses: ./.github/actions/job-setup
17+
with:
18+
install-dependencies: test
19+
- name: Run static code scanner
20+
run: bandit example_python_package -rv

.gitignore

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# IDE
2+
## VisualStudioCode IDE
3+
.vscode/*
4+
!.vscode/settings.json
5+
!.vscode/tasks.json
6+
!.vscode/launch.json
7+
!.vscode/extensions.json
8+
!.vscode/*.code-snippets
9+
10+
### Local History for Visual Studio Code
11+
.history/
12+
.history
13+
14+
# Python
15+
## Byte-compiled / optimized / DLL files
16+
__pycache__/
17+
*.py[cod]
18+
*$py.class
19+
20+
## Distribution / packaging
21+
build/
22+
dist/
23+
*.egg-info/
24+
.pypirc
25+
26+
## Environments
27+
.env
28+
.venv
29+
env/
30+
venv/
31+
ENV/
32+
env.bak/
33+
venv.bak/
34+
.virtualenv
35+
.python-version
36+
37+
# Reporting
38+
## Unit test / coverage reports
39+
.coverage
40+
nosetests.xml
41+
coverage.xml
42+
.pytest_cache/
43+
.mypy_cache/
44+
*.TAG
45+
# /reports/

.pre-commit-config.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
default_stages: [commit, push]
2+
fail_fast: true
3+
repos:
4+
- repo: local
5+
hooks:
6+
- id: isort
7+
name: isort import formatting
8+
description: Runs isort import against code.
9+
entry: isort
10+
language: system
11+
types: [python]
12+
- id: black
13+
name: black code formatting
14+
description: Runs black formatting against code.
15+
entry: black
16+
language: system
17+
types: [python]
18+
- id: pylint
19+
name: pylint code linting
20+
description: Runs pylint linting against code.
21+
entry: pylint
22+
language: system
23+
files: ^example_python_package/
24+
types: [python]
25+
- id: mypy
26+
name: mypy type checking
27+
description: Runs mypy type checking against code.
28+
entry: mypy
29+
language: system
30+
files: ^example_python_package/
31+
types: [python]
32+
- id: pytest
33+
name: pytest code testing
34+
description: Runs pytest testing against code.
35+
entry: pytest --cov-fail-under=0
36+
language: system
37+
types: [python]
38+
pass_filenames: false
39+
- id: bandit
40+
name: bandit security tests
41+
description: Runs bandit reporting against code.
42+
entry: bandit -rv -f json -o reports/bandit/report.json
43+
language: system
44+
files: ^example_python_package/
45+
types: [python]
46+
- id: restricted-file-types
47+
name: unexpected file types
48+
description: Checks for large file types.
49+
entry: These file types are unusual and should be checked
50+
language: fail
51+
types: [binary]

0 commit comments

Comments
 (0)