Skip to content
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

AttributeError: 'Requirement' object has no attribute 'project_name' for VCS requirements #72

Closed
koniiiik opened this issue Jul 20, 2017 · 1 comment

Comments

@koniiiik
Copy link

  • safety version: 1.5.0
  • Python version: 2.7.6
  • Operating System: Ubuntu Trusty

Description

$SUBJ when there's a git requirement, like for example this:

-e git+https://github.com/jdunck/python-unicodecsv#egg=unicodecsv

Here's the traceback:

$  safety check -r requirements.txt
Traceback (most recent call last):
  File "/home/vagrant/build/venv/bin/safety", line 11, in <module>
    sys.exit(cli())
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/safety/cli.py", line 55, in check
    vulns = safety.check(packages=packages, key=key, db_mirror=db, cached=cache, ignore_ids=ignore)
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/safety/safety.py", line 132, in check
    for pkg in packages:
  File "/home/vagrant/build/venv/local/lib/python2.7/site-packages/safety/util.py", line 81, in read_requirements
    req=req.project_name),
AttributeError: 'Requirement' object has no attribute 'project_name'
@jayfk
Copy link
Contributor

jayfk commented Jul 20, 2017

Thanks for reporting. Fixed in bf7cbd4

I've issued a new bugfix release: 1.5.1 should be available in a couple of minutes on PyPi. In the meantime, 1.4.1 should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants