Install a subpackage with a .toml with a package with .toml

23 Views Asked by At

My structure in my package detection is as follows:

├── detection_engine
│   ├── detection
│   ├── engines
│   │   └── yolox
│   ├── models
│   └── tracking
│       └── algorithms
├── detection_engine.egg-info
└── pyproject.toml

where I have a pyproject.toml which installs this package called detection_engine. I would like to also install (if its possible) the yolox as a subpackage so It's installed as normal yolox (yolox has in its folder his own pyproject.toml) but inside this package. How is this possible with setuptools:

[build-system]
requires = ["setuptools", "setuptools-scm"]
build-backend = "setuptools.build_meta"

[project]
name = "detection_engine"
authors = [
    {name = "Josiah Carberry", email = "[email protected]"},
]
description = "Detection Engine"
readme = "README.md"
requires-python = ">=3.8"

dependencies = [
    "requests",
    'importlib-metadata; python_version<"3.10"',
]
dynamic = ["version"]



[project.optional-dependencies]
yolox = [
    "loguru==0.7.2",
    "tqdm==4.66.1",
    "thop==0.1.1.post2209072238",
    "ninja==1.11.1.1",
    "tabulate==0.9.0",
    "psutil==5.9.6",
    "tensorboard==2.14.0",
    "pycocotools>=2.0.7",
    "onnx>=1.13.0",
    "onnx-simplifier",
]
mmcv = [
    "loguru==0.5.3",
    "mmdet==2.28.1",
    "numpy",
    "opencv-python==4.7.0.72",
    "pydantic",
    "pytest-cov==4.0.0",
    "pytest==7.2.2",
    "torch==2.0.1",
    "torchvision==0.15.2"
]

[tool.setuptools.packages.find]
include = ["*"]
namespaces = true # set false to not include folders without __init__.py file.

How do I need to change the .toml to install correctly yolox as is own package. I'm kinda new, when I say install I refer to being able to call his functions from everywhere in python with import. Thanks in advance.

0

There are 0 best solutions below