-
-
Notifications
You must be signed in to change notification settings - Fork 614
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip-compile to use abstract dependencies declared in setup.py install_requires and extras_require #331
Comments
My requirements.in just has a reference to ., and then reads my setup.py, so it is possible even now. |
@ryanhiebert: Could you explain further? Can I just put "." in requirements.in and it'll just work? Sorry for my ignorance :) I still think this feature has merit, because often you want to maintain a separate test-requirements.txt with additional deps needed only for testing, and those should be generated from |
I have a line in my |
That's very nice :-) It works for me (at least with 'install_requires' in setup.py). This ticket could probably the closed. |
Found this thread searching for the same thing. Might be worth mentioning this in the readme. |
This feature would be very useful! Regarding the workaround ( |
@majuscule : You're correct. I believe there's another related issue to #!/bin/sh
# Ensure that pip-tools is installed and upgraded
pip install --upgrade pip-tools | grep 'Successfully installed pip-tools'
# Remove current requirements.txt, because pip-compile
# doesn't seem to work properly with it present.
rm requirements.txt > /dev/null 2>&1
pip-compile --output-file requirements.txt requirements.in > /dev/null
# pip-compile likes to swap out editable relative paths for
# absolute paths. That's not gonna work on production.
sed -i '' "s|-e file://`pwd`|-e .|" requirements.txt
# pip-compile is adding duplicate lines for --extra-index-url
sed -i '' '$!N; /^\(.*\)\n\1$/!P; D' requirements.txt
# Show the diff
git diff requirements.txt It does a couple things differently because of things I've had to work around, but it works pretty well for me, apart from regularly switching the case of the initial "D" in my Django requirement. |
Thanks @ryanhiebert, I appreciate you pasting that here. Hopefully I'll have shortened some of that for us if PR #468 is merged, but the fact that such workarounds are being created should be another testament to the validity of this issue and PR #418. |
I think this is safe to close because of #418 being merged. |
I don't believe this issue is fully fixed. The title mentions both |
This issue is similar to #282, however, because
setup.py
is the de-facto way of declaring packages presently in Python packaging, today, couldpip-compile
support using theinstall_requires
andextras_require
defined insetup.py
files to determine abstract dependencies? This is based off of the recommendations from Donald Stufft's blog post outlining abstract dependencies insetup.py
versus concrete dependencies inrequirements.txt
.The text was updated successfully, but these errors were encountered: