agents icon indicating copy to clipboard operation
agents copied to clipboard

Using repo as dependency results in partial install

Open jnv opened this issue 2 years ago • 0 comments

Hi, I'd like to use this project as a dependency via Poetry, however, when I install the package from git (since the version on PyPI is vastly outdated), it seems all the submodules are missing.

Reproduction steps:

  1. Create a new folder
  2. Setup new Poetry project: poetry init
  3. Add this repo as dependency: poetry add git+https://github.com/aiwaves-cn/agents.git
  4. Check the site-packages/agents and observe that only top-level Python files are included; in my case:
.
├── evolve.py
├── __init__.py
├── SOP.py
├── State.py
├── template.py
└── utils.py

I suspect this could be regression introduced in 2ae545732cff45ec8ed66f4d86cfbd6be0282136. I'm no distutils expert, but it seems specifying just packages = ['agents'] will omit all subpackages (e.g. agents.LLM).

Perhaps one option to fix it would be to combine previously removed find_packages with package_dir like this?

packages=find_packages(where='src'),
package_dir={"": "src"}

jnv avatar Sep 27 '23 23:09 jnv