This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Miscellaneous bugs in cfg_to_args() utility function
Type: behavior Stage: resolved
Components: Distutils2 Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, erik.bray, python-dev, tarek
Priority: normal Keywords: patch

Created on 2011-03-18 16:38 by erik.bray, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
cfg_to_args.patch erik.bray, 2011-03-18 16:38
issue11595-2.patch erik.bray, 2011-06-07 19:47 Updated patch for packaging review
issue11595-3.patch erik.bray, 2011-06-09 16:36 Updated patch for packaging, with fixes to previous patch review
Messages (11)
msg131336 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2011-03-18 16:38
Attached is a patch that fixes a few miscellaneous bugs in cfg_to_args() that were holding me up. Namely:
 * A bad variable name (file -> path)
 * A few more fields needed to be in MULTI_FIELDS
 * Added support for packages_root -> package_dir conversion

This also adds a unit test for cfg_to_args().
msg131347 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-18 18:09
Looks good to me (note: didn’t test).
msg131660 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2011-03-21 14:44
I've got an additional patch to this function that also adds support for the package_data option, for extension modules (at least as they are currently specified in setup.cfg), and adds support for running setup_hook.

The only problem is that it's starting to copy more and more from distutils2.config.Config.  The difference being that it's still simpler, and doesn't depend on much else from distutils2.  The reason being that I'm using this in my own packages so that I can distutils2-like setup.cfgs, but still install with normal distutils and/or Distribute without depending on distutils2 in its entirety.

I'm wondering if there might be a better way to proceed, or if this sort of compatibility support is even useful to anyone else.
msg131703 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-21 23:06
I don’t really follow what you’re saying, sorry.  Anyway, it looks like a feature request separate from this bug, let’s keep things distinct :)

You can write to the ML, add a todo entry or another bug about your other thing.
msg131776 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-03-22 20:22
Another bug: the extracted author_email value is wrong.
msg137870 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-07 17:47
Can you refresh your patch for packaging?
msg137879 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2011-06-07 19:47
Done.  Also added support for multi-valued description-file values.
msg138013 - (view) Author: Erik Bray (erik.bray) * (Python triager) Date: 2011-06-09 16:36
Thanks Eric for your review.  Obviously the last patch was rushed, and I didn't even run the tests.  It also got my changes for issue12240 mixed into it.  So I've gone ahead and attached an updated patch which incorporates your review comments.
msg138173 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-06-11 18:01
New changeset 303e3693d634 by Éric Araujo in branch 'default':
Move useful function to packaging.util.
http://hg.python.org/cpython/rev/303e3693d634

New changeset 06670bd0e59e by Éric Araujo in branch 'default':
Fix assorted bugs in packaging.util.cfg_to_args (#11595).
http://hg.python.org/cpython/rev/06670bd0e59e
msg138177 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-06-11 18:06
Thanks again!
msg140674 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-07-19 15:08
> The reason being that I'm using this in my own packages so that I can
> distutils2-like setup.cfgs, but still install with normal distutils
> and/or Distribute without depending on distutils2 in its entirety.
>
> I'm wondering if there might be a better way to proceed, or if this
> sort of compatibility support is even useful to anyone else.

I think that now I understand what you meant here.  You should not have to duplicate distutils2 code in legacy setup.py scripts: “pysetup generate-setup” will create a setup script that can find information in the setup.cfg file (so that you only have to update one file), without depending on distutils2 code (it uses inspect.getsource to copy the cfg_to_args function into setup.py).
History
Date User Action Args
2022-04-11 14:57:15adminsetgithub: 55804
2011-07-19 15:08:42eric.araujosetmessages: + msg140674
2011-06-11 18:06:06eric.araujosetstatus: open -> closed
resolution: fixed
messages: + msg138177

stage: patch review -> resolved
2011-06-11 18:01:43python-devsetnosy: + python-dev
messages: + msg138173
2011-06-09 16:36:46erik.braysetfiles: + issue11595-3.patch

messages: + msg138013
2011-06-07 19:47:19erik.braysetfiles: + issue11595-2.patch

messages: + msg137879
2011-06-07 17:47:03eric.araujosetversions: + Python 3.3, - 3rd party
messages: + msg137870

assignee: tarek -> eric.araujo
type: behavior
stage: patch review
2011-03-22 20:22:15eric.araujosetnosy: tarek, eric.araujo, alexis, erik.bray
messages: + msg131776
2011-03-21 23:06:04eric.araujosetnosy: tarek, eric.araujo, alexis, erik.bray
messages: + msg131703
2011-03-21 14:44:50erik.braysetnosy: tarek, eric.araujo, alexis, erik.bray
messages: + msg131660
2011-03-18 18:09:46eric.araujosetnosy: tarek, eric.araujo, alexis, erik.bray
messages: + msg131347
versions: + 3rd party
2011-03-18 16:38:37erik.braycreate