I am trying to install a python package from my organization's Bitbucket instance which I have been developing using the below commands:
$ python -m venv venv
$ source venv/bin/activate
(venv) $ pip install git+https://bitbucket.company.com/path/to/package.git
Even though I was able to install my python package into venv but I was expecting it to install the necessary dependencies which I have specified in requirements.txt also!!!
What all changes I need to make to my python package to install the dependencies also?
Below is my package project structure:
.
├── pyproject.toml
├── README.md
├── requirements.txt
├── src
│ └── package
│ ├── __init__.py
│ └── main.py
└── tests
└── test_dummy.py
N.b., I am using hatchling for building my python package
For pip (and other installers) to automatically install the dependencies of the project along the project itself, the dependencies have to be listed in the project's packaging metadata (not in
requirements.txt). The way to do it is to write the list of dependencies inpyproject.tomlAside: Make sure to only list the direct dependencies and use only loose version constraints (no pinned dependencies in project packaging metadata, the pinned dependencies belong in
requirements.txtonly). You can find some discussion about this topic here (it is a bit outdated, but the concept of "abstract vs. concrete dependencies" still holds).For Hatch (and hatchling) specifically there is documentation about dependencies here, but since this follows a standard specification, you can find it documented in many other places.