How can I define a private GitHub repo as a dependency in the project
section of my pyproject.toml
file?
[project]
dependencies = [
"my_repo_name>=<SSH-address_to_my_private_github_repo>"
]
How about something like:
[tool.hatch.metadata]
allow-direct-references = true
[project]
dependencies = [
"my_pkg_name @ git+ssh://[email protected]/my-github-name/my_repo",
]
Explanation:
@EDG956 and @sinoroc pointed at docs on how to do this if you're using poetry, but I don't think you are: your example has a [project]
section rather than a [tool.poetry.dependencies]
section, so I'm guessing you're using pyproject.toml
with setuptools
directly — as described here.
That page refers to PEP 621, whose section on dependencies
says:
For
dependencies
, it is a key whose value is an array of strings. Each string represents a dependency of the project and MUST be formatted as a valid PEP 508 string.
Then, the "Examples" section of PEP 508 shows an example which I've used as the basis of my suggestion above.
(As usual, you can use @<tag>
or @<sha>
, or #<branch_name>
suffixes, etc.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With