Skip to content

Conversation

@kevinbackhouse
Copy link
Collaborator

@kevinbackhouse kevinbackhouse commented Oct 27, 2025

Switch to hatch project manager so that we can publish to PyPI.

The main steps to run it are now:

python3 -m venv .venv
source .venv/bin/activate
pip install hatch
hatch run main -t examples.taskflows.CVE-2023-2283.CVE-2023-2283

I've updated the documentation with the new instructions.

Copilot AI review requested due to automatic review settings October 27, 2025 23:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR migrates the project from a traditional Python setup to the Hatch project manager, enabling PyPI package publishing. The main changes restructure the codebase into a proper Python package (seclab_taskflow_agent) with namespace imports, update all internal references to use the new package structure, and modernize the build and testing infrastructure.

Key Changes

  • Migrated to Hatch build system with pyproject.toml configuration
  • Restructured code into src/seclab_taskflow_agent/ package with proper namespace imports
  • Updated all module references from relative to package-qualified imports (e.g., from available_tools to from .available_tools)
  • Added SPDX license headers to all Python files

Reviewed Changes

Copilot reviewed 52 out of 86 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
pyproject.toml New Hatch build configuration with dependencies and project metadata
src/seclab_taskflow_agent/about.py Version metadata for the package
src/seclab_taskflow_agent/main.py Updated imports to use relative package imports
src/seclab_taskflow_agent/*.py Added license headers and converted to relative imports
src/seclab_taskflow_agent/mcp_servers//.py Added license headers and updated import paths
src/seclab_taskflow_agent/toolboxes/*.yaml Changed server invocation from file paths to module execution
tests/test_yaml_parser.py Updated imports to reference new package structure
examples/taskflows/**/*.yaml Updated references from taskflows.* to examples.taskflows.*
examples/personalities/*.yaml Updated toolbox references to seclab_taskflow_agent.toolboxes.*
.github/workflows/*.yaml Modified to use Hatch for installation and testing
requirements-test.txt Removed in favor of Hatch test environment
pytest.ini Removed in favor of Hatch configuration

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kevinbackhouse kevinbackhouse force-pushed the hatch branch 3 times, most recently from 33d1a87 to acaaec0 Compare October 28, 2025 14:07
@kevinbackhouse
Copy link
Collaborator Author

I've updated the documentation and release tools, so I think this is ready now.

m-y-mo
m-y-mo previously approved these changes Oct 31, 2025
@m-y-mo
Copy link
Contributor

m-y-mo commented Oct 31, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

m-y-mo, started a branch deployment to production (branch: cde82951a5e5548c351a07a500855ec4be3af8d6)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-31T10:36:06.559Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18969979834"
  },
  "git": {
    "branch": "cde82951a5e5548c351a07a500855ec4be3af8d6",
    "commit": "cde82951a5e5548c351a07a500855ec4be3af8d6",
    "verified": true,
    "committer": "kevinbackhouse",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/cde82951a5e5548c351a07a500855ec4be3af8d6"
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": true,
    "comment": {
      "created_at": "2025-10-31T10:35:52Z",
      "updated_at": "2025-10-31T10:35:52Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/41#issuecomment-3472418112"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ✅

m-y-mo successfully deployed branch cde82951a5e5548c351a07a500855ec4be3af8d6 to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3235593046,
    "timestamp": "2025-10-31T10:39:17.236Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18969979834",
    "duration": 191
  },
  "git": {
    "branch": "cde82951a5e5548c351a07a500855ec4be3af8d6",
    "commit": "cde82951a5e5548c351a07a500855ec4be3af8d6",
    "verified": true
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": true
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@m-y-mo
Copy link
Contributor

m-y-mo commented Oct 31, 2025

smoke test

@github-actions
Copy link

Deployment Triggered 🚀

m-y-mo, started a branch deployment to production (branch: 5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f)

You can watch the progress here 🔗

Details
{
  "type": "branch",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "timestamp": "2025-10-31T11:13:12.328Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18970829493"
  },
  "git": {
    "branch": "5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f",
    "commit": "5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f",
    "verified": true,
    "committer": "kevinbackhouse",
    "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/commit/5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f"
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": true,
    "comment": {
      "created_at": "2025-10-31T11:12:56Z",
      "updated_at": "2025-10-31T11:12:56Z",
      "body": "smoke test",
      "html_url": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/pull/41#issuecomment-3472574079"
    }
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@github-actions
Copy link

Deployment Results ✅

m-y-mo successfully deployed branch 5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f to production

Details
{
  "status": "success",
  "environment": {
    "name": "production",
    "url": null
  },
  "deployment": {
    "id": 3235767982,
    "timestamp": "2025-10-31T11:17:26.928Z",
    "logs": "https://github.com/GitHubSecurityLab/seclab-taskflow-agent/actions/runs/18970829493",
    "duration": 255
  },
  "git": {
    "branch": "5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f",
    "commit": "5d4ece206ac3c64dfbf3aa5e095c2bfa1ed3325f",
    "verified": true
  },
  "context": {
    "actor": "m-y-mo",
    "noop": false,
    "fork": true
  },
  "reviews": {
    "count": 1,
    "decision": "APPROVED"
  },
  "parameters": {
    "raw": null,
    "parsed": null
  }
}

@kevinbackhouse
Copy link
Collaborator Author

kevinbackhouse commented Oct 31, 2025

@m-y-mo: I decided to remove this special case from the import code because it doesn't work:

else:
path = ''
filename = toolname

I was hoping that it would import from the current directory if the packagename is empty, but everything that I've tried causes importlib.resources.files to raise an exception. So, for now, I've made it so that the name is required to be of the form "packagename.filename". Which means that you can't run a taskflow from the current directory. But it works fine if you put the taskflows in a sub-directory of the current directory. For example: hatch run main -t mytaskflows.test1

@kevinbackhouse kevinbackhouse merged commit 8333b32 into GitHubSecurityLab:main Oct 31, 2025
9 checks passed
@kevinbackhouse kevinbackhouse deleted the hatch branch October 31, 2025 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants