Reputation: 29096
In my package setup.py
I have
setup(
...
requires=['enum', 'hashlib', ...]
)
I have to edit the requires
field manually if I add a dependency in my package and the thing is: I often forget to do that.
Is there an option that can automatically look for imported packages that are not part of the current package?
Upvotes: 1
Views: 748
Reputation: 905
This question is quite old now and I'm sure you managed to find a way around this problem, but anyway. Just to have an answer for this question: I do it the same way as suggested in the comment by just parsing the requirements.txt
. Here is the code of one of my packages:
from setuptools import setup
setup(
name="my_package",
version="1.0.0",
description="Just a package",
...
# this will return every module listed in requirements.txt
install_requires=[line.strip() for line in open("requirements.txt", "r").readlines()],
)
I hope this resolves the question :)
Upvotes: 3