summaryrefslogtreecommitdiff
path: root/setuptools/command/easy_install.py
Commit message (Collapse)AuthorAgeFilesLines
...
| * | No need to pass the writer - just invoke it directly.Jason R. Coombs2015-01-041-4/+4
| | |
| * | Extract method for getting script argsJason R. Coombs2015-01-041-5/+9
| | |
| * | Reuse list2cmdline for argument quoting.Jason R. Coombs2015-01-041-30/+2
| | |
| * | Test the report methodJason R. Coombs2015-01-041-4/+1
| | |
| * | Use except/as, now supported by Python 2.6Jason R. Coombs2015-01-041-8/+4
| | |
* | | Merge with 10.2.1Jason R. Coombs2015-01-021-27/+40
|\ \ \ | |/ / | | | | | | | | | --HG-- branch : feature/issue-229
| * | Extract variable for clarity of readingJason R. Coombs2014-12-301-4/+8
| | |
| * | Extract _patch_usage and re-implement as a context manager.Jason R. Coombs2014-12-291-23/+27
| | |
| * | Reindent using textwrapJason R. Coombs2014-12-291-4/+4
| | |
| * | Silence PEP440Warning by default unless invoking easy_installDonald Stufft2014-12-181-0/+5
| |/
* | Merge with masterJason R. Coombs2014-11-161-2/+2
|\ \ | |/ | | | | | | --HG-- branch : feature/issue-229
| * Remove Python 2.5 compatibility for sys.dont_write_bytecodeJason R. Coombs2014-10-251-2/+2
| |
* | Use six for Python 2 compatibilityJason R. Coombs2014-07-051-18/+16
|/ | | | | | --HG-- branch : feature/issue-229 extra : source : 7b1997ececc5772798ce33a0f8e77387cb55a977
* Fixed PEP 8 compliancy of the setuptools.command packageAlex Grönholm2014-06-181-231/+298
|
* Merge template loader refactoringJason R. Coombs2014-06-151-14/+16
|\
| * Moved filename resolution into _load_templateJason R. Coombs2014-06-151-7/+8
| | | | | | | | | | --HG-- extra : rebase_source : beb6c57dfd500432304518b9d313d1a98e2614b9
| * Extract embedded function as protected staticmethod.Jason R. Coombs2014-06-151-9/+10
| | | | | | | | | | --HG-- extra : rebase_source : 04b4807ccc7bf95d87797716f5d3488d420fa692
* | Merge issue202 changes. Fixes #202.Jason R. Coombs2014-06-151-41/+181
|\ \ | |/ |/|
| * remove instead of fix stale zipimport._zip_directory_cache data on PyPyJurko Gospodnetić2014-06-151-25/+42
| | | | | | | | | | | | | | | | | | | | PyPy's zipimport._zip_directory_cache implementation does not support direct item assignment, thus breaking our attempts at silently updating the cached zip archive directory information behind the scene. As a workaround, when using PyPy, we fall back to simply clearing the stale cached information. --HG-- extra : amend_source : 991e30244754d8fac042da56ac4cf0ad1a0f50d5
| * clear cached zip archive directory data when removing it from cacheJurko Gospodnetić2014-06-041-10/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | This is an extra safety measure to avoid someone holding a reference to this cached data and using its content even after we know that the underlying zip archive has been removed and possibly even replaced. Change suggested by PJ Eby (pje on BitBucket) in a setuptools pull request #51 comment: https://bitbucket.org/pypa/setuptools/pull-request/51/diff#comment-2018183 --HG-- extra : rebase_source : 6de2309bc7446647749cfe78ab00e0230a07f92f
| * extract function for updating zipimporter cache dataJurko Gospodnetić2014-06-041-14/+35
| | | | | | | | | | | | | | | | | | | | | | | | _update_zipimporter_cache() extracted from _uncache() & _replace_zip_directory_cache_data(). Code cleanup done in preparation for adding a bit more detailed cache item clearing logic, so that would not require adding a separate function with yet more code duplication. --HG-- extra : rebase_source : e2e956e042c7cbfabe2c31ecc58a4f76c91f40aa
| * extract duplicate codeJurko Gospodnetić2014-06-041-13/+18
| | | | | | | | | | | | | | | | Extracted code for collecting a list of zipimporter cache entries related to a given path into _collect_zipimporter_cache_entries(). --HG-- extra : rebase_source : 54ab881d794f95467e811511433a2cd31595339e
| * update zipimporter cache clearing related code commentsJurko Gospodnetić2014-06-041-25/+31
| | | | | | | | | | --HG-- extra : rebase_source : c8c77d96880275e34c1580991c2d70486b6d0e00
| * fix clearing zipimport._zip_directory_cache on pypyJurko Gospodnetić2014-06-021-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | pypy uses a custom zipimport._zip_directory_cache implementation class that does not support the complete dict interface, e.g. it does not support the dict.pop() method. For more detailed information see the following links: https://bitbucket.org/pypa/setuptools/issue/202/more-robust-zipimporter-cache-invalidation#comment-10495960 https://bitbucket.org/pypy/pypy/src/dd07756a34a41f674c0cacfbc8ae1d4cc9ea2ae4/pypy/module/zipimport/interp_zipimport.py#cl-99 --HG-- extra : rebase_source : 95cff7946455f0a4422d97eecab11164a9ddef10
| * remove quick-fix comment for the solution to issue #169.Jurko Gospodnetić2014-05-081-7/+0
| | | | | | | | | | | | | | | | | | | | Although the original problematic use case when we are replacing a zipped egg distribution with another zipped egg distribution is now cleanly handled by fixing all existing zipimport.zipimporter loaders, this fix is still valid for cases when replacing a distribution with a non-zipped egg folder. --HG-- extra : source : efd6a8b82bafdbcfad1971b7e0f470e19191be1a
| * fix issue202 - update existing zipimporters when replacing a zipped eggJurko Gospodnetić2014-05-081-30/+109
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When replacing a zipped egg distribution with a different zipped egg, we make all existing zipimport.zipimporter loaders valid again instead of having to go hunting them down one by one. This is done by updating their shared zip directory information cache - zipimport._zip_directory_cache. Related to the following project issues: #169 - http://bitbucket.org/pypa/setuptools/issue/168 #202 - http://bitbucket.org/pypa/setuptools/issue/202 --HG-- extra : source : b60beb7792252a39f61d7fc0f58aa04c03ddaba2
* | Rename script template to use .tmpl extensions.Jason R. Coombs2014-06-141-2/+2
| | | | | | | | | | | | --HG-- rename : setuptools/script template (dev).py => setuptools/script (dev).tmpl rename : setuptools/script template.py => setuptools/script.tmpl
* | Now that 2to3 is no longer run on the codebase, it's safe for the templates ↵Jason R. Coombs2014-06-141-7/+1
|/ | | | to be syntactically incorrect (prior to substitution).
* 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
|