Commit Graph

253 Commits

Author SHA1 Message Date
Éric Araujo 2fa0cbc9ae Remove buggy change for #13719 in packaging 2012-03-07 20:56:18 +01:00
Éric Araujo b8e280d225 Make packaging’ upload command work with bdist_msi products (#13719) 2012-03-05 17:04:07 +01:00
Éric Araujo 80f7102d43 Improve packaging.database documentation 2012-03-05 16:16:37 +01:00
Éric Araujo 40e0f35ad5 Fix comparison bug with 'rc' versions in packaging.version (#11841).
I added some tests in 2105ab8553b7 and found no bug, but it turns out
that the doctest is not actually run.  While converting the doctest to
unittest style, I stumbled upon this bug again and this time applied the
code patch provided by Filip Gruszczyński.
2012-02-27 11:47:44 +01:00
Éric Araujo 7d32e7e5bc Port the #6884 fix to packaging 2012-02-26 04:01:34 +01:00
Éric Araujo 2180ee641c Fix code I unwittingly broke in b0e2d6592a1f (#14038) 2012-02-17 17:26:30 +01:00
Éric Araujo e8c5fdba30 Add test for packaging.util.set_platform (#13974).
Patch by Tshepang Lekhonkhobe.
2012-02-16 19:32:17 +01:00
Éric Araujo 43df889d63 Fix for packaging test failure on shared builds (#1326113) 2012-02-15 18:14:50 +01:00
Éric Araujo 4575afcb53 Fix parsing of packaging’s build_ext --libraries option (#1326113) 2012-02-15 17:25:25 +01:00
Éric Araujo b9df745ab5 Port the fix for #13193 to packaging 2012-02-12 05:01:42 +01:00
Éric Araujo 9f90a731eb Use sys.version_info instead of sys.version in packaging.
The contents of this attribute are an implementation detail, as
documented for #9442, so we should not parse it, to support non-CPython
VMs with distutils2 in the future.

Unfortunately, one use comes directly from PEP 345, so an edit will have
to be agreed before fixing the code (see comment in p7g.markers).

Other remaining uses are found in p7g.compiler and could be replaced by
the platform module (which also parses sys.version, but then it wouldn’t
be my fault :)
2012-02-10 05:20:53 +01:00
Éric Araujo 692a49394d Start improving 2to3 code in packaging (#13462).
- 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
2012-02-09 21:37:14 +01:00
Éric Araujo 1a765f5d9d Synchronize packaging.tests.support with distutils2 2012-02-09 21:30:25 +01:00
Éric Araujo 6e1f564efa More boolean tests for packaging metadata environment markers 2012-02-09 21:18:26 +01:00
Éric Araujo ac03a2b089 Remove unneeded import 2012-02-09 21:17:46 +01:00
Éric Araujo 5c69b66086 Group commands by topic in “pysetup run --list-commands” output.
This fixes a regression from distutils, where “setup.py --help-commands”
prints out commands grouped by topic (i.e. building vs. installing),
which is more useful than using sorted.
2012-02-09 14:29:11 +01:00
Éric Araujo 2f8c3f7ed7 Fix typos in comments.
Reported by David-Sarah Hopwood on the Bitbucket bug tracker of
Tarek’s former verlib/distutils.version project.
2012-02-06 16:12:21 +01:00
Éric Araujo dcfcb64582 Stop converting package_data to extra_files in pysetup create (#13712).
pysetup create, the setup.cfg creation helper, used to convert
package_data (from an existing setup.py) into extra_files, the
replacement for MANIFEST.in, but these files are only present in sdists,
not installed: they don’t have the same use case at all, so converting
one into the other did not work.
2012-02-05 10:26:16 +01:00
Éric Araujo 31aefde876 Allow multiple values for package_data in setup.cfg (#11805).
Even though the resources system obsoletes data_files and package_data
(see bug discussion), package_data still exists to allow compatibility
with distutils and thus an easier transition.  In setup.py, the values
are lists of glob patterns, so the setup.cfg syntax needed a way to
express multiple values too.

Doc for this option will be added later as part of the big packaging doc
patches.  For now, the test serves as example.

Reported by Erik Bray.
2012-02-04 21:53:07 +01:00
Éric Araujo 591f6e82bd Improve one packaging test, remove a setuptoolism in another 2012-02-04 21:43:07 +01:00
Ned Deily 61c4e10035 Issue #13901: Prevent test_packaging failures on OS X with --enable-shared. 2012-02-03 02:46:37 +01:00
É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