summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/util.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove packaging from the standard library.Éric Araujo2012-06-241-1480/+0
| | | | | | Distutils2 will live on on PyPI and be included in the stdlib when it is ready. See discussion starting at http://mail.python.org/pipermail/python-dev/2012-June/120430.html
* Start improving 2to3 code in packaging (#13462).Éric Araujo2012-02-091-9/+9
| | | | | | - Change the fixers used in tests to something not provided by lib2to3 - Test conversion of doctests in text files - Factor out test boilerplate into a common method
* Remove unneeded importÉric Araujo2012-02-091-1/+1
|
* Remove obsolete verbose arguments from packaging.Éric Araujo2011-11-151-14/+9
| | | | | | Logging replaces verbose arguments. I haven’t fixed the example in Doc/install/install.rst because I have major fixes and changes to the oc under way and will fix or remove that example as part of that task.
* Clean up byte-compilation code in packaging (#11254 followup).Éric Araujo2011-11-141-15/+14
| | | | | | | | | | | | | | | | | - Don't use keyword arguments for debug_override; I find it more readable to have a comment explaining that True makes pyc and False pyo than to write out the non-obvious (when you haven’t read the doc) argument name - Move duplicate code from build_py and install_lib into cmd - Remove obsolete verbose argument of util.byte_compile - Remove obsolete passing of -O/-OO to the Python process spawned by util.byte_compile (I’ll remove the whole spawning later, after I write more tests to check the contents of pyc and pyo files; now that byte_compile does not depend on the value of __debug__ in the calling Python, we can call py_compile or compileall directly)
* Improve byte-compilation in packaging to be independent of -O or -B.Éric Araujo2011-11-031-12/+8
| | | | | | | | | | | | | | | | | | | | | The code I fixed to comply with PEP 3147 still had one bug: When run under python -O, some paths for pyc files would be pyo, because I called imp.cache_from_source without explicit debug_override argument in some places, and under -O that would return .pyo (this is well explained in the imp docs). Now all code (util.byte_compile, build_py, install_lib) can create .pyo files according to options given by users, without interference from the calling Python’s own optimize mode. On a related topic, I also removed the code that prevented byte compilation under python -B. The rationale is that packaging gives control over the creation of pyc files to the user with its own explicit option, and the behavior should not be changed if the calling Python happens to run with -B for whatever reason. I will argue that this is a bug fix and ask to be allowed to backport this change to distutils. Finally, I moved one nugget of information about the --compile and --optimize options from the source into the doc. It clears up a misunderstanding that I (and maybe other people) had.
* Fix missing imports in setup scripts generated by packaging (#13205).Éric Araujo2011-10-211-12/+44
| | | | | | | | | | | | | I’ve made more edits than the bug report suggested to make sure the generated setup script is compatible with many Python versions; a comment in the source explains that in detail. The cfg_to_args function uses old 2.x idioms like codecs.open and RawConfigParser.readfp because I want the setup.py generated by packaging and distutils2 to be the same. Most users won’t see the deprecation warning and I ignore it in the test suite. Thanks to David Barnett for the report and original patch.
* Expand tests and fix bugs in packaging.util.resolve_name.Éric Araujo2011-10-191-4/+17
| | | | | The code is still ugly, but at least it works better now. Patches to make it easier to read are welcome, as well as support in #12915.
* Fix packaging byte-compilation to comply with PEP 3147 (#11254).Éric Araujo2011-10-081-2/+6
| | | | | | | | | | I want to replace custom byte-compiling function with calls to compileall before 3.3b1, but in the short term it’s good to have this fixed. Adapted from the distutils patch by Jeff Ramnani. I tested with -B, -O and -OO; test_util and test_mixin2to3 fail in -O mode because lib2to3 doesn’t support it.
* Packaging cleanup: remove conditionals for < 2.6 support.Éric Araujo2011-09-171-2/+4
| | | | | | | | PEP 370 features and sys.dont_write_bytecode are always available in 3.3; the distutils2 backport still has the conditionals. I also renamed an internal misnamed method and fixed a few things (“packaging2” name, stray print, unused import, fd leak).
* Clean up packaging.util: add __all__, remove some unused functions.Éric Araujo2011-09-011-130/+33
| | | | | | | | | | | | | | | | | | | | | | | | This huge module is the heir of six distutils modules, and contains a number of miscellaneous functions. I have attempted to help readers of the source code with an annoted __all__. Removed or deprecated functions have been removed from the documentation; I’m working on another patch to document the remaining public functions. For the curious: The unzip_file and untar_file were used by (or intended to be used by) “pysetup install path/to/archive.tar.gz”, but the code presently used shutil.unpack_archive and an helper function, so I just deleted them. They’re still in the repository if we need them in the future. The find_packages function is not used anymore but I want to discuss module and package auto-discovery (in “pysetup create”) again before removing it. subst_vars now lives in sysconfig; rfc822_escape is inlined in packaging.metadata. Other functions are for internal use only, or deprecated; I have left them out of __all__ and sprinkled TODO notes for future cleanups.
* Fix wrong use of root logger in packaging (also a NameError)Éric Araujo2011-08-041-1/+1
|
* Factor out code used by packaging commands for HTTP requests (#12169).Éric Araujo2011-07-081-0/+47
| | | | | | We now have one function to prepare multipart POST requests, and we use CRLF, as recommended by the HTTP spec (#10150). Initial patch by John Edmonds.
* Issue #9516: Port the revised deployment target processing for OSX fromNed Deily2011-06-291-0/+23
| | | | distutils to packaging.
* Also specify encoding when reading setup.cfg (#12320)Éric Araujo2011-06-121-1/+1
|
* Adjust logging in packaging.util.spawn (related to #11599)Éric Araujo2011-06-111-2/+3
|
* Fix assorted bugs in packaging.util.cfg_to_args (#11595).Éric Araujo2011-06-101-10/+21
| | | | Original patch by Erik Bray.
* Move useful function to packaging.util.Éric Araujo2011-06-101-6/+11
| | | | | Original patch by Erik Bray as part of #11595, changed by me to improve readability.
* Packaging cleanup: normalize print calls.Éric Araujo2011-06-081-1/+1
| | | | | Namely: use default arguments instead of explicit empty string; use multiple arguments instead of building strings.
* Update doctring now that Python has real booleansÉric Araujo2011-06-051-1/+1
|
* Improve a few docstrings in packaging.Éric Araujo2011-06-041-8/+7
| | | | | Also beautify import lists. Having them grouped by lenght makes it slightly easier to look for a module.
* Use list constructor or built-in method instead of copy moduleÉric Araujo2011-06-041-2/+1
|
* added the generate-setup actionTarek Ziade2011-06-021-1/+1
|
* Cleaned up the installer output behavior.Tarek Ziade2011-05-301-9/+10
| | | | | | This change also makes sure the logger handlers are not alterated after an installation. That also fixes the remaining environment alteration issue in test_packaging.
* fixed the separator issues in packaging/resources+configTarek Ziade2011-05-211-1/+3
|
* Close #12114: fix a potential deadlock in packaging.util._find_exe_version()Victor Stinner2011-05-211-1/+1
| | | | Avoid also zombi processes: Popen.communicate() calls its wait() method.
* Issue #12112: fix the encoding of setup.py in the packaging moduleVictor Stinner2011-05-191-3/+3
| | | | | * read: use tokenize.detect_encoding() * write: use 'utf-8'
* package: replace open(fn, 'w').close() by open(fn, 'wb').close()Victor Stinner2011-05-191-1/+1
| | | | | We don't need to open the files in text mode just to create them (or update their modification time).
* packaging: use with open() instead of try/finally: closeVictor Stinner2011-05-191-4/+1
|
* initial import of the packaging package in the standard libraryTarek Ziade2011-05-191-0/+1451