Skip to content

Commit 8982663

Browse files
authored
Initial commit
0 parents  commit 8982663

24 files changed

+1029
-0
lines changed

Diff for: .github/dependabot.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for all configuration options:
4+
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
6+
version: 2
7+
updates:
8+
- package-ecosystem: "pip" # See documentation for possible values
9+
directory: "/" # Location of package manifests
10+
schedule:
11+
interval: "weekly"
12+
reviewers:
13+
- "@Hochfrequenz/python-developers-review-team"
14+
# Maintain dependencies for GitHub Actions
15+
- package-ecosystem: "github-actions"
16+
directory: "/"
17+
schedule:
18+
interval: "weekly"

Diff for: .github/workflows/codeql-analysis.yml

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# For most projects, this workflow file will not need changing; you simply need
2+
# to commit it to your repository.
3+
#
4+
# You may wish to alter this file to override the set of languages analyzed,
5+
# or to provide custom queries or build logic.
6+
#
7+
# ******** NOTE ********
8+
# We have attempted to detect the languages in your repository. Please check
9+
# the `language` matrix defined below to confirm you have the correct set of
10+
# supported CodeQL languages.
11+
#
12+
name: "CodeQL"
13+
14+
on:
15+
push:
16+
branches: [main]
17+
pull_request:
18+
# The branches below must be a subset of the branches above
19+
branches: [main]
20+
schedule:
21+
- cron: "29 14 * * 6"
22+
23+
jobs:
24+
analyze:
25+
name: Analyze
26+
runs-on: ubuntu-latest
27+
permissions:
28+
actions: read
29+
contents: read
30+
security-events: write
31+
32+
strategy:
33+
fail-fast: false
34+
matrix:
35+
language: ["python"]
36+
# CodeQL supports [ 'cpp', 'csharp', 'go', 'java', 'javascript', 'python', 'ruby' ]
37+
# Learn more about CodeQL language support at https://git.io/codeql-language-support
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@v4
42+
43+
# Initializes the CodeQL tools for scanning.
44+
- name: Initialize CodeQL
45+
uses: github/codeql-action/init@v3
46+
with:
47+
languages: ${{ matrix.language }}
48+
# If you wish to specify custom queries, you can do so here or in a config file.
49+
# By default, queries listed here will override any specified in a config file.
50+
# Prefix the list here with "+" to use these queries and those in the config file.
51+
# queries: ./path/to/local/query, your-org/your-repo/queries@main
52+
53+
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
54+
# If this step fails, then you should remove it and run the build manually (see below)
55+
- name: Autobuild
56+
uses: github/codeql-action/autobuild@v3
57+
58+
# ℹ️ Command-line programs to run using the OS shell.
59+
# 📚 https://git.io/JvXDl
60+
61+
# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
62+
# and modify them (or add more) to build your code if your project
63+
# uses a compiled language
64+
65+
#- run: |
66+
# make bootstrap
67+
# make release
68+
69+
- name: Perform CodeQL Analysis
70+
uses: github/codeql-action/analyze@v3

Diff for: .github/workflows/coverage.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Coverage"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
jobs:
8+
coverage:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: ["3.12"]
13+
os: [ubuntu-latest]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox
24+
- name: Run Tests and Record Coverage
25+
run: |
26+
tox -e coverage

Diff for: .github/workflows/dependabot_automerge.yml

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Dependabot auto-approve / -merge
2+
on: pull_request
3+
4+
jobs:
5+
dependabot:
6+
permissions:
7+
contents: write
8+
pull-requests: write
9+
runs-on: ubuntu-latest
10+
env:
11+
PR_URL: ${{github.event.pull_request.html_url}}
12+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
13+
if: ${{ github.actor == 'dependabot[bot]' }}
14+
steps:
15+
- name: Approve a PR
16+
run: gh pr review --approve "$PR_URL"
17+
- name: Enable auto-merge for Dependabot PRs
18+
run: gh pr merge --auto --squash "$PR_URL"

Diff for: .github/workflows/dev_test.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Test Dev Environment"
2+
# Checks that the dev environment (tox -e dev) can be set up.
3+
# This might not work, if different linting/testing envs refer to different versions of the same lib (e.g. typing-extensions).
4+
# Different versions of the same package might work for isolated specific envs (only linting, only testing...) but the dev environment inherits from all of them.
5+
on:
6+
push:
7+
branches: [main]
8+
pull_request: {}
9+
jobs:
10+
check:
11+
runs-on: ${{ matrix.os }}
12+
strategy:
13+
matrix:
14+
python-version: ["3.11", "3.12"]
15+
os: [ubuntu-latest]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox
26+
- name: Create a Dev Environment
27+
run: |
28+
tox -e dev

Diff for: .github/workflows/formatting.yml

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: "Formatting"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
jobs:
8+
black:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: ["3.12"]
13+
os: [ubuntu-latest]
14+
tool: ["black", "isort"]
15+
steps:
16+
- uses: actions/checkout@v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install .[formatting]
25+
- name: ${{ matrix.tool }} Code Formatter
26+
run: |
27+
${{ matrix.tool }} . --check

Diff for: .github/workflows/no_byte_order_mark.yml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: Prevent ByteOrderMarks
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request: {}
8+
9+
jobs:
10+
bom-check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
- uses: arma-actions/bom-check@v1
15+
name: Check for BOM

Diff for: .github/workflows/packaging_test.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Packaging Test"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
jobs:
8+
check_packaging:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: ["3.12"]
13+
os: [ubuntu-latest]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox
24+
- name: Run Packaging Test
25+
run: |
26+
tox -e test_packaging

Diff for: .github/workflows/python-publish.yml

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# This GitHub workflow is only needed for python package releases which are supposed to be published on pypi.
2+
# It requires the Github "environments" feature (see instructions below) it might not be available for private free accounts (but works for public or organization repos).
3+
# After creating the "release" environment in the Github repo settings, you need to enter your Github organization/user name + repo name + "python-publish.yml" workflow file name in the PyPI UI to make this work.
4+
5+
# This workflow uploads a Python Package using Twine when a release is created.
6+
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
7+
8+
# name: Upload Python Package
9+
10+
# on:
11+
# release:
12+
# types: [created, edited]
13+
14+
# jobs:
15+
# tests:
16+
# if: startsWith(github.ref, 'refs/tags/v')
17+
# runs-on: ${{ matrix.os }}
18+
# strategy:
19+
# matrix:
20+
# python-version: ["3.12"]
21+
# os: [ubuntu-latest]
22+
# steps:
23+
# - uses: actions/checkout@v4
24+
# - name: Set up Python ${{ matrix.python-version }}
25+
# uses: actions/setup-python@v5
26+
# with:
27+
# python-version: ${{ matrix.python-version }}
28+
# - name: Install tox
29+
# run: |
30+
# python -m pip install --upgrade pip
31+
# pip install tox
32+
# - name: Run tox
33+
# run: |
34+
# tox
35+
36+
# build-n-publish:
37+
# name: Build and publish Python 🐍 distributions 📦 to PyPI and TestPyPI
38+
# runs-on: ${{ matrix.os }}
39+
# strategy:
40+
# matrix:
41+
# python-version: [ "3.12" ]
42+
# os: [ ubuntu-latest ]
43+
# # Specifying a GitHub environment, # Specifying a GitHub environment, which is strongly recommended by PyPI: https://docs.pypi.org/trusted-publishers/adding-a-publisher/
44+
# # you have to create an environment in your repository settings and add the environment name here
45+
# environment: release
46+
# permissions:
47+
# # IMPORTANT: this permission is mandatory for trusted publishing
48+
# id-token: write
49+
# needs: tests
50+
# steps:
51+
# - uses: actions/checkout@v4
52+
# - name: Set up Python ${{ matrix.python-version }}
53+
# uses: actions/setup-python@v5
54+
# with:
55+
# python-version: ${{ matrix.python-version }}
56+
# - name: Install dependencies
57+
# run: |
58+
# python -m pip install --upgrade pip
59+
# pip install -r dev_requirements/requirements-packaging.txt
60+
# - name: Build wheel and source distributions
61+
# run: |
62+
# python -m build
63+
# - name: Publish distribution 📦 to PyPI
64+
# if: startsWith(github.ref, 'refs/tags/v')
65+
# uses: pypa/gh-action-pypi-publish@release/v1
66+

Diff for: .github/workflows/pythonlint.yml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Linting"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
jobs:
8+
pylint:
9+
name: Python Code Quality and Lint
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
python-version: ["3.12"]
14+
os: [ubuntu-latest]
15+
linter-env: ["linting", "type_check", "spell_check"]
16+
steps:
17+
- uses: actions/checkout@v4
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v5
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install Dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
pip install tox
26+
- name: Run ${{ matrix.linter-env }} via Tox
27+
run: |
28+
tox -e ${{ matrix.linter-env }}

Diff for: .github/workflows/unittests.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: "Unittests"
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request: {}
7+
jobs:
8+
pytest:
9+
runs-on: ${{ matrix.os }}
10+
strategy:
11+
matrix:
12+
python-version: ["3.11", "3.12"]
13+
os: [ubuntu-latest]
14+
steps:
15+
- uses: actions/checkout@v4
16+
- name: Set up Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v5
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: Install Dependencies
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install tox
24+
- name: Run the Unit Tests via Tox
25+
run: |
26+
tox -e tests

0 commit comments

Comments
 (0)