🧩 Build System Integration¢

Tip

See example/ for working examples of using unidep with different build systems.

unidep seamlessly integrates with popular Python build systems to simplify dependency management in your projects.

Example packagesΒΆ

Explore these installable example packages to understand how unidep integrates with different build tools and configurations:

Project

Build Tool

pyproject.toml

requirements.yaml

setup.py

setup_py_project

setuptools

βœ…

βœ…

βœ…

setuptools_project

setuptools

βœ…

βœ…

❌

pyproject_toml_project

setuptools

βœ…

❌

❌

hatch_project

hatch

βœ…

βœ…

❌

hatch2_project

hatch

βœ…

❌

❌

Setuptools IntegrationΒΆ

For projects using setuptools, configure unidep in pyproject.toml and either specify dependencies in a requirements.yaml file or include them in pyproject.toml too.

  • Using pyproject.toml only: The [project.dependencies] field in pyproject.toml gets automatically populated from requirements.yaml or from the [tool.unidep] section in pyproject.toml.

  • Using setup.py: The install_requires field in setup.py automatically reflects dependencies specified in requirements.yaml or pyproject.toml.

Example pyproject.toml Configuration:

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

[project]
dynamic = ["dependencies"]

Hatchling IntegrationΒΆ

For projects managed with Hatch, unidep can be configured in pyproject.toml to automatically process the dependencies from requirements.yaml or from the [tool.unidep] section in pyproject.toml.

Example Configuration for Hatch:

[build-system]
requires = ["hatchling", "unidep"]
build-backend = "hatchling.build"

[project]
dynamic = ["dependencies"]
# Additional project configurations

[tool.hatch]
# Additional Hatch configurations

[tool.hatch.metadata.hooks.unidep]