Skip to content

Commit 3b36f73

Browse files
Merge branch 'main' into contributing
2 parents b2d6cf9 + c67d60e commit 3b36f73

File tree

91 files changed

+673
-400
lines changed

Some content is hidden

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

91 files changed

+673
-400
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ permissions:
1111

1212
jobs:
1313
test:
14-
name: Run Tests
15-
runs-on: ubuntu-latest
14+
name: Run Tests ${{ matrix.python-version }} on ${{ matrix.os }}
15+
runs-on: ${{ matrix.os }}
1616
strategy:
1717
matrix:
18+
os: [ubuntu-latest, windows-latest, macos-latest]
1819
python-version: ['3.11', '3.13'] # the one we have in the Codespace + the latest supported one by PyO3.
1920
fail-fast: false # Continue testing other version(s) if one fails
2021

@@ -28,17 +29,14 @@ jobs:
2829
python-version: ${{ matrix.python-version }}
2930
cache: 'pip'
3031

31-
- name: Install dependencies
32-
run: |
33-
python -m venv .venv
34-
source .venv/bin/activate
35-
python -m pip install --upgrade pip
36-
python -m pip install -r requirements.txt
37-
python -m pip install -r requirements-test.txt
3832

39-
- name: Run tests with pytest
33+
- name: Install Hatch
34+
run: pip install --upgrade hatch
35+
36+
- name: Run static analysis
4037
run: |
41-
source .venv/bin/activate
42-
pytest tests/ -v
43-
env:
44-
PYTHONPATH: ${{ github.workspace }}
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: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: Publish (reusable workflow)
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
version:
7+
description: 'Version number or tag for the release. For example: v1.0.1'
8+
required: true
9+
type: string
10+
release_notes:
11+
description: 'Release notes'
12+
required: true
13+
type: string
14+
repository_url:
15+
description: 'This is the repository-url parameter for pypa/gh-action-pypi-publish'
16+
required: true
17+
type: string
18+
environment_name:
19+
description: 'Name of environment that specifies PyPI/TestPyPI url'
20+
type: string
21+
required: true
22+
secrets:
23+
GH_TOKEN:
24+
required: true
25+
26+
permissions:
27+
contents: write
28+
id-token: write # For trusted publishing
29+
30+
jobs:
31+
publish:
32+
name: Build
33+
runs-on: ubuntu-latest
34+
environment: ${{ inputs.environment_name }}
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
37+
GITHUB_REPO: ${{ github.repository }}
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
42+
with:
43+
persist-credentials: false
44+
45+
- name: Set up Python
46+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
47+
with:
48+
python-version: "3.13"
49+
50+
- name: Install Hatch
51+
run: pip install --upgrade hatch
52+
53+
- name: Build the wheel
54+
run: python3 -m hatch build
55+
56+
- name: Upload artifacts
57+
uses: actions/upload-artifact@330a01c490aca151604b8cf639adc76d48f6c5d4 # v5.0.0
58+
with:
59+
name: python-package-distributions
60+
path: dist/
61+
62+
- name: Publish to PyPI
63+
uses: pypa/gh-action-pypi-publish@ed0c53931b1dc9bd32cbe73a98c7f6766f8a527e # v1.13.0
64+
with:
65+
repository-url: ${{ inputs.repository_url }}
66+
67+
- name: Sign with sigstore
68+
uses: sigstore/gh-action-sigstore-python@f832326173235dcb00dd5d92cd3f353de3188e6c # v3.1.0
69+
with:
70+
inputs: >-
71+
./dist/*.tar.gz
72+
./dist/*.whl
73+
74+
- name: Create GitHub Release
75+
env:
76+
VERSION: ${{ inputs.version }}
77+
NOTES: ${{ inputs.release_notes }}
78+
run: gh release create $VERSION --repo $GITHUB_REPO --notes $NOTES
79+
80+
- name: Upload GitHub Release
81+
env:
82+
VERSION: ${{ inputs.version }}
83+
run: gh release upload $VERSION dist/** --repo $GITHUB_REPO
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Publish to TestPyPI
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Version name for release'
8+
required: true
9+
10+
jobs:
11+
publish:
12+
name: Publish wheel to TestPyPI
13+
runs-on: ubuntu-latest
14+
environment:
15+
name: testpypi
16+
url: https://test.pypi.org/p/seclab-taskflow-agent2
17+
permissions:
18+
contents: write
19+
id-token: write # For trusted publishing
20+
uses: .github/workflows/publish-reusable.yml@main
21+
with:
22+
version: ${{ inputs.version }}
23+
release_notes: ${{ github.head_ref }}
24+
repository_url: https://test.pypi.org/legacy/
25+
environment: testpypi
26+
secrets:
27+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/smoketest.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ jobs:
4040
run: |
4141
python -m venv .venv
4242
source .venv/bin/activate
43-
python -m pip install -r requirements.txt
43+
python -m pip install hatch
4444
4545
- name: Run tests
4646
env:
@@ -49,19 +49,20 @@ jobs:
4949

5050
run: |
5151
source .venv/bin/activate
52-
python main.py -p personalities.assistant 'explain modems to me please'
53-
python main.py -p personalities.c_auditer 'explain modems to me please'
54-
python main.py -p personalities.examples.echo 'explain modems to me please'
55-
python main.py -t taskflows.CVE-2023-2283.CVE-2023-2283
56-
python main.py -t taskflows.examples.echo
57-
python main.py -t taskflows.examples.example
58-
python main.py -t taskflows.examples.example_globals
59-
python main.py -t taskflows.examples.example_inputs
60-
python main.py -t taskflows.examples.example_large_list_result_iter
61-
python main.py -t taskflows.examples.example_repeat_prompt
62-
python main.py -t taskflows.examples.example_repeat_prompt_async
63-
python main.py -t taskflows.examples.example_repeat_prompt_dictionary
64-
python main.py -t taskflows.examples.example_reusable_prompt
65-
python main.py -t taskflows.examples.example_reusable_taskflows
66-
python main.py -t taskflows.examples.example_triage_taskflow
67-
python main.py -t taskflows.examples.single_step_taskflow
52+
hatch build
53+
hatch run main -p seclab_taskflow_agent.personalities.assistant 'explain modems to me please'
54+
hatch run main -p seclab_taskflow_agent.personalities.c_auditer 'explain modems to me please'
55+
hatch run main -p examples.personalities.echo 'explain modems to me please'
56+
hatch run main -t examples.taskflows.CVE-2023-2283
57+
hatch run main -t examples.taskflows.echo
58+
hatch run main -t examples.taskflows.example
59+
hatch run main -t examples.taskflows.example_globals
60+
hatch run main -t examples.taskflows.example_inputs
61+
hatch run main -t examples.taskflows.example_large_list_result_iter
62+
hatch run main -t examples.taskflows.example_repeat_prompt
63+
hatch run main -t examples.taskflows.example_repeat_prompt_async
64+
hatch run main -t examples.taskflows.example_repeat_prompt_dictionary
65+
hatch run main -t examples.taskflows.example_reusable_prompt
66+
hatch run main -t examples.taskflows.example_reusable_taskflows
67+
hatch run main -t examples.taskflows.example_triage_taskflow
68+
hatch run main -t examples.taskflows.single_step_taskflow

0 commit comments

Comments
 (0)