summaryrefslogtreecommitdiffstats
path: root/Lib/packaging/tests/test_util.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove packaging from the standard library.Éric Araujo2012-06-241-1013/+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
* Add test for packaging.util.set_platform (#13974).Éric Araujo2012-02-161-0/+5
| | | | Patch by Tshepang Lekhonkhobe.
* Remove redundant setUp/tearDown methods in packaging testsÉric Araujo2011-11-141-8/+0
|
* Clean up mocking of stdout and stdin in packaging tests.Éric Araujo2011-11-061-2/+2
| | | | | | | | Running with regrtest does not show spurious output or unrestored sys.std* objects; sometimes running with make test is different, I’ll watch the buildbots. In addition, update the create module to use logging.
* Improve byte-compilation in packaging to be independent of -O or -B.Éric Araujo2011-11-031-29/+25
| | | | | | | | | | | | | | | | | | | | | 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-5/+29
| | | | | | | | | | | | | 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.
* Clean up some idioms in packaging tests.Éric Araujo2011-10-191-16/+12
| | | | | | | | - Use os.makedirs (I had forgotten about it!) - Let TempdirManager.write_file call os.path.join for us - Remove custom command added by test_dist - Use a skip instead of hiding a method with an underscore - Address pyflakes warnings
* Expand tests and fix bugs in packaging.util.resolve_name.Éric Araujo2011-10-191-29/+43
| | | | | 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.
* Branch mergeÉric Araujo2011-09-181-4/+0
|\
| * Packaging cleanup: remove conditionals for < 2.6 support.Éric Araujo2011-09-171-4/+0
| | | | | | | | | | | | | | | | 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).
* | Make a number of small changes to ease the backport to distutils2Éric Araujo2011-09-181-4/+2
|/
* Issue #9561: packaging now writes egg-info files using UTF-8Victor Stinner2011-09-051-2/+2
| | | | instead of the locale encoding
* Clean up packaging.util: add __all__, remove some unused functions.Éric Araujo2011-09-011-8/+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.
* Factor out code used by packaging commands for HTTP requests (#12169).Éric Araujo2011-07-081-1/+25
| | | | | | 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.
* Minor tweaks to packaging tests.Éric Araujo2011-06-171-7/+1
| | | | | | - Move a tearDown method right after setUp - Use assertRaises instead of reinventing it - Skip a test instead of commenting it out, as a reminder
* Specify the encoding of the setup.cfg in one packaging test (#12320)Éric Araujo2011-06-121-1/+1
|
* Allow multiple setup hooks in packaging’s setup.cfg files (#12240).Éric Araujo2011-06-101-1/+1
| | | | Original patch by Erik Bray.
* Fix assorted bugs in packaging.util.cfg_to_args (#11595).Éric Araujo2011-06-101-7/+41
| | | | Original patch by Erik Bray.
* Cleaned up the installer output behavior.Tarek Ziade2011-05-301-22/+22
| | | | | | 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 cwd cleanup in packaging test_utilTarek Ziade2011-05-231-1/+8
|
* fixed a few mocking/cleanup issues in packaging test_util for win32Tarek Ziade2011-05-211-5/+8
|
* Close #12114: fix a potential deadlock in packaging.util._find_exe_version()Victor Stinner2011-05-211-0/+3
| | | | Avoid also zombi processes: Popen.communicate() calls its wait() method.
* fix packaging tests on Windows: use os.path.join() in glob patternsVictor Stinner2011-05-191-8/+10
|
* packaging: fix the constructor of FakePopenVictor Stinner2011-05-191-2/+8
| | | | packaging.util requires the env keyword.
* packaging: use with open() instead of try/finally: closeVictor Stinner2011-05-191-9/+7
|
* initial import of the packaging package in the standard libraryTarek Ziade2011-05-191-0/+928