Commit Graph

232 Commits

Author SHA1 Message Date
Éric Araujo 54e26c01b0 Update list of trove classifiers 2011-11-20 16:01:35 +01:00
Éric Araujo 4d15546504 Remove obsolete verbose arguments from packaging.
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.
2011-11-15 11:43:20 +01:00
Éric Araujo 9b5c7f44fa Remove unused code from packaging.tests.__init__ 2011-11-15 10:48:36 +01:00
Éric Araujo 36500344b2 Remove redundant setUp/tearDown methods in packaging tests 2011-11-14 19:46:31 +01:00
Éric Araujo acc0952ff8 The error message should contain the key as given, not normalized.
Backout of 2e047702df7f.  Reported by Jeremy Kloth.
2011-11-14 19:45:30 +01:00
Éric Araujo 618b73035a Add tests to check initial content of packaging.database caches 2011-11-14 19:43:37 +01:00
Éric Araujo e749e21948 packaging cleanup: A few super I missed in 5ae03b1e147a 2011-11-14 19:40:31 +01:00
Éric Araujo 0efc419d4a Adapt test and example after e39d1b6f0856.
Tarek’s commit fixed the way packaging configuration file markers are
split under Windows, but these two files were not edited.
2011-11-14 18:21:38 +01:00
Éric Araujo bfc972974b Fix a few typos 2011-11-14 18:18:15 +01:00
Éric Araujo f8361623f0 Clean up byte-compilation code in packaging (#11254 followup).
- 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)
2011-11-14 18:10:19 +01:00
Antoine Pitrou 61093c0ced Issue #13193: Fix distutils.filelist.FileList and
packaging.manifest.Manifest under Windows.  The "recursive-include"
directive now recognizes both legal path separators.
2011-11-12 01:27:19 +01:00
Florent Xicluna e41f0de84d Merge 3.2, fix typos. 2011-11-11 19:39:25 +01:00
Éric Araujo 438f21a406 Use more standard name for one option of packaging’s install_distinfo 2011-11-06 11:52:30 +01:00
Éric Araujo ca9460324a Remove redundant __main__ blocks from packaging modules.
The one interface we commit to maintain is the run module
(a.k.a. the pysetup script).
2011-11-06 11:38:58 +01:00
Éric Araujo fad46e19b4 Clean up mocking of stdout and stdin in packaging tests.
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.
2011-11-06 11:32:47 +01:00
Éric Araujo 261ccdce48 Minor tweak to packaging tests.
When an option is changed on a command object, calling ensure_finalized
for a second time will not run finalize_options again, because
ensure_finalized is a no-op the second time.  By resetting the finalized
attribute, we can be sure that whatever computation takes place in
finalize_options will happen again.

(In test_command_clean, I removed two lines that were a no-op.)
2011-11-06 10:48:55 +01:00
Éric Araujo a963e0d917 Undo potentially confusing name change in packaging.
This method was named reinitialize_command in distutils and accompanied
by a comment suggesting to change it to get_reinitialized_command.
Following that, I did the change for distutils2, but it proved
confusing: The Distribution object has an internal cache of command
objects, to make sure only one instance is ever used, and the name
get_reinitialized_command could suggest that the object returned was
independent of that cache, which it was not.  I’m reverting the name
change to make code clearer.
2011-11-06 06:54:05 +01:00
Éric Araujo 4e377f215d Make sure packaging tests that register custom commands also clear them 2011-11-06 07:01:18 +01:00
Éric Araujo 03b0819389 Try to fix buildbot failures from #13193 2011-11-05 17:51:52 +01:00
Éric Araujo 7855a1abec Actually check the contents of the file created by packaging’s bdist_dumb 2011-11-03 06:00:02 +01:00
Éric Araujo 880801501b Improve byte-compilation in packaging to be independent of -O or -B.
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.
2011-11-03 05:08:28 +01:00
Éric Araujo dfd232898d Minor code reorganization in one packaging test file 2011-11-03 00:20:03 +01:00
Éric Araujo 9ad81a3591 Fix typo “seperate” 2011-11-03 00:13:05 +01:00
Florent Xicluna aabbda5354 Merge 3.2 2011-10-28 14:52:29 +02:00
Éric Araujo 89d3a69d83 Add tests for packaging.tests.support (#12659).
Thanks to Francisco Martín Brugué for the patch.
2011-10-21 07:56:32 +02:00
Éric Araujo f89ebdc358 Fix missing imports in setup scripts generated by packaging (#13205).
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.
2011-10-21 06:27:06 +02:00
Éric Araujo 3bb8be6d78 Branch merge 2011-10-19 21:32:39 +02:00
Éric Araujo 784cd4cc54 Make one function in packaging.metadata simpler 2011-10-19 08:50:49 +02:00
Éric Araujo f3f283a1cb Clean up some idioms in packaging tests.
- 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
2011-10-19 08:49:20 +02:00
Éric Araujo 382067b3cf Change signature of packaging.tests.support.LoggingCatcher.get_logs.
I need this for some tests, and it makes code clearer.  This commit also
changes some assertEqual calls to use (actual, expected) order and fix
some pyflakes warnings.
2011-10-19 08:37:22 +02:00
Éric Araujo 4b5a5f7bd5 More fixes for PEP 3147 compliance in packaging (#11254) 2011-10-19 08:18:05 +02:00
Éric Araujo 8ccd18fff3 Expand tests and fix bugs in packaging.util.resolve_name.
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.
2011-10-19 06:46:13 +02:00
Łukasz Langa 318909b297 A ricochet from fixing #10680: http://http://example.com/ no longer reports
'nonnumeric port'. It parses to a host name of "http:" which is equivalent to
http:80.
2011-10-19 02:40:48 +02:00
Éric Araujo 8022314fc2 Cleanup in packaging: super considered super 2011-10-14 17:04:39 +02:00
Éric Araujo d139b99426 Fix writing of the RESOURCES file by packaging (#12386) 2011-10-14 16:58:23 +02:00
Éric Araujo aa2cb3a530 Increase test coverage for packaging.manifest (#11751).
Patch by Justin Love.
2011-10-11 03:06:16 +02:00
Éric Araujo 30cc65460e Add tests for Unicode handling in packaging’ check and register (#13114) 2011-10-11 02:18:12 +02:00
Éric Araujo a29e4f64c1 Fix packaging byte-compilation to comply with PEP 3147 (#11254).
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.
2011-10-08 04:09:15 +02:00
Éric Araujo 73b1e7dd20 Make C code in one packaging test comply with ISO C (#10359).
Patch by Hallvard B Furuseth.
2011-10-08 02:58:50 +02:00
Éric Araujo 6fd287e6c2 Fix return code of “pysetup run COMMAND” (closes #12222) 2011-10-06 05:28:56 +02:00
Éric Araujo 8ed34a130e Minor: improve one test name, address pyflakes warnings 2011-10-06 05:18:41 +02:00
Éric Araujo fa23cc842c Add test that was promised in a comment but not actually written 2011-10-06 05:15:09 +02:00
Éric Araujo 9556a5bab2 Fix incorrect test.
The packaging.install.remove function (a.k.a. the uninstall feature)
takes a path argument to allow client code to use custom directories
instead of sys.path.  The test used to give self.root_dir as path, which
corresponds to a prefix option, but prefix is not on sys.path, it’s only
the base directory used to compute the stdlib and site-packages
directory paths.  The test now gives a valid site-packages path to the
function.
2011-10-06 05:10:09 +02:00
Éric Araujo 2c30e3999c Change one name in packaging’s test_uninstall to avoid confusion.
install_lib may be the name of a module, a command or an option, so I
find it clearer to use site_packages to refer to a string object
containing the path of the site-packages directory created in a
temporary directory during tests.
2011-10-06 04:59:41 +02:00
Éric Araujo c4637714b0 Cosmetic fixes for whitespace and a regex in packaging.
The goal of the regex is to catch a (alpha), b (beta), c or rc
(release candidate), so the existing pattern puzzled me. Tests were
OK before and after the change.
2011-10-05 01:46:37 +02:00
Éric Araujo 763cc6eaee Add tests for comparing candidate and final versions in packaging (#11841).
This used to be buggy; Filip Gruszczyński contributed tests and a code
patch but the latter is not needed.
2011-10-05 01:41:14 +02:00
Éric Araujo dd2d55c8a1 Remove two unneeded attributes in packaging 2011-09-21 16:28:03 +02:00
Éric Araujo 4c0b7070ce Squash last tempdir leak in packaging tests.
Sweet taste of victory!  Alexis, you can fix the threads leaks :)
2011-09-19 20:57:52 +02:00
Éric Araujo 1cbd2ab404 Avoid matching '' or 'yn' when asking for 'y' or 'n' in interactive code 2011-09-19 16:21:37 +02:00
Éric Araujo 505f0ebf88 Final bag of small changes coming from distutils2.
- minor cleanup in Metadata
- trigger creation of the sysconfig._CONFIG_VARS dict
- home_page is used over home-page: it’s not a compound word, it’s an
  escaped space

Distutils2 is now synchronized with Packaging.
2011-09-19 15:12:23 +02:00