Closed labeneator closed 3 years ago
Had a look at this again. I think the problem arises from these lines in setup.py
# Requirements
requirements = []
with open(os.path.join(cwd, 'requirements.txt'), 'r') as f:
requirements = [l.strip() for l in f.readlines()]
That means that dh-virtualenv will try to read these lines when it tries to build the package. That may fail.
Additionally, the deps versions are baked in. Since this can be used as a library, it may interfere with other deps pulled in by other packages. As an example, I'm using prometheus client elsewhere in the project. The hard code for version 0.8.0 as per the requirements.txt file causes a downgrade.
❯❯❯ ./bin/pip install setproctitle rq-exporter
Requirement already satisfied: setproctitle in /opt/venvs/project/lib/python3.7/site-packages (1.2.2)
Requirement already satisfied: rq-exporter in /opt/venvs/project/lib/python3.7/site-packages (1.7.0)
Requirement already satisfied: redis==3.5.3 in /opt/venvs/project/lib/python3.7/site-packages (from rq-exporter) (3.5.3)
Collecting prometheus-client==0.8.0
Using cached prometheus_client-0.8.0-py2.py3-none-any.whl (53 kB)
Requirement already satisfied: rq==1.8.0 in /opt/venvs/project/lib/python3.7/site-packages (from rq-exporter) (1.8.0)
Requirement already satisfied: click>=5.0.0 in /opt/venvs/project/lib/python3.7/site-packages (from rq==1.8.0->rq-exporter) (7.1.2)
Installing collected packages: prometheus-client
Attempting uninstall: prometheus-client
Found existing installation: prometheus-client 0.10.1
Uninstalling prometheus-client-0.10.1:
Successfully uninstalled prometheus-client-0.10.1
Successfully installed prometheus-client-0.8.0
I believe the better solution is to state the minimum version acceptable for a dep and let the package manager figure it out as per: https://packaging.python.org/discussions/install-requires-vs-requirements/
Also, moving in the install deps directly into setup.py would fix the issue raised in this ticket
Hi,
Thank you for reporting this issue and for submitting a fix, I prefer to keep the requirements in one file so I have fixed this issue and published a new version 1.8.0
, please try it out and feel free to reopen this issue if you still have any problems.
Thank you again.
Hi, I am adding rq-exporter to my dh-virtualenv package to enable it to be bundled into a deb. However, I'm getting build errors due to a missing requirements.txt. Could it be included please?
Please see the log below