summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/command/build_py.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove packaging from the standard library.Éric Araujo2012-06-241-392/+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
* Clean up byte-compilation code in packaging (#11254 followup).Éric Araujo2011-11-141-23/+6
| | | | | | | | | | | | | | | | | - 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-25/+22
| | | | | | | | | | | | | | | | | | | | | 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 typo “seperate”Éric Araujo2011-11-021-1/+1
|
* More fixes for PEP 3147 compliance in packaging (#11254)Éric Araujo2011-10-191-2/+4
|
* Packaging cleanup: remove conditionals for < 2.6 support.Éric Araujo2011-09-171-1/+1
| | | | | | | | 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-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* initial import of the packaging package in the standard libraryTarek Ziade2011-05-191-0/+410