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
Fix pip file deps conversion #926
Conversation
good catch, I was knee deep in some of this stuff when I wrote it so I didn't have the wherewithal to step back from this. This is a good fix. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One minor change and I think we're good here. Thanks for putting this together @krismolendyke!
tests/test_pipenv.py
Outdated
os.mkdir(os.path.join(p.path, "tablib")) | ||
|
||
c = p.pipenv('install {}'.format(file_name)) | ||
key = [k for k in p.pipfile['packages'].keys()][0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I should have caught this when the original test was added. Why are we creating a new list for keys when keys() already returns a list?
Let's not continue this trend into new tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably because in Python 2 keys()
returns a list
but in Python 3 keys()
returns a view that would need to be coerced to a list
to be indexed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we do this in a number of places in the codebase for this reason and in the other tests that check on this as well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK rather than deal with this silly 2/3 issue I just removed the copy/pasta of the offending test. The original test remains but this new one does not propagate that behavior.
Thanks @krismolendyke! |
🙇 |
Fix for determining if a package name is a locally installed package. I ran into this because a project I work on depends on the
ansible
Python package and has a top-levelansible/
directory which is not a Python package.The current logic detects the
ansible/
filesystem directory as a Python package file installation and sets the package name to the hash of the directory path, which is nonsense. Then,pip
tries to uninstall something likedeadbeef
and fails, not uninstalling anything after that non-existent "package".I kept this change simple and stupid as I believe that the file (un)installation support is really just about files, and I didn't want to drag
importlib
into this.re: