Skip to content

Commit 561540e

Browse files
seclab-taskflows initial commit
0 parents  commit 561540e

File tree

80 files changed

+6589
-0
lines changed

Some content is hidden

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

80 files changed

+6589
-0
lines changed

.github/workflows/ci.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Python CI
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
pull_request:
7+
branches: [ main ]
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
test:
14+
name: Run Tests ${{ matrix.python-version }} on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
19+
python-version: ['3.11', '3.13'] # the one we have in the Codespace + the latest supported one by PyO3.
20+
fail-fast: false # Continue testing other version(s) if one fails
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@v5
25+
26+
- name: Set up Python ${{ matrix.python-version }}
27+
uses: actions/setup-python@v6
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
cache: 'pip'
31+
32+
33+
- name: Install Hatch
34+
run: pip install --upgrade hatch
35+
36+
- name: Run static analysis
37+
run: |
38+
# hatch fmt --check
39+
echo linter errors will be fixed in a separate PR
40+
41+
- name: Run tests
42+
run: hatch test --python ${{ matrix.python-version }} --cover --randomize --parallel --retries 2 --retry-delay 1
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish to PyPI
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+
7+
8+
jobs:
9+
publish:
10+
name: Build
11+
runs-on: ubuntu-latest
12+
13+
# This environment is required as an input to pypa/gh-action-pypi-publish
14+
environment:
15+
name: pypi
16+
url: https://pypi.org/p/seclab-taskflows
17+
18+
env:
19+
GITHUB_REPO: ${{ github.repository }}
20+
21+
permissions:
22+
contents: write
23+
id-token: write # For trusted publishing
24+
25+
steps:
26+
- name: Checkout repository
27+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
28+
with:
29+
persist-credentials: false
30+
31+
- name: Set up Python
32+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
33+
with:
34+
python-version: "3.13"
35+
36+
- name: Install Hatch
37+
run: pip install --upgrade hatch
38+
39+
- name: Build the wheel
40+
run: python3 -m hatch build
41+
42+
- name: Upload artifacts
43+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
44+
with:
45+
name: python-package-distributions
46+
path: dist/
47+
48+
- name: Publish to PyPI
49+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
50+
with:
51+
verbose: true
52+
53+
- name: Sign with sigstore
54+
uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
55+
with:
56+
inputs: >-
57+
./dist/*.tar.gz
58+
./dist/*.whl
59+
60+
- name: Create GitHub Release
61+
env:
62+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
63+
RELEASE_NAME: ${{ github.ref_name }}
64+
run: gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --generate-notes
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
name: Publish to TestPyPI
2+
3+
on: workflow_dispatch
4+
5+
jobs:
6+
publish:
7+
name: Build
8+
runs-on: ubuntu-latest
9+
10+
# This environment is required as an input to pypa/gh-action-pypi-publish
11+
environment:
12+
name: testpypi
13+
url: https://test.pypi.org/p/seclab-taskflows
14+
15+
env:
16+
GITHUB_REPO: ${{ github.repository }}
17+
18+
permissions:
19+
contents: write
20+
id-token: write # For trusted publishing
21+
22+
steps:
23+
- name: Checkout repository
24+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
25+
with:
26+
persist-credentials: false
27+
28+
- name: Set up Python
29+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
30+
with:
31+
python-version: "3.13"
32+
33+
- name: Install Hatch
34+
run: pip install --upgrade hatch
35+
36+
- name: Generate new pre-release version number
37+
id: create_version_number
38+
run: |
39+
# Convert current version number to an alpha release of the next version.
40+
# For example, 1.0.2 becomes 1.0.3a0
41+
hatch version micro,a
42+
# Get latest version number from test.pypi.org
43+
CURRENT_VERSION_NUMBER=$(pip index versions --pre --index-url https://test.pypi.org/simple seclab-taskflows | sed 's/[^(]*[(]\([^)]*\)[)].*/\1/' | head -n 1)
44+
# Set version number to match test.pypi.org
45+
hatch version "$CURRENT_VERSION_NUMBER" || echo TestPyPI is behind current version
46+
# Bump version number
47+
hatch version a
48+
# Create a name for the release
49+
echo "RELEASE_NAME=test-release-v`hatch version`" >> $GITHUB_OUTPUT
50+
51+
- name: Build the wheel
52+
run: python3 -m hatch build
53+
54+
- name: Upload artifacts
55+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
56+
with:
57+
name: python-package-distributions
58+
path: dist/
59+
60+
- name: Publish to TestPyPI
61+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
62+
with:
63+
repository-url: https://test.pypi.org/legacy/
64+
verbose: true
65+
66+
- name: Sign with sigstore
67+
uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
68+
with:
69+
inputs: >-
70+
./dist/*.tar.gz
71+
./dist/*.whl
72+
73+
- name: Create GitHub Release
74+
env:
75+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
76+
RELEASE_NAME: ${{ steps.create_version_number.outputs.RELEASE_NAME }}
77+
run: gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --prerelease --generate-notes

.gitignore

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
*.log
2+
.direnv
3+
.envrc
4+
5+
# https://github.com/github/gitignore/blob/main/Python.gitignore
6+
# Byte-compiled / optimized / DLL files
7+
__pycache__/
8+
*.py[cod]
9+
*$py.class
10+
11+
# emacs backup files
12+
*~
13+
14+
# C extensions
15+
*.so
16+
17+
# Distribution / packaging
18+
.Python
19+
build/
20+
develop-eggs/
21+
dist/
22+
downloads/
23+
eggs/
24+
.eggs/
25+
parts/
26+
sdist/
27+
var/
28+
wheels/
29+
share/python-wheels/
30+
*.egg-info/
31+
.installed.cfg
32+
*.egg
33+
MANIFEST
34+
35+
# PyInstaller
36+
# Usually these files are written by a python script from a template
37+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
38+
*.manifest
39+
*.spec
40+
41+
# Installer logs
42+
pip-log.txt
43+
pip-delete-this-directory.txt
44+
45+
# Unit test / coverage reports
46+
htmlcov/
47+
.tox/
48+
.nox/
49+
.coverage
50+
.coverage.*
51+
.cache
52+
nosetests.xml
53+
coverage.xml
54+
*.cover
55+
*.py,cover
56+
.hypothesis/
57+
.pytest_cache/
58+
cover/
59+
60+
# Translations
61+
*.mo
62+
*.pot
63+
64+
# Django stuff:
65+
*.log
66+
local_settings.py
67+
db.sqlite3
68+
db.sqlite3-journal
69+
70+
# Flask stuff:
71+
instance/
72+
.webassets-cache
73+
74+
# Scrapy stuff:
75+
.scrapy
76+
77+
# Sphinx documentation
78+
docs/_build/
79+
80+
# PyBuilder
81+
.pybuilder/
82+
target/
83+
84+
# Jupyter Notebook
85+
.ipynb_checkpoints
86+
87+
# IPython
88+
profile_default/
89+
ipython_config.py
90+
91+
# pyenv
92+
# For a library or package, you might want to ignore these files since the code is
93+
# intended to run in multiple environments; otherwise, check them in:
94+
# .python-version
95+
96+
# pipenv
97+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
98+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
99+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
100+
# install all needed dependencies.
101+
#Pipfile.lock
102+
103+
# UV
104+
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
105+
# This is especially recommended for binary packages to ensure reproducibility, and is more
106+
# commonly ignored for libraries.
107+
#uv.lock
108+
109+
# poetry
110+
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
111+
# This is especially recommended for binary packages to ensure reproducibility, and is more
112+
# commonly ignored for libraries.
113+
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
114+
#poetry.lock
115+
116+
# pdm
117+
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
118+
#pdm.lock
119+
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
120+
# in version control.
121+
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
122+
.pdm.toml
123+
.pdm-python
124+
.pdm-build/
125+
126+
# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
127+
__pypackages__/
128+
129+
# Celery stuff
130+
celerybeat-schedule
131+
celerybeat.pid
132+
133+
# SageMath parsed files
134+
*.sage.py
135+
136+
# Environments
137+
.env
138+
.venv
139+
env/
140+
venv/
141+
ENV/
142+
env.bak/
143+
venv.bak/
144+
145+
# Spyder project settings
146+
.spyderproject
147+
.spyproject
148+
149+
# Rope project settings
150+
.ropeproject
151+
152+
# mkdocs documentation
153+
/site
154+
155+
# mypy
156+
.mypy_cache/
157+
.dmypy.json
158+
dmypy.json
159+
160+
# Pyre type checker
161+
.pyre/
162+
163+
# pytype static type analyzer
164+
.pytype/
165+
166+
# Cython debug symbols
167+
cython_debug/
168+
169+
# PyCharm
170+
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
171+
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
172+
# and can be added to the global gitignore or merged into this file. For a more nuclear
173+
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
174+
#.idea/
175+
176+
# Ruff stuff:
177+
.ruff_cache/
178+
179+
# PyPI configuration file
180+
.pypirc
181+
182+
#config.yaml
183+
config.yaml
184+
185+
#database
186+
*.db
187+
#logs
188+
logs/
189+
190+
#data
191+
data/

CODEOWNERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This repository is maintained by:
2+
* @m-y-mo @p- @jarlob @kevinbackhouse @sylwia-budzynska

0 commit comments

Comments
 (0)