summaryrefslogtreecommitdiff
path: root/setuptools/command/easy_install.py
Commit message (Collapse)AuthorAgeFilesLines
* Use PY3 and PY2 throughoutJason R. Coombs2014-05-171-5/+5
|
* Merge Pull Request #483.5.2Jason R. Coombs2014-05-071-14/+37
|\
| * make easy_install.uncache_zipdir() remove more stale zipimporter instancesJurko Gospodnetić2014-04-151-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since paths are case-insensitive on Windows, zipped egg modules may be loaded using different but equivalent paths. Importing each such different path causes a new zipimporter to be instantiated. Removing cached zipimporter instances must then not forget about removing those created for differently spelled paths to the same replaced egg. Other missed zipimporter instances are those used to access zipped eggs stored inside zipped eggs. When clearing zipimporter instances got a given path, we need to clear all the instances related to any of its subpaths as well. --HG-- extra : rebase_source : 86aeadd1e639fbc83d27a0c551fdc2b8a68a6f85
| * clean up easy_install.uncache_zipdir() code & commentsJurko Gospodnetić2014-04-151-5/+17
| | | | | | | | | | --HG-- extra : rebase_source : 79778a670897cb92c17307f2535fcac6447e16b4
| * quick-fix #168: avoid using stale cached zipped egg dist info in easy_installJurko Gospodnetić2014-04-151-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When installing a zipped egg, into a Python environment with a same named zipped egg already installed, the installation can fail with a zipimport.ZipImportError complaining about a 'bad local header' encountered in the new zip archive. This can occur if setuptools loads the original egg for some reason and the two zip archives have different content. Then if Python attempts to read a file from the new archive, it will expect it in a location pointed to by the original archive's directory. This will report an error if zipimport does not encounter the expected local file start header in the given location. The mismatch between the two archives can be reproduced by installing the same setuptools version (prior to this commit and after commit f40b810acc5f6494735c912a625d647dc2a3c582 that first introduced the requires.txt metadata information file into the setuptools project) twice from its sources - which can randomly fail due to the scenario described above. That will package the zipped egg archive twice, with each of the archives containing slightly different Python modules. In case this causes any of the compressed modules to have different size (easy_install.pyc is often the culprit here), then attempting to read any later file in the zip archive will fail (requires.txt package metadata file is often the culprit here). A similar scenario can be reproduced more consistently by manually modifying the setuptools easy_install.py source file before building the new egg, e.g. by adding some additional empty lines to its start. The underlying reason for this problem is setuptools using zipimporter instances with cached zip archive content directory information from the older zip archive, even after the old archive has been replaced. This patch cleans up only one such old zipimporter instance - one referenced via easy_install command's local_index attribute. That is the one that has been causing all the currently reported/reproduced installation failures. A clean solution needs to make certain there are no more zipimporter instances with stale archive content directory caches left behind after replacing a zipped egg archive with another. There are currently at least the following known potential sources for such stale zipimporter instances (all holding references to Distribution instances that can then hold a reference to a zipimporter related to their zipped egg archive): easy_install command attributes: local_index (Environment with a list of Distributions) package_index (PackageIndex with a list of Distributions) pth_file (PthDistributions with a list of Distributions) global pkg_resources.working_set object (holds a list of Distributions) imported module's __loader__ attribute (zipimporter instance) zipimport._zip_directory_cache sys.path_importer_cache Further debugging & development note: A complete list of all the currently active stale zipimporter instances can be read using CPython's gc module and its object reference introspection functionality (gc.get_objects() & gc.get_referrers()) from inside the uncache_zipdir() method in the setuptools easy_install.py module. That is the method called just after the old arhive has been replaced by the new one and all the stale zipimporter instances were supposed to have been released. --HG-- extra : rebase_source : 041d2819881b8f7e5c4da333a387fc86d4f7b791
* | Use modern syntax for octal valuesJason R. Coombs2014-05-051-5/+5
|/
* Re-arrange _first_line_re to put core functionality at the top levelJason R. Coombs2014-04-151-4/+8
|
* Move import to the topJason R. Coombs2014-04-151-2/+2
|
* Extract first_line_re function to encapsulate compatibility mechanismJason R. Coombs2014-04-151-4/+9
|
* Issue #156: Fix spelling of __PYVENV_LAUNCHER__ variable.3.0Arfrever Frehtes Taifersar Arahesis2014-03-041-1/+1
|
* Adding comment referencing #134.Jason R. Coombs2014-02-081-0/+2
|
* ENH: use #!/usr/bin/env python for the shebang instead of non-working on ↵Yaroslav Halchenko2013-12-171-1/+1
| | | | POSIX systems plain #!python
* Remove easy_install.HAS_USER_SITE and just defer to site.ENABLE_USER_SITE.Jason R. Coombs2013-11-271-8/+6
|
* Use dict lookup default for sys_executableJason R. Coombs2013-11-271-4/+2
|
* Extract py31compat module for get_config_vars and get_pathJason R. Coombs2013-11-271-14/+3
|
* The one use of xrange could also use range, so just use range.Jason R. Coombs2013-11-241-2/+2
|
* Use sys.getfilesystemencoding for decoding bdist_wininst config. Fixes #114.Jason R. Coombs2013-11-231-4/+3
|
* Remove long-disabled functionality 'check_conflicts'.Jason R. Coombs2013-09-021-56/+1
|
* Remove unused importJason R. Coombs2013-09-021-1/+0
|
* Rename variable to avoid conflation with globalJason R. Coombs2013-09-021-4/+4
|
* Refactor for nicer indentationJason R. Coombs2013-09-021-8/+7
|
* Normalize styleJason R. Coombs2013-09-021-4/+8
|
* Move imports to headerJason R. Coombs2013-09-021-2/+2
|
* Removed the --delete-conflicting and --ignore-conflicts-at-my-risk options, ↵1.0Jason R. Coombs2013-08-171-40/+4
| | | | which have long been deprecated and indicated that they're not used.
* Changed the launcher relevant environment variable to SETUPTOOLS_LAUNCHER ↵Jason R. Coombs2013-08-171-8/+8
| | | | and it now accepts different strings 'natural' and 'executable', instead of only reflecting a boolean value.
* Merge1.0b3Jason R. Coombs2013-08-141-1/+1
|\
| * Fix template rendering errorJason R. Coombs2013-08-141-1/+1
| |
* | Warn when scripts are installed but PATHEXT isn't setJason R. Coombs2013-08-131-0/+4
| | | | | | | | | | --HG-- extra : histedit_source : a1c329f92ee71a707955e352b63987af9de6e120
* | Use .pya extension instead of simply .py to avoid creating scripts that are ↵Jason R. Coombs2013-08-131-2/+2
| | | | | | | | | | | | | | importable as modules. --HG-- extra : histedit_source : ef811b339d08652c845c5556fd7e2d0f38ee12df
* | Remove -script scripts alsoJason R. Coombs2013-08-131-1/+1
| |
* | Issue 60: Implemented experimental opt-in support for using native launchers ↵Jason R. Coombs2013-08-101-19/+44
| | | | | | | | rather than installing launcher executables. My initial experience with this technique has been very positive.
* | Use a single, multiline literal to express the template for clarity.Jason R. Coombs2013-08-061-12/+12
| | | | | | | | | | --HG-- extra : rebase_source : df5f817f45451b3a2c4093c12bb7b2b51f8ff3b7
* | Add docstringJason R. Coombs2013-08-061-0/+5
| | | | | | | | | | --HG-- extra : rebase_source : 79c95e70593d4e4177c3c1f9625e427d9ce0a16c
* | Use a pattern object to invoke the substitution in _adjust_header, restoring ↵Jason R. Coombs2013-08-061-2/+2
| | | | | | | | | | | | | | Python 2.4-2.6 compatibility. --HG-- extra : rebase_source : 4245d65731ca4433c80cf260906085500ab6c357
* | Extract _adjust_header methodJason R. Coombs2013-08-061-6/+18
| | | | | | | | | | --HG-- extra : rebase_source : 63809401ac0769504a143981e518ef31488ea400
* | Name variable for clarityJason R. Coombs2013-08-051-1/+2
| | | | | | | | | | --HG-- extra : rebase_source : 6787fb9e99b28fa2d9504d18018878ccf193d521
* | Move specialized Windows behavior to a specialized subclassJason R. Coombs2013-08-051-36/+48
| | | | | | | | | | --HG-- extra : rebase_source : f56a411c3cace611952133b96a48ed92888f75a1
* | Adapted signature on _get_script_args so it accurately abstracts ↵Jason R. Coombs2013-08-051-41/+44
| | | | | | | | | | | | | | windows/other behavior. --HG-- extra : rebase_source : f57970b6ee6a79e0ef4dc277356e789ff8a341ff
* | Extract protected _get_script_args to capture type parameter.Jason R. Coombs2013-08-051-36/+41
| | | | | | | | | | --HG-- extra : rebase_source : d5458d1469b8b411d3937fa52996fdf96e601029
* | Moved get_script_args into a ScriptWriter class methodJason R. Coombs2013-08-051-40/+44
| | | | | | | | | | --HG-- extra : rebase_source : 2acd6e7c81e54fa495f8b0eaf667b77f40c6495a
* | extract launcher type indicationJason R. Coombs2013-08-051-2/+3
| | | | | | | | | | --HG-- extra : rebase_source : 940b4a8a2c6efe60a2c532e943173ccff0515790
* | Beginning extraction of ScriptWriter classes for writing console and gui scriptsJason R. Coombs2013-08-051-12/+15
|/ | | | | --HG-- extra : rebase_source : 24c34791314ba58ecb0c7dca7bd7fa02a3a84949
* Syntax update for easy_install commandJason R. Coombs2013-08-051-144/+85
| | | | | --HG-- extra : rebase_source : d7fa5f788d2151d0aecf0bc7730ad73c5379320f
* Unlink destination file before writing scripts.Michał Górny2013-08-051-0/+2
|
* Add back accidentally deleted import.Vinay Sajip2013-06-191-0/+1
| | | | | --HG-- branch : single-codebase
* Merged upstream changes.Vinay Sajip2013-06-191-8/+10
|\ | | | | | | | | --HG-- branch : single-codebase
| * Merge Python 3 native support from distributeJason R. Coombs2013-06-181-25/+34
| |\ | | | | | | | | | | | | --HG-- rename : tests/test_distribute_setup.py => tests/test_ez_setup.py
| | * Merge Vinay Sajip's unified Python 2/3 support from distribute 3Jason R. Coombs2013-06-181-10/+54
| | |\ | | | | | | | | | | | | | | | | --HG-- branch : distribute
| | * | Post-merge fixes for Python 3.Vinay Sajip2012-10-101-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | --HG-- branch : distribute extra : source : 6b9041dea7b9197f6ea1fb993d7a05dd4f7c580d
| | * | Merge with upstreamJason R. Coombs2013-06-181-20/+85
| | |\ \ | | | | | | | | | | | | | | | | | | | | --HG-- branch : distribute