[issue12420] distutils tests fail if PATH is not defined

2017-06-18 Thread Terry J. Reedy

Terry J. Reedy added the comment:

test_distutils now passes on 3.6, so this is out-of-date for 3.x.

On installed 2.7.13 (released Dec 2016) 
ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
FAIL: test_customize_compiler_before_get_config_vars 
(distutils.tests.test_sysconfig.SysconfigTestCase)
the error is ValueError: [u'path'] instead of ValueError: ['path'].

Nick suggested leaving 2.7 alone, I don't care about it either, and I believe 
Victor Stinner has worked on its tests since last December.

--
assignee: merwok -> 
resolution:  -> out of date
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.4, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2015-09-13 Thread Mark Lawrence

Mark Lawrence added the comment:

"Unable to find vcvarsall.bat" is raised when Visual Studio isn't installed or 
it's the incorrect version, so I don't believe these are the same at all.

--
components:  -Distutils2
nosy: +dstufft

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2015-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The following failures on new 3.5.0 seems related as they all end with the same 
message about vcvarsall.bat (slightly different from 3.4 failures).

==
ERROR: test_get_outputs (distutils.tests.test_build_ext.BuildExtTestCase)
--

==
ERROR: test_optional_extension (distutils.tests.test_build_ext.BuildExtTestCase)
--

==
ERROR: test_get_outputs 
(distutils.tests.test_build_ext.ParallelBuildExtTestCase)
--

==
ERROR: test_optional_extension 
(distutils.tests.test_build_ext.ParallelBuildExtTestCase)
--

==
ERROR: test_compiler_options 
(distutils.tests.test_msvccompiler.msvccompilerTestCase)
--

==
ERROR: test_vcruntime_copy 
(distutils.tests.test_msvccompiler.msvccompilerTestCase)
--

==
ERROR: test_vcruntime_skip_copy 
(distutils.tests.test_msvccompiler.msvccompilerTestCase)
--

==
FAIL: test_customize_compiler_before_get_config_vars 
(distutils.tests.test_sysconfig.SysconfigTestCase)
--
Traceback (most recent call last):
  File "C:\Programs\Python 3.5\lib\distutils\tests\test_sysconfig.py", line 
197, in test_customize_compiler_before_get_c
onfig_vars
self.assertEqual(0, p.returncode, "Subprocess failed: " + outs)
AssertionError: 0 != 1 : Subprocess failed: Traceback (most recent call last):
  File "@test_5504_tmp", line 5, in 
rc = config.try_compile('int x;')
  File "C:\Programs\Python 3.5\lib\distutils\command\config.py", line 227, in 
try_compile
self._compile(body, headers, include_dirs, lang)
  File "C:\Programs\Python 3.5\lib\distutils\command\config.py", line 133, in 
_compile
self.compiler.compile([src], include_dirs=include_dirs)
  File "C:\Programs\Python 3.5\lib\distutils\_msvccompiler.py", line 315, in 
compile
self.initialize()
  File "C:\Programs\Python 3.5\lib\distutils\_msvccompiler.py", line 208, in 
initialize
vc_env = _get_vc_env(plat_spec)
  File "C:\Programs\Python 3.5\lib\distutils\_msvccompiler.py", line 83, in 
_get_vc_env
raise DistutilsPlatformError("Unable to find vcvarsall.bat")
distutils.errors.DistutilsPlatformError: Unable to find vcvarsall.bat


--
Ran 234 tests in 1.108s

FAILED (failures=1, errors=7, skipped=28)
Warning -- threading._dangling was modified by test_distutils
Warning -- files was modified by test_distutils

--
nosy: +steve.dower, zach.ware

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2015-09-13 Thread Zachary Ware

Zachary Ware added the comment:

Agreed with Mark; I don't see anywhere that lack of PATH would affect the 
failures you're seeing, Terry.  Do you have VS2015 installed?  If not, the 
failure of distutils to skip the tests that need it should be raised as a 
separate issue.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2015-09-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

No VS2015 yet.  New issue #25100.  Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-28 Thread Nick Coghlan

Nick Coghlan added the comment:

For Python 3, I suggest tweaking the code to use shutil.which and see if that 
improves matters.

For Python 2, I'm inclined not to worry about it.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-28 Thread Nick Coghlan

Nick Coghlan added the comment:

Skipping if the compiler isn't available is problematic, since that could 
reflect a real failure mode for the code.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I feel that conscientious users who test their installations should get a clean 
test. They cannot be expected to know that this is an 'expected failure' and 
therefore not really a failure.

Test_tools has the following, which indeed works to skip on installed 3.4.1 but 
not on built 3.4.1+.

if not sysconfig.is_python_build():
# XXX some installers do contain the tools, should we detect that
# and run the tests in that case too?
raise unittest.SkipTest('test irrelevant for an installed Python')

How about we decorate the two failing tests
   line 156, in test_optional_extension # or
   line 316, in test_get_outputs
with
@unittest.skipUnless(sysconfig.is_python_build(),
'test irrelevant for an installed Python')  # or modify message
?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

A minor change: distutils has is own version of sysconfig*, which is already 
imported into disutils/tests/test_build_ext.py. It has '_python_build' instead 
of 'is_python_build'. With that change, the decorators work as expected to skip 
the tests on installed Windows 3.4.1 either when test_build_ext is run by 
itself as main or as part of test_distutils.

# Seems like a violation of DRY. According to hg revision history, (and 
visually comparing the two, some patches have been applied to just one, some to 
both.

--
stage:  - patch review

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-28 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
versions: +Python 3.5 -Python 3.3
Added file: http://bugs.python.org/file35798/distutils-12420.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-27 Thread Mark Lawrence

Mark Lawrence added the comment:

Can someone follow up on this please.  See also #12401.

--
nosy: +BreamoreBoy

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2014-06-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

test_disutils still fails on both 2.7 and 3.4 installs. Since PATH is defined, 
that is not the issue here. I am tempted to unconditionally skip the test and 
close this issue.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2013-09-01 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I just ran into this issue (same I believe) running the test suite with 
installed, versus repository, python on win7, but get a different traceback.

Traceback (most recent call last):
 ...\lib\distutils\tests\test_build_ext.py
   line 156, in test_optional_extension # or
   line 316, in test_get_outputs
cmd.run)  # should raise an error
 ...\lib\unittest\case.py, line 570, in assertRaises
return context.handle('assertRaises', callableObj, args, kwargs)
 ...\lib\unittest\case.py, line 135, in handle
callable_obj(*args, **kwargs)
 ...\lib\distutils\command\build_ext.py, line 354, in run
self.build_extensions()
 ...\lib\distutils\command\build_ext.py, line 463, in build_extensions
self.build_extension(ext)
 ...\lib\distutils\command\build_ext.py, line 518, in build_extension
depends=ext.depends)
 ...\lib\distutils\msvc9compiler.py, line 460, in compile
self.initialize()
 ...\lib\distutils\msvc9compiler.py, line 371, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
 ...\lib\distutils\msvc9compiler.py, line 287, in query_vcvarsall
raise ValueError(str(list(result.keys(
ValueError: ['path']

I agree with  Éric that the test should be skipped if it cannot go on.
Wrapping
self.assertRaises((UnknownFileError, CompileError),
  cmd.run)  # should raise an error
and
cmd.run()
with
try:...except ValueError: skip would fix this issue on Windows. So would 
skipping if sys.platform == 'win32' and '+' not in sys.version (repository 
builds have a '+' and the test currently work for them).  However, neither 
solution would work on *nix, which seems to have a completely different failure 
path to the same end result.

Are distutils and test_distutils maintained at all? msvc9compiler.py (2005) 
says it also works with vc10 (2008, used for 2.7) but makes no mention of vc11 
(2010, used for 3.3,3.4).

Nick, what do you think we should do with this? I think that when python is 
installed and working as well as we expect, the test suite should pass, so any 
failures indicate a problem with the particular installation. I think this is 
especially important on Windows, with newbies who do not know distutils from, 
say, itertools.

--
nosy: +ncoghlan, terry.reedy
versions: +Python 3.4 -Python 3.2

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-07-11 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Sorry, I don’t want to monkey-patch find_executable during tests.  We want the 
tests to work with the real code, with the same behavior and errors as real 
setup.py calls.  If a test does not work with python -E, then it should be 
skipped.

(Implementation idea:
  skip_if_empty_env = unittest.skipUnless(
  os.environ, 'test cannot run with an empty environment')
using sys.flags is not possible due to backward compatibility policy)

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Changes by Henry Precheur he...@precheur.org:


--
title: distutils crashes if PATH is not defined - distutils tests fail if PATH 
is not defined

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

To explain my position: distutils is a very brittle codebase that’s used and 
monkey-patched by a lot of third-party code.  In the past, before the forking 
of distutils/packaging, Tarek tried to gradually improve distutils but he got a 
lot of pushback when his changes broke this third-party code that relied on 
known bugs or undocumented behavior or worked around it.  That’s why a feature 
freeze is now in effect, and behavior is not changed unless it is to fix a bug.

In this case, it is not documented that distutils should run under python -E, 
and nobody reported it as a bug before, that’s why I have the position that the 
tests that require $PATH should be skipped, and the code left untouched.

For distutils2 (named packaging in the 3.3 standard library), we can improve 
find_executable.  We even want to extract it and move it to shutil: #444582

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

OK it makes sense.

I'm working on fixing the tests. I'm not done yet, but I've attached a patch 
with my work in progress (some tests still fail). Do you have any comments?

I'll post a complete version later today or tomorrow.

--
Added file: http://bugs.python.org/file22501/fix_distutils_test.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Changes by Henry Precheur he...@precheur.org:


Removed file: http://bugs.python.org/file22501/fix_distutils_test.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue12420] distutils tests fail if PATH is not defined

2011-06-27 Thread Henry Precheur

Henry Precheur he...@precheur.org added the comment:

I've fixed the last failing tests, but I'm unsure it's the right way to do it.

Take a look at the part for Lib/distutils/tests/test_build_ext.py. I just check 
that os.environ['PATH'] is defined. I'm not 100% certain that this will work on 
every platforms.

--
Added file: http://bugs.python.org/file22504/fix_distutils_tests.diff

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12420
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com