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: NameErrors in generated setup.py (codecs, split_multiline)
Type: behavior Stage: resolved
Components: Distutils2 Versions: Python 3.3, 3rd party
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: alexis, eric.araujo, mu_mind, python-dev, tarek
Priority: normal Keywords: patch

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:22adminsetgithub: 57414
2011-10-21 14:01:38eric.araujosetstatus: open -> closed
resolution: fixed
messages: + msg146087

stage: test needed -> resolved
2011-10-21 13:58:00python-devsetmessages: + msg146086
2011-10-21 13:52:28python-devsetnosy: + python-dev
messages: + msg146083
2011-10-19 17:54:19eric.araujosetmessages: + msg145926
2011-10-19 05:35:00mu_mindsetfiles: + test_command_generate_setup.py

messages: + msg145886
2011-10-18 16:26:31mu_mindsetmessages: + msg145837
2011-10-18 16:19:13eric.araujosetassignee: tarek -> eric.araujo
stage: test needed
messages: + msg145833
versions: + 3rd party, Python 3.3, - Python 2.7
2011-10-18 01:53:52mu_mindcreate