Issue 13205: NameErrors in generated setup.py (codecs, split_multiline) (original) (raw)

Created on 2011-10-18 01:53 by mu_mind, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
fix_nameerrors.patch mu_mind,2011-10-18 01:53
test_command_generate_setup.py mu_mind,2011-10-19 05:35
Messages (8)
msg145768 - (view) Author: David Barnett (mu_mind) Date: 2011-10-18 01:53
The setup.py file currently generated by "pysetup generate-setup" fails to import the "codecs" module, and also uses a split_multiline function from distutils2/utils.py that's undefined in the setup script.
msg145833 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-18 16:19
Thanks! I haven’t tested generate-setup for some time. It would be great to add a regression test for this. Would you like to do it? To mock user input, just copy the Inputs class from test_command_register. If not, I will do it.
msg145837 - (view) Author: David Barnett (mu_mind) Date: 2011-10-18 16:26
Sure, I can give it a go. I'll probably have a chance sometime today.
msg145886 - (view) Author: David Barnett (mu_mind) Date: 2011-10-19 05:35
Regression tests. Not positive that subprocess is the best approach for running these, but it seems to work. In the process of writing tests, I discovered another missing import for PackagingFileError when there's no setup.cfg.
msg145926 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-19 17:54
Excellent, thanks! I’ll move the tests into the existing test_run.py file.
msg146083 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-21 13:52
New changeset 21c33aa2178b by Éric Araujo in branch 'default': Fix missing imports in setup scripts generated by packaging (#13205). http://hg.python.org/cpython/rev/21c33aa2178b
msg146086 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-10-21 13:58
New changeset 5949563b9f1c by Éric Araujo in branch 'default': Fix missing imports in generated setup scripts (#13205). http://hg.python.org/distutils2/rev/5949563b9f1c New changeset eb845a9a00b7 by Éric Araujo in branch 'python3': Merge fix for #13205 and other changes from default. http://hg.python.org/distutils2/rev/eb845a9a00b7
msg146087 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-21 14:01
As you can see in my commit, I made more changes to the code and simplified the tests. subprocess is definitely the way to test script functionality, it’s much cleaner than monkey-patching sys.argv; we even have higher-level helpers to do that in test.script_helper. (BTW, the comment I made about mocking user input in my first reply makes no sense: I was confusing pysetup create and pysetup generate-setup :) I also mistakenly talked about test_run when the correct file was test_util.)
History
Date User Action Args
2022-04-11 14:57:22 admin set github: 57414
2011-10-21 14:01:38 eric.araujo set status: open -> closedresolution: fixedmessages: + stage: test needed -> resolved
2011-10-21 13:58:00 python-dev set messages: +
2011-10-21 13:52:28 python-dev set nosy: + python-devmessages: +
2011-10-19 17:54:19 eric.araujo set messages: +
2011-10-19 05:35:00 mu_mind set files: + test_command_generate_setup.pymessages: +
2011-10-18 16:26:31 mu_mind set messages: +
2011-10-18 16:19:13 eric.araujo set assignee: tarek -> eric.araujostage: test neededmessages: + versions: + 3rd party, Python 3.3, - Python 2.7
2011-10-18 01:53:52 mu_mind create