-
-
Notifications
You must be signed in to change notification settings - Fork 1.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
install_egg_info command causes the --record argument to 'install' to create a wrong entry #118
Comments
Original comment by JesseWeinsteinZonar (Bitbucket: JesseWeinsteinZonar, GitHub: Unknown): Confirmed. Specifically, the error messages I see are:
I'll try and make a pull request soon. |
Original comment by JesseWeinsteinZonar (Bitbucket: JesseWeinsteinZonar, GitHub: Unknown): https://bitbucket.org/pypa/setuptools/pull-request/80/fix-issue-118-prevent-the-egg-info/diff |
Original comment by jaraco (Bitbucket: jaraco, GitHub: jaraco): In #262, the patch for this issue seems to be implicated in breaking installations on pip. Perhaps this is a good reason to accept the approach of @Ivoz instead. |
Original comment by marcusva (Bitbucket: marcusva, GitHub: marcusva): Standard distutils setup.py:
The --record option mentions files, not directories. It might be worth to get into touch with the distutils and pip maintainers about that, to create |
Original comment by JesseWeinsteinZonar (Bitbucket: JesseWeinsteinZonar, GitHub: Unknown): In https://pythonhosted.org/setuptools/easy_install.html it says:
Note the word "files". I presume that was what Marcus was referring to. |
Original comment by toshio (Bitbucket: toshio, GitHub: toshio): In some cases, directories are merely a subset of files. However, since .egg-info is the only directory that's listed in record, that's probably not the intention here. pip currently depends on the egg-info directory being explicitly listed in the record file but it could be changed to find PKG-INFO or another file within the egg-info directory instead: pypa/pip#2075 |
Original comment by toshio (Bitbucket: toshio, GitHub: toshio): One note on changing pip, though -- Unless pip has a special-case for updating itself, people on Windows have to be able to get the updated pip before getting the updated setuptools. Otherwise pip won't be able to update itself. (On other platforms, pip should throw a non-fatal warning. On Windows, the OS will refuse to remove the open file so pip issues a traceback). |
Original comment by JesseWeinsteinZonar (Bitbucket: JesseWeinsteinZonar, GitHub: Unknown): Yes, if it would break pip, we could simply remove the actual files from the |
Original comment by toshio (Bitbucket: toshio, GitHub: toshio): I think removing the files would probably be a greater violation of the documented behaviour of --record, though. For rpm specifically, you really want rpm to know about both the directories and the files (for instance, so that it can remove the directories when the package is uninstalled). The problem is in how you can specify that in your %files section. With both directories and files, you need to list the directories as "%dir /directory/path/" and the files as normal: " /file/path". With just files, you'd have to manually determine what directories to include (also as %dir). When I packaged for Fedora we didn't rely on --record at all. Some manually determined the filelist but most of us chose to sidestep these issues and just list the toplevel directories: "/usr/lib/python2.7/site-packages/pip/" and "/usr/lib/python2.7/site-packages/pip*egg-info/' for instance. That allowed rpm to recursively include all the files and subdirectories itself. |
Original comment by marcusva (Bitbucket: marcusva, GitHub: marcusva): On FreeBSD, we rely on --record to create automatic packaging lists. Directory handling is directly integrated into the package management tools (previously, we just removed the last part of the path entries to create a list of directories). The output of --record however must be consistent, so that we do not have to introduce hacks to circumvent potentially wrong behaviour. |
Originally reported by: marcusva (Bitbucket: marcusva, GitHub: marcusva)
python setup.py install --record=<somefile>
will create a file, which keeps a list of all files being installed by the distutils command.
The
install_egg_info
class of setuptools also puts a directory into the list, which by definition of the --record argument is not allowed.Package management tools, which rely on --record and assume only files to be installed, will break.
The offending line:
https://bitbucket.org/pypa/setuptools/src/b480829f68381870bf3a7fef1964b413d7dc3c32/setuptools/command/install_egg_info.py?at=default#cl-26
The same line is also available in distutils'
install_egg_info
class, the .egg-info in that class however is a plain file.The fix should be easy enough by simply changing it to something like
self.outputs = []
The text was updated successfully, but these errors were encountered: