Skip to content

Conversation

@sylwia-budzynska
Copy link
Contributor

For the code to work as a PyPi package, we need to fix relative imports and relative paths.

The init.py is added to make the code work as a module.

The main.py file will allow us to run the code with python -m seclab-taskflow-agent -p assistant "how do modems work"

Copilot AI review requested due to automatic review settings October 17, 2025 17:02
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 refactors the codebase to function as a proper Python package by converting absolute imports to relative imports and fixing path handling. This enables distribution via PyPi and allows users to run the package with python -m seclab-taskflow-agent.

  • Converted absolute imports to relative imports across multiple modules
  • Added dynamic log directory creation for package execution from any location
  • Added __main__.py to enable module execution via python -m

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.

File Description
mcp_utils.py Changed import from env_utils to relative import .env_utils
main.py Updated all internal imports to relative imports and added dynamic log directory creation
agent.py Changed import from capi to relative import .capi
main.py Added entry point for module execution using runpy

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

import runpy

if __name__ == "__main__":
runpy.run_module("seclab_taskflow_agent.main", run_name="__main__")
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

The module name 'seclab_taskflow_agent.main' is hardcoded and doesn't match the actual package structure. This should use a relative import or derive the module name dynamically to avoid breaking if the package is renamed.

Suggested change
runpy.run_module("seclab_taskflow_agent.main", run_name="__main__")
module_name = (__package__ + ".main") if __package__ else "main"
runpy.run_module(module_name, run_name="__main__")

Copilot uses AI. Check for mistakes.
kevinbackhouse
kevinbackhouse previously approved these changes Oct 17, 2025
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

Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

We need all the code to be in a separate directory to build it into a package, so we create a new dir and copy what is need for the build.
For pacakges, only underscores are a allowed as legal python idnetifiers and not dashes, so we need to rename the folder.
Copy link

Copilot AI Oct 17, 2025

Choose a reason for hiding this comment

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

Removed extra 'a' in 'are a allowed' - should be 'are allowed'.

Suggested change
For pacakges, only underscores are a allowed as legal python idnetifiers and not dashes, so we need to rename the folder.
For pacakges, only underscores are allowed as legal python idnetifiers and not dashes, so we need to rename the folder.

Copilot uses AI. Check for mistakes.
sylwia-budzynska and others added 2 commits October 17, 2025 20:20
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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

Copilot reviewed 6 out of 7 changed files in this pull request and generated 2 comments.


Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@kevinbackhouse
Copy link
Collaborator

kevinbackhouse commented Nov 7, 2025

Closing this PR because it has been superseded by #41.

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