heroku-python / pip-pop Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED] Tools for managing requirements files.
License: MIT License
[DEPRECATED] Tools for managing requirements files.
License: MIT License
File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1605, in parse_requirements
finder.allow_external |= set([normalize_name(line).lower()])
AttributeError: 'NoneType' object has no attribute 'allow_external'
pip changed the signature of parse_requirements
to require a session
keyword argument as of version 6. Should be able to pass in whatever session is required for forward and backward compat. I'll submit a PR when I get time if you've not gotten to it by then.
Currently with pip 8.1.2, the following exception is raised:
$ ./pip-grep foo.txt requests
Traceback (most recent call last):
File "./pip-grep", line 81, in <module>
main()
File "./pip-grep", line 76, in main
grep(**kwargs)
File "./pip-grep", line 57, in grep
if requirement.req.project_name in packages:
AttributeError: 'Requirement' object has no attribute 'project_name'
This is caused by pypa/pip#3307 , which changed the type of req
, such that it now has a name
attribute rather than project_name
.
To avoid surprises with new versions of pip, and to prevent regressions with older versions when making compatibility fixes, I've filed #9.
pip 8 introduces a new feature that allows people to bake hashes into their requirements.txt, unfortunately this breaks pip-diff
. An example would be https://github.com/pypa/warehouse/blob/master/requirements/main.txt
Output looks like:
Traceback (most recent call last):
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip-grep", line 81, in <module>
main()
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip-grep", line 76, in main
grep(**kwargs)
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip-grep", line 45, in grep
r = Requirements(reqfile)
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip-grep", line 25, in __init__
self.load(reqfile)
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip-grep", line 36, in load
for requirement in parse_requirements(reqfile, finder=finder, session=requests):
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip/req/req_file.py", line 89, in parse_requirements
for req in req_iter:
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip/req/req_file.py", line 172, in process_line
for req in parser:
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip/req/req_file.py", line 89, in parse_requirements
for req in req_iter:
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip/req/req_file.py", line 119, in process_line
opts, _ = parser.parse_args(shlex.split(options_str), defaults)
File "/app/.heroku/python/lib/python3.5/optparse.py", line 1388, in parse_args
self.error(str(err))
File "/app/.heroku/python/lib/python3.5/optparse.py", line 1568, in error
self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
File "/app/tmp/buildpacks/python/vendor/pip-pop/pip/req/req_file.py", line 238, in parser_exit
raise RequirementsFileParseError(msg)
pip.exceptions.RequirementsFileParseError: pip-grep: error: no such option: --hash
To avoid surprise breakage, it would be great to run a couple of rudimentary tests against different versions of pip.
I'll try to open a PR when I get a moment.
usecase: uninstallation of setuptools
stone@mint ~/git/pip-pop/bin $ ./pip-diff
Traceback (most recent call last):
File "./pip-diff", line 17, in
from pip._vendor.requests import session
ImportError: No module named _vendor.requests
Do I need to install some modules?
Pip 10 no longer supports the use of internal APIs: https://groups.google.com/forum/#!topic/pypa-dev/JVTfS6ZdAuM.
This causes pip-grep and pip-diff to error with:
File "pip-grep", line 12, in <module>
from pip.req import parse_requirements
ImportError: No module named 'pip.req'
from pip._internal.req import parse_requirements
from pip._internal.index import PackageFinder
i am a beginner of python,and i found that many python projects contains init.py at most time, but some projects not, why?
got error in deploy
File "/app/tmp/buildpacks/8790c95df255b386056ea169648fd4a33d1cb3fba81f73b536f26374f6af107145f64a5980db7a52177f63bb41527f360ebd2e3bef7b8917bda7b51cf284cfdb/vendor/pip-pop/pip-diff", line 18, in <module>
from pip._internal.download import PipSession as session
ModuleNotFoundError: No module named 'pip._internal.download'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/tmp/buildpacks/8790c95df255b386056ea169648fd4a33d1cb3fba81f73b536f26374f6af107145f64a5980db7a52177f63bb41527f360ebd2e3bef7b8917bda7b51cf284cfdb/vendor/pip-pop/pip-diff", line 30, in <module>
from pip.req import parse_requirements
ModuleNotFoundError: No module named 'pip.req'
If the parameters contain multiple packages, such as "pip-grep tests/test-requirements.txt requests django", and the "test-requirements.txt" include these two packages too. But the program only print the first package. Is it normal?
Thanks.
the code:
def diff(r1, r2, include_fresh=False, include_stale=False, excludes=None):
include_versions = True if include_stale else False
excludes = excludes if len(excludes) else []
in python 2.7.1.4
if excludes=None
then len(excludes) is error
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.