Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Specifying external dependencies #1712

@BlueMagma2

Description

@BlueMagma2

Introduction

There currently exists a draft proposing a way to declare external dependencies in pyproject,toml: https://peps.python.org/pep-0725/

For example in some of my project I specify the following section in my pyproject.toml:

[external]
dependencies = ["pkg:generic/ffmpeg"]

What I expect this will do is add a line in the METADATA file of my build packages as specified here: https://packaging.python.org/en/latest/specifications/core-metadata/#requires-external-multiple-use

Requires-External: pkg:generic/ffmpeg

Currently no build system properly handle this. Since I was using poetry I made a poetry plugin that takes care of detecting this section and adding the relevant line in METADATA during build: https://pypi.org/project/poetry-external-dependencies/

Then when deploying my package to different system I use a script that detect the external dependency and install what's required on the host system, in the example case it would automatically install ffmpeg using apt or apk or other package manager the system offer.

Question

Is there an existing way to have hatch automatically add the Requires-External line in METADATA ?

If not, is there any way to achieve this, or would the plugin system of hatch be capable of supporting this ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions