Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly define packages and dependencies #571

Merged
merged 1 commit into from
Dec 13, 2024
Merged

Conversation

teocns
Copy link
Contributor

@teocns teocns commented Dec 11, 2024

Ok so in #566 I have gco main -- pyproject.toml to restore the broken config spec.

Ever since it was merged, somehow pyproject.toml was (accidentally?) reverted (again) to an incorrect state where "packages" was listed under build specifications, so my changes are not there.

Changes

  • Added empty __init__.py files to all package directories:
    • agentops/llms/__init__.py
    • agentops/llms/providers/__init__.py
    • agentops/partners/__init__.py
  • Simplified package configuration in pyproject.toml to only specify root package
  • Moved ci back to [dependency-groups]

Why

I made these changes to solve two issues:

  1. Proper Python Structure: Adding __init__.py files:

We were explicitly listing every subpackage in pyproject.toml, which, according to the way it was done, it meant requiring manual updates whenever we add new directories (??)

If you need to include a module as part of the "agentops" package (root package), simply add an __init__.py file to that module's directory. This will make it a proper Python package and include it in the distribution.

  1. The ci group landed under "extras" again and it would make the tach pipeline fail again.

"extra"s are things that you want to install with pip install .[extra] and are made part of the distribution. You don't want this for CI/DEV related stuff. Let extras be stuff like additional, extra, plug-ins/addon-like packages that extend the agentops core functionality (i.e a langchain dep pointing to a specific langchain_core version among other deps)

References:


Important note:
The build specification section should only declare the root package. Do not modify it!

Signed-off-by: Teo <teocns@gmail.com>
@teocns teocns requested a review from areibman December 11, 2024 23:42
Copy link

codecov bot commented Dec 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Flag Coverage Δ
unittests 54.03% <ø> (-0.81%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

@areibman areibman merged commit c70ec59 into main Dec 13, 2024
11 checks passed
@areibman areibman deleted the package-me-again branch December 13, 2024 00:15
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