Commit Graph

156 Commits

Author SHA1 Message Date
Éric Araujo 61543b1afc Fix typo I introduced in f93acf8844ec 2011-08-30 22:13:21 +02:00
Éric Araujo d9d67a6b5c Update list of trove classifiers to match PyPI 2011-08-30 19:05:46 +02:00
Éric Araujo b9fe54cccc Make bdist_* commands respect --skip-build passed to bdist (#10946).
There was already a test for this, but it was complicated and had a
subtle bug (custom command objects need to be put in dist.command_obj so
that other command objects may see them) that rendered it moot.
2011-08-30 01:42:50 +02:00
Éric Araujo 83ab3f319b Remove obsolete mentions of the compress program and .Z archives.
Packaging uses the shutil.make_archive function copied from distutils,
which does not support compress.  There is no test to check that
“bdist --format whatever” works, so this slipped by.
2011-08-30 01:19:02 +02:00
Éric Araujo 5e48c78ecf Remove display options (--name, etc.) from the Distribution class.
These options were used to implement “setup.py --name”,
“setup.py --version”, etc. which are now handled by the pysetup metadata
action or direct parsing of the setup.cfg file.

As a side effect, the Distribution class no longer accepts a 'url' key
in its *attrs* argument: it has to be 'home-page' to be recognized as a
valid metadata field and passed down to the dist.metadata object.

I cleaned up some comments, docstrings and code along the way.
2011-08-30 00:55:02 +02:00
Éric Araujo acddb38602 Cleanup: move code out of a try block 2011-08-30 00:45:59 +02:00
Éric Araujo fb639295ac Print all fields when calling “pysetup metadata” without options.
When called without option (“-f field” or “--all”), “pysetup metadata”
didn’t do anything useful.  Now it prints out all metadata fields.  The
“--all” option is removed.
2011-08-29 22:03:46 +02:00
Éric Araujo b741313ca8 Cleanup: use sys.version_info instead of convoluted hexversion lshifts 2011-08-29 21:43:48 +02:00
Éric Araujo 1329185890 Minor code simplification 2011-08-26 00:05:11 +02:00
Éric Araujo ced7eda717 Another (hopefully last) fix for test_packaging on Windws (#12678) 2011-08-25 18:13:58 +02:00
Éric Araujo e049f470cd Fix test_packaging on Windows (#12678).
See the distutils commit message for more detail.
2011-08-24 02:15:25 +02:00
Éric Araujo 0fe3605cac Try to fix packaging tests using build_ext on Windows (#12678) 2011-08-23 21:38:13 +02:00
Éric Araujo ad457d6d50 Fix test_command_install_dist in shared Python builds 2011-08-21 17:38:56 +02:00
Éric Araujo 2737222b49 Factor out the build_ext fixup for shared Python builds.
I need this to fix the failing test_command_install_dist.
2011-08-21 17:38:36 +02:00
Éric Araujo cd7c3d9d5f Remove obsolete code 2011-08-21 17:37:36 +02:00
Victor Stinner e67474725b Issue #12326: refactor usage of sys.platform
* Use str.startswith(tuple): I didn't know this Python feature, Python rocks!
 * Replace sometimes sys.platform.startswith('linux') with
   sys.platform == 'linux'
 * sys.platform doesn't contain the major version on Cygwin on Mac OS X
   (it's just 'cygwin' and 'darwin')
2011-08-21 00:39:18 +02:00
Éric Araujo 0a733627f9 Add a simple test for the packaging RECORD file.
The existing test_record is not easily extendable to add script files or
extension modules: it collects all files from fake_dists and generates a
RECORD file at runtime.  I felt more comfortable adding a new test
written from scratch more self-contained (just one project with
well-defined files) and more stupid (the checksums and sizes are
computed once and hard-coded).
2011-08-20 09:31:25 +02:00
Éric Araujo ba9b2689be Minor cleanup
- Rename an attribute and create it in initialize_options instead of
  finalize_options to match the other install_* classes
- Remove unnecessary method call in tests
2011-08-20 09:19:25 +02:00
Éric Araujo 540edc6e66 Add a test for extension modules in the old-style record file 2011-08-20 07:42:56 +02:00
Éric Araujo 746e72d59c Rework test_old_record a bit to make the test more exact
(i.e. to check the files found are what we expect)
2011-08-20 07:34:43 +02:00
Éric Araujo 60b0d31e35 Refactor the copying of xxmodule.c in packaging tests (#12141).
I need to copy this file in another test too, so I moved the support
code to distutils.tests.support and improved it to use proper skip
machinery instead of custom print/return/test suite fiddling.

Contrary to my similar change in distutils tests, I did not add support
for finding xxmodule.c when running a test from the tests directory,
because in that case my compiler didn’t find Python.h, so I figured it’s
better to skip than to fail.
2011-08-20 07:27:47 +02:00
Éric Araujo 9bb6dfe0a8 Restore $HOME after test has run (should fix #12765) 2011-08-19 17:47:52 +02:00
Éric Araujo 50e516aa8e Improve “pysetup create” help messages.
The example version numbers were invalid and “package” was misused.  I
also made lines shorter, replaced “e-mail” with “email” (more common in
the stdlib and I believe in English generally) and tweaked a few other
things.
2011-08-19 00:56:57 +02:00
Éric Araujo b931ab4345 Fix typo 2011-08-19 00:53:20 +02:00
Éric Araujo 55b9fe232d Remove class that was only useful with Sphinx autodoc 2011-08-19 00:53:04 +02:00
Éric Araujo 4460abea64 Use our existing drop-in, no-op decorator instead of redefining it.
Patch by Francisco Martin Brugue.
2011-08-12 00:15:41 +02:00
Éric Araujo 29f6297605 Fix wrong use of root logger in packaging (also a NameError) 2011-08-04 17:17:07 +02:00
Éric Araujo b85b966de6 Stop trying to write into the stdlib during packaging tests (#12331).
This prevents tests from failing when run from a Python installed in a
read-only directory.  The code is a bit uglier; shutil.copytree calls
copystat on directories behind our back, so I had to add an os.walk
with os.chmod (*and* os.path.join!) calls.  shutil, I am disappoint.

This changeset is dedicated to the hundreds of neurons that were lost
while I was debugging this on an otherwise fine afternoon.
2011-07-31 20:47:47 +02:00
Éric Araujo bab50cb124 Minor packaging cleanup.
- Use shortcut dist.version instead of going through metadata;
- Use %r throughout to display project names and paths.
2011-07-29 02:37:21 +02:00
Éric Araujo 7b0908a8e4 Make TypeError message from Command.__init__ more useful 2011-07-29 02:32:41 +02:00
Éric Araujo 943006bf68 Let all pysetup actions return a meaningful 0 or 1 exit code (#12222).
This will help scripts calling pysetup know if a command failed.
Printing/logging was also made more consistent, and a few things were
cleaned up.  In particular, the error/Ctrl-C handling was moved from the
_run function up to the main function.

The run action is not fixed yet; it returns the dist.Distribution
instance, which is needed by test_uninstall and not trivial to fix.
2011-07-29 02:31:39 +02:00
Éric Araujo 73c175f5a0 Let pysetup list exit with a non-zero code when no result is found (#11409).
“pysetup list” or “pysetup list --all” will continue to return 0 if no
distribution is found (it’s not an error), but “pysetup list
some.project” will now exit with 1 if no matching installed distribution
is found.  Based on a patch by Kelsey Hightower.
2011-07-29 02:20:39 +02:00
Antoine Pitrou db535957cd test_packaging should clean up after itself (but it doesn't really) 2011-07-15 23:26:19 +02:00
Éric Araujo eb39294101 Silence 2to3 warnings in packaging tests 2011-07-15 17:49:20 +02:00
Éric Araujo fe95848c16 Clear packaging.database caches in place 2011-07-15 17:47:46 +02:00
Éric Araujo 4468e55d4b Close file handles in a timely manner in packaging.database (#12504).
This fixes a bug with the remove (uninstall) feature on Windows.  Patch
by Thomas Holmes.
2011-07-08 17:22:19 +02:00
Éric Araujo ce5fe83878 Factor out code used by packaging commands for HTTP requests (#12169).
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.
2011-07-08 16:27:12 +02:00
Vinay Sajip 0bec35d2d0 Closes #12391: temporary files are now cleaned up. 2011-07-07 12:59:31 +01:00
Ned Deily fceb4120fc Issue #9516: Port the revised deployment target processing for OSX from
distutils to packaging.
2011-06-28 20:04:24 -07:00
Ned Deily 5c727cb978 Issue #9516: Port OS X deployment target tests from distutils to packaging
test_command_build_ext.
2011-06-28 20:03:17 -07:00
Ned Deily 4a1ec12999 Issue #12141: Install copies of template C module file so that
test_build_ext of test_distutils and test_command_build_ext of
test_packaging are no longer silently skipped when
run outside of a build directory.
2011-06-28 00:53:54 -07:00
Éric Araujo 3e425ac64b packaging: Add the project directory to sys.path to support local setup hooks.
Original patch by Vinay Sajip on #11637.
2011-06-19 21:23:43 +02:00
Éric Araujo 348c572dcf Fix typo 2011-06-19 18:53:31 +02:00
Éric Araujo 3c8ca089b1 Make decorators used in packaging preserve docstrings 2011-06-17 21:10:21 +02:00
Éric Araujo 74d68135ad Brange merge 2011-06-17 19:38:38 +02:00
Éric Araujo ed5d2f1310 Minor tweaks to packaging tests.
- Move a tearDown method right after setUp
- Use assertRaises instead of reinventing it
- Skip a test instead of commenting it out, as a reminder
2011-06-17 15:47:41 +02:00
Éric Araujo c06f46f74c Packaging tests: don’t let an internal cache grow indefinitely.
Victor Stinner diagnosed on #12167 that some reference leaks came from
util._path_created, a set used for caching; there are two tests that
cause additions to this set, so now they clear it in tearDown, avoiding
17 refleaks.  (My tests show that it’s necessary to clear the set in
only one test, clearing it in both does not stop more refleaks, but
there’s no harm in doing it.)
2011-06-17 15:43:18 +02:00
Victor Stinner 723993983a Issue #12333: run tests on the new module in a subprocess
It is not possible to unload a module written in C, so use a subprocess to run
the tests on the module compiled by test_build_ext(). Using a subprocess, we
don't have to unload the module, save/restore sys.path, and the test can be run
more than once.

This commit fixes also an access error on rmtree() on Windows: because the
module was not really unloaded, it was not possible to remove the temporary
directory (it is not possible to remove a directory on Windows if it still
contains an open file).
2011-06-17 13:52:56 +02:00
Victor Stinner 0f270b2c37 Issue #12333: close files before removing the directory
packaging.tests.support.TempdirManager: rmtree() fails on Windows if there are
still open files in the directory.
2011-06-17 13:25:53 +02:00
Éric Araujo d2c7e3fe96 Minor tweaks in packaging’s test_dist.
- Use different Metadata objects to write and read a PKG-INFO (METADATA)
  file, to make sure the tested values come from the file

- No need to restore methods on an instance after monkey-patching them:
  the methods are still the same on the class

- Harmonize dedent calls
2011-06-17 13:24:33 +02:00