-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fixed issue #609 - method to detect VCS backend #636
Conversation
hey @fabiocerqueira, can you help me out and explain what you think the issue is with piplint and why pip freeze fails to do what we expect for it? |
@qwcode pip freeze verify if a package is editable through of directory to a VCS(.svn, .git, .hg, .bzr), but the dist.location to piplint doesn't have a directory like this. The dist.location return: ~/.virtualenvs/pip/src/piplint/src, where doesn't have a .git, the git directory is on parent path. |
thanks, so piplint's packages are nested under |
I'm trying a new approach to solve the problem of VCS backend detection, but when I run the tests return a fail in test_git_works_with_editable_non_origin_repo. I don't understand what this test is making. Can someone explain?
|
one thought on another way to handle this w/o resorting to the respective VCS commands. -- grab one of the egg-info lines out of |
Random note about the attached patch: in the check_repository methods that were added, the "except Exception" clause (that presumably is meant to catch errors raised by subprocess.Popen or os.chdir, etc) will catch all exceptions. But the logic within the clause doesn't reraise, and "proc" will not be defined when it continues, and that will result in a name error. |
e = sys.exc_info()[1] | ||
logger.warn( | ||
"Error %s while executing command %s" % (e, ' '.join(cmd))) | ||
proc.wait() |
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.
This has the same issue @mcdonc mentioned in the VCS methods below - if an error is raised before the proc =
line in the try block, this line will raise a NameError
.
@fabiocerqueira, thanks for raising the awareness on this issue. |
Identify the likely root directory to pass to the vcs.get_backend_name instead of simply using dist.location. This is necessary to support version control systems such as git and mercurial where the VCS metadata directory only exists off of the root directory. This is a fix for pypa#713, where "pip freeze" outputs the wrong value for a repository checked out from git if the package puts files in the "src" directory. This change is based on @qwcode's comments at pypa#636 (comment).
http://stackoverflow.com/questions/11935786/pip-freeze-reports-version-number-instead-of-git-sha-for-certain-package
After I saw this question I tried fix this, I don't know if is the best way, but now works ok.