-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DistutilsGetoptError: invalid long option 'exclude-dir=': must be a string of length >= 2 #4
Comments
Interesting. It looks like something related to the way I approached py3ification, unicode, and getopt. I'll need to investigate further. That being said, I don't believe python setup.py nosetests ever worked error free since I include one always failing test that is only excluded through setup.py test using Nose's PluginTester. |
Worked great for us prior to last release. Maybe I can bring up a test case that installs 0.3.0... Let me check. |
Yup, worked on 0.3.0: https://travis-ci.org/mat128/nose-exclude-demo/builds/76495668 |
I don't know too much about the Travis environment (or maybe tox?), but it doesn't look like those builds are actually running any tests at all, whereas if I run the command from a shell (py27 @ 0.3.0) I get:
https://travis-ci.org/kgrandis/nose-exclude/jobs/76376881 (@0.4.0) shows tests being run. |
I think if you wanted to use nosetests.py proper, you would need something like |
In the travis test results, you dont see any test being run because I purposefully built the smallest possible test, providing only a virtualenv, nose and nose-exclude. Simply running this through setup.py nosetests (without specifying any exclude-dir) resulted in a crash. I did more research and found new stuff:
|
excellent. thanks for the legwork. I'll review and try to get this released this weekend. |
Fixes #11. Closes #12. See also kgrandis/nose-exclude#4
When invoking through setup.py nosetests (instead of nosetests directly), the following error message is provided, even if no exclude dirs are specified.
py27 runtests: commands[0] | python setup.py nosetests
Traceback (most recent call last):
File "setup.py", line 3, in
setup()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 138, in setup
ok = dist.parse_command_line()
File "/Users/mmitchell/projects/nose-exclude-demo/.tox/py27/lib/python2.7/site-packages/setuptools/dist.py", line 271, in parse_command_line
result = _Distribution.parse_command_line(self)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 467, in parse_command_line
args = self._parse_command_opts(parser, args)
File "/Users/mmitchell/projects/nose-exclude-demo/.tox/py27/lib/python2.7/site-packages/setuptools/dist.py", line 555, in _parse_command_opts
nargs = _Distribution._parse_command_opts(self, parser, args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 564, in _parse_command_opts
(args, opts) = parser.getopt(args[1:])
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/fancy_getopt.py", line 253, in getopt
self._grok_option_table()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/fancy_getopt.py", line 171, in _grok_option_table
"must be a string of length >= 2") % long
distutils.errors.DistutilsGetoptError: invalid long option 'exclude-dir=': must be a string of length >= 2
ERROR: InvocationError: '/Users/mmitchell/projects/nose-exclude-demo/.tox/py27/bin/python setup.py nosetests'
I setup a demo repository to reproduce the issue (simply run tox -r):
https://github.com/mat128/nose-exclude-demo
And a travis-ci job to demonstrate it:
https://travis-ci.org/mat128/nose-exclude-demo
This happens only after 0.4.0 was released.
Thank you
The text was updated successfully, but these errors were encountered: