Skip to content
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

[BUG] 60.1.0: pytest fails on collecting Windows specific units on Linux #2967

Closed
1 task done
kloczek opened this issue Dec 25, 2021 · 5 comments
Closed
1 task done

Comments

@kloczek
Copy link

kloczek commented Dec 25, 2021

setuptools version

60.1.0

Python version

3.8.12

OS

Linux/x86_64

Additional environment information

No response

Description

Looks like pytest is failing on collecting phase on _distutils/ units which are Windows specyfic.
I thinlk tjat tjey should be marked to skip on non-Windows systems.

Expected behavior

Windows specific units should be collected only when pytest is executes in Windows build env.

How to Reproduce

Just run pytest in non-Windows build env.

Output

+ pytest -ra -p no:randomly --pyargs setuptools.tests setuptools
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/setuptools-60.1.0, configfile: pytest.ini
plugins: forked-1.4.0, xdist-2.5.0, shutil-1.7.0, virtualenv-1.7.0, cov-3.0.0, flake8-1.0.7
collected 1010 items / 3 errors / 2 skipped / 1005 selected

================================================================================== ERRORS ==================================================================================
_______________________________________________________________ ERROR collecting _distutils/msvc9compiler.py _______________________________________________________________
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/msvc9compiler.py:26: in <module>
    import winreg
E   ModuleNotFoundError: No module named 'winreg'
_____________________________________________________________ ERROR collecting _distutils/command/bdist_msi.py _____________________________________________________________
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/bdist_msi.py:19: in <module>
    import msilib
E   ModuleNotFoundError: No module named 'msilib'
______________________________________________________________ ERROR collecting _distutils/tests/test_dist.py ______________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/python.py:766: in collect
    self.warn(
/usr/lib/python3.8/site-packages/_pytest/nodes.py:230: in warn
    warnings.warn_explicit(
E   pytest.PytestCollectionWarning: cannot collect test class 'TestDistribution' because it has a __init__ constructor (from: _distutils/tests/test_dist.py)
========================================================================= short test summary info ==========================================================================
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler': No module named 'winreg'
ERROR _distutils/msvc9compiler.py - ModuleNotFoundError: No module named 'winreg'
ERROR _distutils/command/bdist_msi.py - ModuleNotFoundError: No module named 'msilib'
ERROR _distutils/tests/test_dist.py::TestDistribution - pytest.PytestCollectionWarning: cannot collect test class 'TestDistribution' because it has a __init__ constructo...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 3 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
======================================================================= 2 skipped, 3 errors in 2.70s =======================================================================

Code of Conduct

  • I agree to follow the PSF Code of Conduct
@kloczek kloczek added bug Needs Triage Issues that need to be evaluated for severity and status. labels Dec 25, 2021
@kloczek kloczek changed the title [BUG] 60.1.0: pytest fails fails on collecting Winsows specyfic units on Linux [BUG] 60.1.0: pytest fails on collecting Windows specific units on Linux Dec 25, 2021
@kloczek
Copy link
Author

kloczek commented Dec 25, 2021

One more thing.
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

I was able to start pytest only after remove setuptools/_distutils/{msvc9compiler.py,/command/bdist_msi.py,tests/test_dist.py} files from </install/prefix>.
Even with that I see that a lot of units are failing.
I'm not sure does it mean that someting should be changed in my testing procedure which have been working with 59.x.x or it means that something is missing in my python-setuptools.spec BuildRequires.

Here is the begin and end of the pytest output (please let me know if you want to have look on full output which is quite log):

+ cd setuptools-60.1.0
+ /usr/bin/rm /home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/msvc9compiler.py /home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils//command/bdist_msi.py /home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_dist.py
+ PYTHONDONTWRITEBYTECODE=1
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ pytest -ra -p no:randomly setuptools --pyargs setuptools.tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/setuptools-60.1.0, configfile: pytest.ini
plugins: asyncio-0.16.0, tornado-0.8.1, forked-1.4.0, shutil-1.7.0, virtualenv-1.7.0, cov-3.0.0, flake8-1.0.7, xdist-2.5.0, checkdocs-2.7.1
collected 979 items / 2 skipped / 977 selected

dist.py .                                                                                                                                                            [  0%]
namespaces.py .                                                                                                                                                      [  0%]
package_index.py ..                                                                                                                                                  [  0%]
sandbox.py .                                                                                                                                                         [  0%]
_distutils/versionpredicate.py ..                                                                                                                                    [  0%]
_distutils/command/sdist.py .                                                                                                                                        [  0%]
_distutils/tests/test_archive_util.py ....................                                                                                                           [  2%]
_distutils/tests/test_bdist.py F..                                                                                                                                   [  3%]
_distutils/tests/test_bdist_dumb.py F.                                                                                                                               [  3%]
_distutils/tests/test_bdist_msi.py s.                                                                                                                                [  3%]
_distutils/tests/test_bdist_rpm.py FF.                                                                                                                               [  3%]
_distutils/tests/test_bdist_wininst.py s.                                                                                                                            [  4%]
_distutils/tests/test_build.py ..                                                                                                                                    [  4%]
_distutils/tests/test_build_clib.py ......                                                                                                                           [  4%]
_distutils/tests/test_build_ext.py s..sss........s..sss.........                                                                                                     [  7%]
_distutils/tests/test_build_py.py ss.F...                                                                                                                            [  8%]
_distutils/tests/test_build_scripts.py ....                                                                                                                          [  8%]
_distutils/tests/test_check.py ..FF..                                                                                                                                [  9%]
_distutils/tests/test_clean.py ..                                                                                                                                    [  9%]
_distutils/tests/test_cmd.py F.......                                                                                                                                [ 10%]
_distutils/tests/test_config.py ....                                                                                                                                 [ 11%]
_distutils/tests/test_config_cmd.py .....                                                                                                                            [ 11%]
_distutils/tests/test_core.py .FF...F.                                                                                                                               [ 12%]
_distutils/tests/test_cygwinccompiler.py ...                                                                                                                         [ 12%]
_distutils/tests/test_dep_util.py ....                                                                                                                               [ 13%]
_distutils/tests/test_dir_util.py F..F.F..                                                                                                                           [ 13%]
_distutils/tests/test_extension.py .F.                                                                                                                               [ 14%]
_distutils/tests/test_file_util.py ......                                                                                                                            [ 14%]
_distutils/tests/test_filelist.py F...F.........                                                                                                                     [ 16%]
_distutils/tests/test_install.py F...Fs..                                                                                                                            [ 17%]
_distutils/tests/test_install_data.py ..                                                                                                                             [ 17%]
_distutils/tests/test_install_headers.py ..                                                                                                                          [ 17%]
_distutils/tests/test_install_lib.py sF....                                                                                                                          [ 18%]
_distutils/tests/test_install_scripts.py ...                                                                                                                         [ 18%]
_distutils/tests/test_log.py ..                                                                                                                                      [ 18%]
_distutils/tests/test_msvc9compiler.py ssss.                                                                                                                         [ 19%]
_distutils/tests/test_msvccompiler.py ssss.F.                                                                                                                        [ 19%]
_distutils/tests/test_register.py FFFFFFFFF.                                                                                                                         [ 20%]
_distutils/tests/test_sdist.py ....FFs.....F...                                                                                                                      [ 22%]
_distutils/tests/test_spawn.py ....                                                                                                                                  [ 22%]
_distutils/tests/test_sysconfig.py ..........s....                                                                                                                   [ 24%]
_distutils/tests/test_text_file.py ..                                                                                                                                [ 24%]
_distutils/tests/test_unixccompiler.py ...F.                                                                                                                         [ 25%]
_distutils/tests/test_upload.py ..F..F.                                                                                                                              [ 25%]
_distutils/tests/test_util.py .FF........                                                                                                                            [ 26%]
_distutils/tests/test_version.py ....                                                                                                                                [ 27%]
_distutils/tests/test_versionpredicate.py .                                                                                                                          [ 27%]
_vendor/ordered_set.py ......................                                                                                                                        [ 29%]
_vendor/more_itertools/more.py ..........F.......................F.F.......................F....................                                                     [ 37%]
_vendor/more_itertools/recipes.py ..............F..ssss.......                                                                                                       [ 40%]
command/develop.py .                                                                                                                                                 [ 40%]
command/install_lib.py .                                                                                                                                             [ 41%]
tests/test_archive_util.py X                                                                                                                                         [ 41%]
tests/test_bdist_deprecations.py .                                                                                                                                   [ 41%]
tests/test_bdist_egg.py .x                                                                                                                                           [ 41%]
tests/test_build_clib.py .                                                                                                                                           [ 41%]
tests/test_build_ext.py ....                                                                                                                                         [ 41%]
tests/test_build_meta.py ......................................................................................................................................      [ 55%]
tests/test_build_py.py ...                                                                                                                                           [ 55%]
tests/test_config.py .............................................                                                                                                   [ 60%]
tests/test_dep_util.py .                                                                                                                                             [ 60%]
tests/test_depends.py F                                                                                                                                              [ 60%]
tests/test_develop.py s....F                                                                                                                                         [ 61%]
tests/test_dist.py F......x...x..........................                                                                                                            [ 65%]
tests/test_dist_info.py ..                                                                                                                                           [ 65%]
tests/test_distutils_adoption.py ...                                                                                                                                 [ 65%]
tests/test_easy_install.py .FF..FFF......FF.F..FFFFFFFFFFFFFFFFFFF.........                                                                                          [ 70%]
tests/test_egg_info.py .........................x...............................................                                                                     [ 78%]
tests/test_extern.py ...                                                                                                                                             [ 78%]
tests/test_find_packages.py ............                                                                                                                             [ 79%]
tests/test_glob.py ....                                                                                                                                              [ 80%]
tests/test_install_scripts.py .s.s                                                                                                                                   [ 80%]
tests/test_integration.py sssss                                                                                                                                      [ 81%]
tests/test_manifest.py ...................................................................                                                                           [ 87%]
tests/test_msvc14.py ssss                                                                                                                                            [ 88%]
tests/test_namespaces.py ....                                                                                                                                        [ 88%]
tests/test_packageindex.py ....F...............                                                                                                                      [ 90%]
tests/test_register.py .                                                                                                                                             [ 90%]
tests/test_sandbox.py ..........                                                                                                                                     [ 91%]
tests/test_sdist.py .................                                                                                                                                [ 93%]
tests/test_setopt.py ..                                                                                                                                              [ 93%]
tests/test_setuptools.py ...F........F........                                                                                                                       [ 95%]
tests/test_sphinx_upload_docs.py .                                                                                                                                   [ 96%]
tests/test_test.py .                                                                                                                                                 [ 96%]
tests/test_unicode_utils.py .                                                                                                                                        [ 96%]
tests/test_upload.py .                                                                                                                                               [ 96%]
tests/test_upload_docs.py ..                                                                                                                                         [ 96%]
tests/test_virtualenv.py ..x......                                                                                                                                   [ 97%]
tests/test_wheel.py ......................                                                                                                                           [ 99%]
tests/test_windows_wrappers.py sss                                                                                                                                   [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ BuildTestCase.test_formats ________________________________________________________________________

self = <setuptools._distutils.tests.test_bdist.BuildTestCase testMethod=test_formats>

    def test_formats(self):
        # let's create a command and make sure
        # we can set the format
        dist = self.create_dist()[1]
        cmd = bdist(dist)
        cmd.formats = ['msi']
        cmd.ensure_finalized()
        self.assertEqual(cmd.formats, ['msi'])

        # what formats does bdist offer?
        formats = ['bztar', 'gztar', 'msi', 'rpm', 'tar',
                   'wininst', 'xztar', 'zip', 'ztar']
        found = sorted(cmd.format_command)
>       self.assertEqual(found, formats)
E       AssertionError: Lists differ: ['bztar', 'egg', 'gztar', 'msi', 'rpm', 'tar', 'wini[24 chars]tar'] != ['bztar', 'gztar', 'msi', 'rpm', 'tar', 'wininst', '[17 chars]tar']
E
E       First differing element 1:
E       'egg'
E       'gztar'
E
E       First list contains 1 additional elements.
E       First extra element 9:
E       'ztar'
E
E       + ['bztar', 'gztar', 'msi', 'rpm', 'tar', 'wininst', 'xztar', 'zip', 'ztar']
E       - ['bztar',
E       -  'egg',
E       -  'gztar',
E       -  'msi',
E       -  'rpm',
E       -  'tar',
E       -  'wininst',
E       -  'xztar',
E       -  'zip',
E       -  'ztar']

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist.py:27: AssertionError
___________________________________________________________________ BuildDumbTestCase.test_simple_built ____________________________________________________________________

self = <setuptools._distutils.tests.test_bdist_dumb.BuildDumbTestCase testMethod=test_simple_built>

    @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
    def test_simple_built(self):

        # let's create a simple package
        tmp_dir = self.mkdtemp()
        pkg_dir = os.path.join(tmp_dir, 'foo')
        os.mkdir(pkg_dir)
        self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
        self.write_file((pkg_dir, 'foo.py'), '#')
        self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
        self.write_file((pkg_dir, 'README'), '')

        dist = Distribution({'name': 'foo', 'version': '0.1',
                             'py_modules': ['foo'],
                             'url': 'xxx', 'author': 'xxx',
                             'author_email': 'xxx'})
        dist.script_name = 'setup.py'
        os.chdir(pkg_dir)

        sys.argv = ['setup.py']
        cmd = bdist_dumb(dist)

        # so the output is the same no matter
        # what is the platform
        cmd.format = 'zip'

        cmd.ensure_finalized()
        cmd.run()

        # see what we have
        dist_created = os.listdir(os.path.join(pkg_dir, 'dist'))
        base = "%s.%s.zip" % (dist.get_fullname(), cmd.plat_name)

        self.assertEqual(dist_created, [base])

        # now let's check what we have in the zip file
        fp = zipfile.ZipFile(os.path.join('dist', base))
        try:
            contents = fp.namelist()
        finally:
            fp.close()

        contents = sorted(filter(None, map(os.path.basename, contents)))
        wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py']
        if not sys.dont_write_bytecode:
            wanted.append('foo.%s.pyc' % sys.implementation.cache_tag)
>       self.assertEqual(contents, sorted(wanted))
E       AssertionError: Lists differ: ['PKG-INFO', 'SOURCES.txt', 'dependency_links.txt', 'foo.py', 'top_level.txt'] != ['foo-0.1-py3.8.egg-info', 'foo.py']
E
E       First differing element 0:
E       'PKG-INFO'
E       'foo-0.1-py3.8.egg-info'
E
E       First list contains 3 additional elements.
E       First extra element 2:
E       'dependency_links.txt'
E
E       - ['PKG-INFO', 'SOURCES.txt', 'dependency_links.txt', 'foo.py', 'top_level.txt']
E       + ['foo-0.1-py3.8.egg-info', 'foo.py']

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist_dumb.py:91: AssertionError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

__________________________________________________________________ BuildRpmTestCase.test_no_optimize_flag __________________________________________________________________

self = <setuptools._distutils.tests.test_bdist_rpm.BuildRpmTestCase testMethod=test_no_optimize_flag>

    @unittest.skipUnless(sys.platform.startswith('linux'),
                         'spurious sdtout/stderr output under Mac OS X')
    @requires_zlib
    # http://bugs.python.org/issue1533164
    @unittest.skipIf(find_executable('rpm') is None,
                     'the rpm command is not found')
    @unittest.skipIf(find_executable('rpmbuild') is None,
                     'the rpmbuild command is not found')
    def test_no_optimize_flag(self):
        # let's create a package that breaks bdist_rpm
        tmp_dir = self.mkdtemp()
        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
        pkg_dir = os.path.join(tmp_dir, 'foo')
        os.mkdir(pkg_dir)
        self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
        self.write_file((pkg_dir, 'foo.py'), '#')
        self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
        self.write_file((pkg_dir, 'README'), '')

        dist = Distribution({'name': 'foo', 'version': '0.1',
                             'py_modules': ['foo'],
                             'url': 'xxx', 'author': 'xxx',
                             'author_email': 'xxx'})
        dist.script_name = 'setup.py'
        os.chdir(pkg_dir)

        sys.argv = ['setup.py']
        cmd = bdist_rpm(dist)
        cmd.fix_python = True

        cmd.quiet = 1
        cmd.ensure_finalized()
>       cmd.run()

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist_rpm.py:120:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/bdist_rpm.py:362: in run
    self.spawn(rpm_cmd)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:365: in spawn
    spawn(cmd, search_path, dry_run=self.dry_run)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = '/usr/bin/rpmbuild', search_path = 1, verbose = 0, dry_run = 0
env = {'BASH_FUNC_which%%': '() {  ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functi...', 'CONFIG_SITE': 'NONE', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1001/bus', 'HISTCONTROL': 'ignoredups', ...}

    def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None):
        """Run another program, specified as a command list 'cmd', in a new process.

        'cmd' is just the argument list for the new process, ie.
        cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
        There is no way to run a program with a name different from that of its
        executable.

        If 'search_path' is true (the default), the system's executable
        search path will be used to find the program; otherwise, cmd[0]
        must be the exact path to the executable.  If 'dry_run' is true,
        the command will not actually be run.

        Raise DistutilsExecError if running the program fails in any way; just
        return on success.
        """
        # cmd is documented as a list, but just in case some code passes a tuple
        # in, protect our %-formatting code against horrible death
        cmd = list(cmd)

        log.info(subprocess.list2cmdline(cmd))
        if dry_run:
            return

        if search_path:
            executable = find_executable(cmd[0])
            if executable is not None:
                cmd[0] = executable

        env = env if env is not None else dict(os.environ)

        if sys.platform == 'darwin':
            from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver
            macosx_target_ver = get_macosx_target_ver()
            if macosx_target_ver:
                env[MACOSX_VERSION_VAR] = macosx_target_ver

        try:
            proc = subprocess.Popen(cmd, env=env)
            proc.wait()
            exitcode = proc.returncode
        except OSError as exc:
            if not DEBUG:
                cmd = cmd[0]
            raise DistutilsExecError(
                "command %r failed: %s" % (cmd, exc.args[-1])) from exc

        if exitcode:
            if not DEBUG:
                cmd = cmd[0]
>           raise DistutilsExecError(
                  "command %r failed with exit code %s" % (cmd, exitcode))
E           distutils.errors.DistutilsExecError: command '/usr/bin/rpmbuild' failed with exit code 1

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/spawn.py:68: DistutilsExecError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: build_py: byte-compiling is disabled, skipping.

/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

find: ‘debug’: No such file or directory
error: Installed (but unpackaged) file(s) found:
   /usr/lib/python3.8/site-packages/__pycache__/foo.cpython-38.opt-2.pyc
    Installed (but unpackaged) file(s) found:
   /usr/lib/python3.8/site-packages/__pycache__/foo.cpython-38.opt-2.pyc
_______________________________________________________________________ BuildRpmTestCase.test_quiet ________________________________________________________________________

self = <setuptools._distutils.tests.test_bdist_rpm.BuildRpmTestCase testMethod=test_quiet>

    @unittest.skipUnless(sys.platform.startswith('linux'),
                         'spurious sdtout/stderr output under Mac OS X')
    @requires_zlib
    @unittest.skipIf(find_executable('rpm') is None,
                     'the rpm command is not found')
    @unittest.skipIf(find_executable('rpmbuild') is None,
                     'the rpmbuild command is not found')
    def test_quiet(self):
        # let's create a package
        tmp_dir = self.mkdtemp()
        os.environ['HOME'] = tmp_dir   # to confine dir '.rpmdb' creation
        pkg_dir = os.path.join(tmp_dir, 'foo')
        os.mkdir(pkg_dir)
        self.write_file((pkg_dir, 'setup.py'), SETUP_PY)
        self.write_file((pkg_dir, 'foo.py'), '#')
        self.write_file((pkg_dir, 'MANIFEST.in'), 'include foo.py')
        self.write_file((pkg_dir, 'README'), '')

        dist = Distribution({'name': 'foo', 'version': '0.1',
                             'py_modules': ['foo'],
                             'url': 'xxx', 'author': 'xxx',
                             'author_email': 'xxx'})
        dist.script_name = 'setup.py'
        os.chdir(pkg_dir)

        sys.argv = ['setup.py']
        cmd = bdist_rpm(dist)
        cmd.fix_python = True

        # running in quiet mode
        cmd.quiet = 1
        cmd.ensure_finalized()
>       cmd.run()

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist_rpm.py:77:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/bdist_rpm.py:362: in run
    self.spawn(rpm_cmd)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:365: in spawn
    spawn(cmd, search_path, dry_run=self.dry_run)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

cmd = '/usr/bin/rpmbuild', search_path = 1, verbose = 0, dry_run = 0
env = {'BASH_FUNC_which%%': '() {  ( alias;\n eval ${which_declare} ) | /usr/bin/which --tty-only --read-alias --read-functi...', 'CONFIG_SITE': 'NONE', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/1001/bus', 'HISTCONTROL': 'ignoredups', ...}

    def spawn(cmd, search_path=1, verbose=0, dry_run=0, env=None):
        """Run another program, specified as a command list 'cmd', in a new process.

        'cmd' is just the argument list for the new process, ie.
        cmd[0] is the program to run and cmd[1:] are the rest of its arguments.
        There is no way to run a program with a name different from that of its
        executable.

        If 'search_path' is true (the default), the system's executable
        search path will be used to find the program; otherwise, cmd[0]
        must be the exact path to the executable.  If 'dry_run' is true,
        the command will not actually be run.

        Raise DistutilsExecError if running the program fails in any way; just
        return on success.
        """
        # cmd is documented as a list, but just in case some code passes a tuple
        # in, protect our %-formatting code against horrible death
        cmd = list(cmd)

        log.info(subprocess.list2cmdline(cmd))
        if dry_run:
            return

        if search_path:
            executable = find_executable(cmd[0])
            if executable is not None:
                cmd[0] = executable

        env = env if env is not None else dict(os.environ)

        if sys.platform == 'darwin':
            from distutils.util import MACOSX_VERSION_VAR, get_macosx_target_ver
            macosx_target_ver = get_macosx_target_ver()
            if macosx_target_ver:
                env[MACOSX_VERSION_VAR] = macosx_target_ver

        try:
            proc = subprocess.Popen(cmd, env=env)
            proc.wait()
            exitcode = proc.returncode
        except OSError as exc:
            if not DEBUG:
                cmd = cmd[0]
            raise DistutilsExecError(
                "command %r failed: %s" % (cmd, exc.args[-1])) from exc

        if exitcode:
            if not DEBUG:
                cmd = cmd[0]
>           raise DistutilsExecError(
                  "command %r failed with exit code %s" % (cmd, exitcode))
E           distutils.errors.DistutilsExecError: command '/usr/bin/rpmbuild' failed with exit code 1

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/spawn.py:68: DistutilsExecError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: build_py: byte-compiling is disabled, skipping.

/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
  warnings.warn(
warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

find: ‘debug’: No such file or directory
error: Installed (but unpackaged) file(s) found:
   /usr/lib/python3.8/site-packages/__pycache__/foo.cpython-38.opt-2.pyc
    Installed (but unpackaged) file(s) found:
   /usr/lib/python3.8/site-packages/__pycache__/foo.cpython-38.opt-2.pyc
_________________________________________________________________ BuildPyTestCase.test_dont_write_bytecode _________________________________________________________________

self = <setuptools._distutils.tests.test_build_py.BuildPyTestCase testMethod=test_dont_write_bytecode>

    def test_dont_write_bytecode(self):
        # makes sure byte_compile is not used
        dist = self.create_dist()[1]
        cmd = build_py(dist)
        cmd.compile = 1
        cmd.optimize = 1

        old_dont_write_bytecode = sys.dont_write_bytecode
        sys.dont_write_bytecode = True
        try:
            cmd.byte_compile([])
        finally:
            sys.dont_write_bytecode = old_dont_write_bytecode

        self.assertIn('byte-compiling is disabled',
>                     self.logs[0][1] % self.logs[0][2])
E       IndexError: list index out of range

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_py.py:172: IndexError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: build_py: byte-compiling is disabled, skipping.

____________________________________________________________________ CheckTestCase.test_check_metadata _____________________________________________________________________

version = 'xxx'

    @staticmethod
    def _validate_version(version):
        if isinstance(version, numbers.Number):
            # Some people apparently take "version number" too literally :)
            version = str(version)

        if version is not None:
            try:
>               packaging.version.Version(version)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:505:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'Version' object has no attribute '_version'") raised in repr()] Version object at 0x7fb7e09a9670>, version = 'xxx'

    def __init__(self, version: str) -> None:

        # Validate the version and parse it into pieces
        match = self._regex.search(version)
        if not match:
>           raise InvalidVersion(f"Invalid version: '{version}'")
E           setuptools._vendor.packaging.version.InvalidVersion: Invalid version: 'xxx'

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.py:266: InvalidVersion

During handling of the above exception, another exception occurred:

self = <setuptools._distutils.tests.test_check.CheckTestCase testMethod=test_check_metadata>

    def test_check_metadata(self):
        # let's run the command with no metadata at all
        # by default, check is checking the metadata
        # should have some warnings
        cmd = self._run()
        self.assertEqual(cmd._warnings, 2)

        # now let's add the required fields
        # and run it again, to make sure we don't get
        # any warning anymore
        metadata = {'url': 'xxx', 'author': 'xxx',
                    'author_email': 'xxx',
                    'name': 'xxx', 'version': 'xxx'}
>       cmd = self._run(metadata)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_check.py:54:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_check.py:30: in _run
    pkg_info, dist = self.create_dist(**metadata)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/support.py:106: in create_dist
    dist = Distribution(attrs=kw)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:471: in __init__
    self._validate_version(self.metadata.version)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

version = 'xxx'

    @staticmethod
    def _validate_version(version):
        if isinstance(version, numbers.Number):
            # Some people apparently take "version number" too literally :)
            version = str(version)

        if version is not None:
            try:
                packaging.version.Version(version)
            except (packaging.version.InvalidVersion, TypeError):
>               warnings.warn(
                    "The version specified (%r) is an invalid version, this "
                    "may not work as expected with newer versions of "
                    "setuptools, pip, and PyPI. Please see PEP 440 for more "
                    "details." % version
                )
E               UserWarning: The version specified ('xxx') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:507: UserWarning
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: check: missing required meta-data: name, version, url

warning: check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) should be supplied

________________________________________________________________ CheckTestCase.test_check_restructuredtext _________________________________________________________________

    @staticmethod
    def _validate_version(version):
        if isinstance(version, numbers.Number):
            # Some people apparently take "version number" too literally :)
            version = str(version)

        if version is not None:
            try:
>               packaging.version.Version(version)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:505:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'Version' object has no attribute '_version'") raised in repr()] Version object at 0x7fb7e08631f0>, version = 'xxx'

    def __init__(self, version: str) -> None:

        # Validate the version and parse it into pieces
        match = self._regex.search(version)
        if not match:
>           raise InvalidVersion(f"Invalid version: '{version}'")
E           setuptools._vendor.packaging.version.InvalidVersion: Invalid version: 'xxx'

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_vendor/packaging/version.py:266: InvalidVersion

During handling of the above exception, another exception occurred:

self = <setuptools._distutils.tests.test_check.CheckTestCase testMethod=test_check_restructuredtext>

    @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils")
    def test_check_restructuredtext(self):
        # let's see if it detects broken rest in long_description
        broken_rest = 'title\n===\n\ntest'
        pkg_info, dist = self.create_dist(long_description=broken_rest)
        cmd = check(dist)
        cmd.check_restructuredtext()
        self.assertEqual(cmd._warnings, 1)

        # let's see if we have an error with strict=1
        metadata = {'url': 'xxx', 'author': 'xxx',
                    'author_email': 'xxx',
                    'name': 'xxx', 'version': 'xxx',
                    'long_description': broken_rest}
>       self.assertRaises(DistutilsSetupError, self._run, metadata,
                          **{'strict': 1, 'restructuredtext': 1})

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_check.py:103:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_check.py:30: in _run
    pkg_info, dist = self.create_dist(**metadata)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/support.py:106: in create_dist
    dist = Distribution(attrs=kw)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:471: in __init__
    self._validate_version(self.metadata.version)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    @staticmethod
    def _validate_version(version):
        if isinstance(version, numbers.Number):
            # Some people apparently take "version number" too literally :)
            version = str(version)

        if version is not None:
            try:
                packaging.version.Version(version)
            except (packaging.version.InvalidVersion, TypeError):
>               warnings.warn(
                    "The version specified (%r) is an invalid version, this "
                    "may not work as expected with newer versions of "
                    "setuptools, pip, and PyPI. Please see PEP 440 for more "
                    "details." % version
                )
E               UserWarning: The version specified ('xxx') is an invalid version, this may not work as expected with newer versions of setuptools, pip, and PyPI. Please see PEP 440 for more details.

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/dist.py:507: UserWarning
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: check: Possible title underline, too short for the title.
Treating it as ordinary text because it's so short. (line 2)

_____________________________________________________________________ CommandTestCase.test_debug_print _____________________________________________________________________

self = <setuptools._distutils.tests.test_cmd.CommandTestCase testMethod=test_debug_print>

    def test_debug_print(self):
        cmd = self.cmd
        with captured_stdout() as stdout:
            cmd.debug_print('xxx')
        stdout.seek(0)
        self.assertEqual(stdout.read(), '')

        debug.DEBUG = True
        try:
            with captured_stdout() as stdout:
                cmd.debug_print('xxx')
            stdout.seek(0)
>           self.assertEqual(stdout.read(), 'xxx\n')
E           AssertionError: '' != 'xxx\n'
E           + xxx

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_cmd.py:118: AssertionError
______________________________________________________________________ CoreTestCase.test_run_commands ______________________________________________________________________

self = <setuptools._distutils.tests.test_core.CoreTestCase testMethod=test_run_commands>

    def test_run_commands(self):
        sys.argv = ['setup.py', 'build']
        dist = distutils.core.run_setup(
            self.write_setup(setup_within_if_main), stop_after="commandline")
        self.assertNotIn('build', dist.have_run)
        distutils.core.run_commands(dist)
>       self.assertIn('build', dist.have_run)
E       AssertionError: 'build' not found in {}

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_core.py:141: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
running build
running build_py
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
package init file 'pkg_resources/tests/data/__init__.py' not found (or not a regular file)
package init file 'pkg_resources/tests/data/my-test-package-source/__init__.py' not found (or not a regular file)
package init file 'pkg_resources/tests/data/my-test-package-zip/__init__.py' not found (or not a regular file)
package init file 'pkg_resources/tests/data/my-test-package_unpacked-egg/__init__.py' not found (or not a regular file)
package init file 'pkg_resources/tests/data/my-test-package_zipped-egg/__init__.py' not found (or not a regular file)
package init file 'setuptools/tests/indexes/__init__.py' not found (or not a regular file)
package init file 'setuptools/tests/indexes/test_links_priority/__init__.py' not found (or not a regular file)
package init file 'setuptools/tests/indexes/test_links_priority/simple/__init__.py' not found (or not a regular file)
package init file 'setuptools/tests/indexes/test_links_priority/simple/foobar/__init__.py' not found (or not a regular file)
warning: build_py: byte-compiling is disabled, skipping.

_______________________________________________________________ CoreTestCase.test_run_setup_defines_subclass _______________________________________________________________

self = <setuptools._distutils.tests.test_core.CoreTestCase testMethod=test_run_setup_defines_subclass>

    def test_run_setup_defines_subclass(self):
        # Make sure the script can use __file__; if that's missing, the test
        # setup.py script will raise NameError.
        dist = distutils.core.run_setup(
            self.write_setup(setup_defines_subclass))
        install = dist.get_command_obj('install')
>       self.assertIn('cmd', install.sub_commands)
E       AssertionError: 'cmd' not found in [('install_lib', <function install.has_lib at 0x7fb7e157bd30>), ('install_headers', <function install.has_headers at 0x7fb7e157bdc0>), ('install_data', <function install.has_data at 0x7fb7e157bee0>), ('install_egg_info', <function install.<lambda> at 0x7fb7e0ed8670>), ('install_scripts', <function install.<lambda> at 0x7fb7e0ed8700>)]

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_core.py:109: AssertionError
________________________________________________________________ CoreTestCase.test_run_setup_within_if_main ________________________________________________________________

self = <setuptools._distutils.tests.test_core.CoreTestCase testMethod=test_run_setup_within_if_main>

    def test_run_setup_within_if_main(self):
        dist = distutils.core.run_setup(
            self.write_setup(setup_within_if_main), stop_after="config")
        self.assertIsInstance(dist, Distribution)
>       self.assertEqual(dist.get_name(), "setup_within_if_main")
E       AssertionError: 'bar' != 'setup_within_if_main'
E       - bar
E       + setup_within_if_main

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_core.py:133: AssertionError
___________________________________________________________ DirUtilTestCase.test_copy_tree_exception_in_listdir ____________________________________________________________

    def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
                  preserve_symlinks=0, update=0, verbose=1, dry_run=0):
        """Copy an entire directory tree 'src' to a new location 'dst'.

        Both 'src' and 'dst' must be directory names.  If 'src' is not a
        directory, raise DistutilsFileError.  If 'dst' does not exist, it is
        created with 'mkpath()'.  The end result of the copy is that every
        file in 'src' is copied to 'dst', and directories under 'src' are
        recursively copied to 'dst'.  Return the list of files that were
        copied or might have been copied, using their output name.  The
        return value is unaffected by 'update' or 'dry_run': it is simply
        the list of all files under 'src', with the names changed to be
        under 'dst'.

        'preserve_mode' and 'preserve_times' are the same as for
        'copy_file'; note that they only apply to regular files, not to
        directories.  If 'preserve_symlinks' is true, symlinks will be
        copied as symlinks (on platforms that support them!); otherwise
        (the default), the destination of the symlink will be copied.
        'update' and 'verbose' are the same as for 'copy_file'.
        """
        from distutils.file_util import copy_file

        if not dry_run and not os.path.isdir(src):
            raise DistutilsFileError(
                  "cannot copy tree '%s': not a directory" % src)
        try:
>           names = os.listdir(src)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/dir_util.py:126:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MagicMock name='listdir' id='140427721483120'>, args = ('/tmp/tmp06cgnw7h',), kwargs = {}

    def __call__(self, /, *args, **kwargs):
        # can't use self in-case a function / method we are mocking uses self
        # in the signature
        self._mock_check_sig(*args, **kwargs)
        self._increment_mock_call(*args, **kwargs)
>       return self._mock_call(*args, **kwargs)

/usr/lib64/python3.8/unittest/mock.py:1081:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MagicMock name='listdir' id='140427721483120'>, args = ('/tmp/tmp06cgnw7h',), kwargs = {}

    def _mock_call(self, /, *args, **kwargs):
>       return self._execute_mock_call(*args, **kwargs)

/usr/lib64/python3.8/unittest/mock.py:1085:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <MagicMock name='listdir' id='140427721483120'>, args = ('/tmp/tmp06cgnw7h',), kwargs = {}, effect = OSError()

    def _execute_mock_call(self, /, *args, **kwargs):
        # separate from _increment_mock_call so that awaited functions are
        # executed separately from their call, also AsyncMock overrides this method

        effect = self.side_effect
        if effect is not None:
            if _is_exception(effect):
>               raise effect
E               OSError

/usr/lib64/python3.8/unittest/mock.py:1140: OSError

During handling of the above exception, another exception occurred:

self = <setuptools._distutils.tests.test_dir_util.DirUtilTestCase testMethod=test_copy_tree_exception_in_listdir>

    def test_copy_tree_exception_in_listdir(self):
        """
        An exception in listdir should raise a DistutilsFileError
        """
        with patch("os.listdir", side_effect=OSError()), \
             self.assertRaises(errors.DistutilsFileError):
            src = self.tempdirs[-1]
>           dir_util.copy_tree(src, None)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_dir_util.py:132:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

    def copy_tree(src, dst, preserve_mode=1, preserve_times=1,
                  preserve_symlinks=0, update=0, verbose=1, dry_run=0):
        """Copy an entire directory tree 'src' to a new location 'dst'.

        Both 'src' and 'dst' must be directory names.  If 'src' is not a
        directory, raise DistutilsFileError.  If 'dst' does not exist, it is
        created with 'mkpath()'.  The end result of the copy is that every
        file in 'src' is copied to 'dst', and directories under 'src' are
        recursively copied to 'dst'.  Return the list of files that were
        copied or might have been copied, using their output name.  The
        return value is unaffected by 'update' or 'dry_run': it is simply
        the list of all files under 'src', with the names changed to be
        under 'dst'.

        'preserve_mode' and 'preserve_times' are the same as for
        'copy_file'; note that they only apply to regular files, not to
        directories.  If 'preserve_symlinks' is true, symlinks will be
        copied as symlinks (on platforms that support them!); otherwise
        (the default), the destination of the symlink will be copied.
        'update' and 'verbose' are the same as for 'copy_file'.
        """
        from distutils.file_util import copy_file

        if not dry_run and not os.path.isdir(src):
            raise DistutilsFileError(
                  "cannot copy tree '%s': not a directory" % src)
        try:
            names = os.listdir(src)
        except OSError as e:
            if dry_run:
                names = []
            else:
>               raise DistutilsFileError(
                      "error listing files in '%s': %s" % (src, e.strerror))
E               distutils.errors.DistutilsFileError: error listing files in '/tmp/tmp06cgnw7h': None

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/dir_util.py:131: DistutilsFileError
________________________________________________________________ DirUtilTestCase.test_create_tree_verbosity ________________________________________________________________

self = <setuptools._distutils.tests.test_dir_util.DirUtilTestCase testMethod=test_create_tree_verbosity>

    def test_create_tree_verbosity(self):

        create_tree(self.root_target, ['one', 'two', 'three'], verbose=0)
        self.assertEqual(self._logs, [])
        remove_tree(self.root_target, verbose=0)

        wanted = ['creating %s' % self.root_target]
        create_tree(self.root_target, ['one', 'two', 'three'], verbose=1)
>       self.assertEqual(self._logs, wanted)
E       AssertionError: Lists differ: [] != ['creating /tmp/tmpe5q_ezvw/deep']
E
E       Second list contains 1 additional elements.
E       First extra element 0:
E       'creating /tmp/tmpe5q_ezvw/deep'
E
E       - []
E       + ['creating /tmp/tmpe5q_ezvw/deep']

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_dir_util.py:77: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
creating /tmp/tmpe5q_ezvw/deep
____________________________________________________________ DirUtilTestCase.test_mkpath_remove_tree_verbosity _____________________________________________________________

self = <setuptools._distutils.tests.test_dir_util.DirUtilTestCase testMethod=test_mkpath_remove_tree_verbosity>

    def test_mkpath_remove_tree_verbosity(self):

        mkpath(self.target, verbose=0)
        wanted = []
        self.assertEqual(self._logs, wanted)
        remove_tree(self.root_target, verbose=0)

        mkpath(self.target, verbose=1)
        wanted = ['creating %s' % self.root_target,
                  'creating %s' % self.target]
>       self.assertEqual(self._logs, wanted)
E       AssertionError: Lists differ: [] != ['creating /tmp/tmpv0rlimvg/deep', 'creating /tmp/tmpv0rlimvg/deep/here']
E
E       Second list contains 2 additional elements.
E       First extra element 0:
E       'creating /tmp/tmpv0rlimvg/deep'
E
E       - []
E       + ['creating /tmp/tmpv0rlimvg/deep', 'creating /tmp/tmpv0rlimvg/deep/here']

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_dir_util.py:49: AssertionError
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
creating /tmp/tmpv0rlimvg/deep
creating /tmp/tmpv0rlimvg/deep/here
__________________________________________________________________ ExtensionTestCase.test_read_setup_file __________________________________________________________________

self = <setuptools._distutils.tests.test_extension.ExtensionTestCase testMethod=test_read_setup_file>

    def test_read_setup_file(self):
        # trying to read a Setup file
        # (sample extracted from the PyGame project)
        setup = os.path.join(os.path.dirname(__file__), 'Setup.sample')

>       exts = read_setup_file(setup)

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_extension.py:18:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/extension.py:150: in read_setup_file
    vars = parse_makefile(filename)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/sysconfig.py:347: in parse_makefile
    fp = TextFile(fn, strip_comments=1, skip_blanks=1, join_lines=1, errors="surrogateescape")
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/text_file.py:100: in __init__
    self.open(filename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <distutils.text_file.TextFile object at 0x7fb7e09a7940>
filename = '/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/Setup.sample'

    def open(self, filename):
        """Open a new file named 'filename'.  This overrides both the
           'filename' and 'file' arguments to the constructor."""
        self.filename = filename
>       self.file = io.open(self.filename, 'r', errors=self.errors)
E       FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/Setup.sample'

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/text_file.py:115: FileNotFoundError
____________________________________________________________________ FileListTestCase.test_debug_print _____________________________________________________________________

self = <setuptools._distutils.tests.test_filelist.FileListTestCase testMethod=test_debug_print>

    def test_debug_print(self):
        file_list = FileList()
        with captured_stdout() as stdout:
            file_list.debug_print('xxx')
        self.assertEqual(stdout.getvalue(), '')

        debug.DEBUG = True
        try:
            with captured_stdout() as stdout:
                file_list.debug_print('xxx')
>           self.assertEqual(stdout.getvalue(), 'xxx\n')
E           AssertionError: '' != 'xxx\n'
E           + xxx

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_filelist.py:118: AssertionError
__________________________________________________________________ FileListTestCase.test_process_template __________________________________________________________________

self = <setuptools._distutils.tests.test_filelist.FileListTestCase testMethod=test_process_template>

    def test_process_template(self):
        l = make_local_path
        # invalid lines
        file_list = FileList()
        for action in ('include', 'exclude', 'global-include',
                       'global-exclude', 'recursive-include',
                       'recursive-exclude', 'graft', 'prune', 'blarg'):
            self.assertRaises(DistutilsTemplateError,
                              file_list.process_template_line, action)

        # include
        file_list = FileList()
        file_list.set_allfiles(['a.py', 'b.txt', l('d/c.py')])

        file_list.process_template_line('include *.py')
        self.assertEqual(file_list.files, ['a.py'])
        self.assertNoWarnings()

        file_list.process_template_line('include *.rb')
        self.assertEqual(file_list.files, ['a.py'])
>       self.assertWarnings()

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_filelist.py:211:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_filelist.py:47: in assertWarnings
    self.assertGreater(len(self.get_logs(WARN)), 0)
E   AssertionError: 0 not greater than 0
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: no files found matching '*.rb'
_____________________________________________________________________ InstallTestCase.test_debug_mode ______________________________________________________________________

self = <setuptools._distutils.tests.test_install.InstallTestCase testMethod=test_debug_mode>

    def test_debug_mode(self):
        # this covers the code called when DEBUG is set
        old_logs_len = len(self.logs)
        install_module.DEBUG = True
        try:
            with captured_stdout():
>               self.test_record()

../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_install.py:240:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_install.py:187: in test_record
    cmd.run()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/install.py:674: in run
    self.run_command(cmd_name)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:313: in run_command
    self.distribution.run_command(command)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/dist.py:986: in run_command
    cmd_obj.run()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/install_scripts.py:20: in run
    self.run_command("egg_info")
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/cmd.py:313: in run_command
    self.distribution.run_command(command)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/dist.py:986: in run_command
    cmd_obj.run()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py:299: in run
    self.find_sources()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py:306: in find_sources
    mm.run()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py:541: in run
    self.add_defaults()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/command/egg_info.py:578: in add_defaults
    sdist.add_defaults(self)
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py:224: in add_defaults
    self._add_defaults_standards()
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py:265: in _add_defaults_standards
    if self._cs_path_exists(fn):
../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/command/sdist.py:242: in _cs_path_exists
    if not os.path.exists(fspath):
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

path = None

    def exists(path):
        """Test whether a path exists.  Returns False for broken symbolic links"""
        try:
>           os.stat(path)
E           TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType

/usr/lib64/python3.8/genericpath.py:19: TypeError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
warning: build_py: byte-compiling is disabled, skipping.

warning: install_lib: byte-compiling is disabled, skipping.

[..]

========================================================================= short test summary info ==========================================================================
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc.py:17: could not import 'distutils.msvc9compiler': No module named 'distutils.msvc9compiler'
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist_msi.py:15: these tests require Windows
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_bdist_wininst.py:20: bdist_wininst is not supported in this install
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_ext.py:56: cannot find xxmodule.c (test must run in the python build dir)
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_ext.py:437: test only relevant for MacOSX
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_ext.py:451: test only relevant for MacOSX
SKIPPED [2] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_ext.py:444: test only relevant for MacOSX
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_py.py:91: byte-compile disabled
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_build_py.py:108: byte-compile disabled
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_install.py:201: cannot find xxmodule.c (test must run in the python build dir)
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_install_lib.py:37: byte-compile disabled
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvc9compiler.py:106: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvc9compiler.py:123: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvc9compiler.py:165: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvc9compiler.py:141: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvccompiler.py:66: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvccompiler.py:54: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvccompiler.py:36: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_msvccompiler.py:19: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_sdist.py:324: test relevant for Windows only
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/_distutils/tests/test_sysconfig.py:53: sysconfig.IS_PYPY
SKIPPED [4] ../../../../../usr/lib/python3.8/site-packages/_pytest/doctest.py:448: all tests skipped by +SKIP option
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_develop.py:66: TODO: needs a fixture to cause 'develop' to be invoked without mutating environment.
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_install_scripts.py:50: Windows only
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_install_scripts.py:78: Windows only
SKIPPED [5] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_integration.py:31: Integration tests cannot run when pbr is installed
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc14.py:16: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc14.py:34: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc14.py:52: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_msvc14.py:68: These tests are only for win32
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_windows_wrappers.py:80: Windows only
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_windows_wrappers.py:121: Windows only
SKIPPED [1] ../../BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/setuptools/tests/test_windows_wrappers.py:180: Windows only
XFAIL tests/test_bdist_egg.py::Test::test_exclude_source_files
  Byte code disabled
XFAIL tests/test_dist.py::test_read_metadata[Metadata Version 1.2: Project-Url-attrs5]
  Issue #1578: project_urls not read
XFAIL tests/test_dist.py::test_read_metadata[Metadata Version 2.1: Provides Extra-attrs9]
  provides_extras not read
XFAIL tests/test_egg_info.py::TestEggInfo::test_requires[extras_require_with_marker_in_setup_cfg]
XFAIL tests/test_virtualenv.py::test_pip_upgrade_from_source[pip<20]
  pypa/pip#6599
XPASS tests/test_archive_util.py::test_unicode_files #710 and #712
FAILED _distutils/tests/test_bdist.py::BuildTestCase::test_formats - AssertionError: Lists differ: ['bztar', 'egg', 'gztar', 'msi', 'rpm', 'tar', 'wini[24 chars]tar'] !=...
FAILED _distutils/tests/test_bdist_dumb.py::BuildDumbTestCase::test_simple_built - AssertionError: Lists differ: ['PKG-INFO', 'SOURCES.txt', 'dependency_links.txt', 'foo...
FAILED _distutils/tests/test_bdist_rpm.py::BuildRpmTestCase::test_no_optimize_flag - distutils.errors.DistutilsExecError: command '/usr/bin/rpmbuild' failed with exit co...
FAILED _distutils/tests/test_bdist_rpm.py::BuildRpmTestCase::test_quiet - distutils.errors.DistutilsExecError: command '/usr/bin/rpmbuild' failed with exit code 1
FAILED _distutils/tests/test_build_py.py::BuildPyTestCase::test_dont_write_bytecode - IndexError: list index out of range
FAILED _distutils/tests/test_check.py::CheckTestCase::test_check_metadata - UserWarning: The version specified ('xxx') is an invalid version, this may not work as expect...
FAILED _distutils/tests/test_check.py::CheckTestCase::test_check_restructuredtext - UserWarning: The version specified ('xxx') is an invalid version, this may not work a...
FAILED _distutils/tests/test_cmd.py::CommandTestCase::test_debug_print - AssertionError: '' != 'xxx\n'
FAILED _distutils/tests/test_core.py::CoreTestCase::test_run_commands - AssertionError: 'build' not found in {}
FAILED _distutils/tests/test_core.py::CoreTestCase::test_run_setup_defines_subclass - AssertionError: 'cmd' not found in [('install_lib', <function install.has_lib at 0x...
FAILED _distutils/tests/test_core.py::CoreTestCase::test_run_setup_within_if_main - AssertionError: 'bar' != 'setup_within_if_main'
FAILED _distutils/tests/test_dir_util.py::DirUtilTestCase::test_copy_tree_exception_in_listdir - distutils.errors.DistutilsFileError: error listing files in '/tmp/tmp06c...
FAILED _distutils/tests/test_dir_util.py::DirUtilTestCase::test_create_tree_verbosity - AssertionError: Lists differ: [] != ['creating /tmp/tmpe5q_ezvw/deep']
FAILED _distutils/tests/test_dir_util.py::DirUtilTestCase::test_mkpath_remove_tree_verbosity - AssertionError: Lists differ: [] != ['creating /tmp/tmpv0rlimvg/deep', 'cr...
FAILED _distutils/tests/test_extension.py::ExtensionTestCase::test_read_setup_file - FileNotFoundError: [Errno 2] No such file or directory: '/home/tkloczko/rpmbuild/BUI...
FAILED _distutils/tests/test_filelist.py::FileListTestCase::test_debug_print - AssertionError: '' != 'xxx\n'
FAILED _distutils/tests/test_filelist.py::FileListTestCase::test_process_template - AssertionError: 0 not greater than 0
FAILED _distutils/tests/test_install.py::InstallTestCase::test_debug_mode - TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
FAILED _distutils/tests/test_install.py::InstallTestCase::test_record - TypeError: stat: path should be string, bytes, os.PathLike or integer, not NoneType
FAILED _distutils/tests/test_install_lib.py::InstallLibTestCase::test_dont_write_bytecode - IndexError: list index out of range
FAILED _distutils/tests/test_msvccompiler.py::TestSpawn::test_concurrent_safe_fallback - distutils.errors.DistutilsExecError: command 'n/a' failed: No such file or direc...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_check_metadata_deprecated - UserWarning: The version specified ('xxx') is an invalid version, this may n...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_create_pypirc - UserWarning: The version specified ('xxx') is an invalid version, this may not work as e...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_list_classifiers - UserWarning: The version specified ('xxx') is an invalid version, this may not work a...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_password_not_in_file - UserWarning: The version specified ('xxx') is an invalid version, this may not wo...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_password_reset - UserWarning: The version specified ('xxx') is an invalid version, this may not work as ...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_register_invalid_long_description - UserWarning: The version specified ('xxx') is an invalid version, th...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_registering - UserWarning: The version specified ('xxx') is an invalid version, this may not work as exp...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_show_response - UserWarning: The version specified ('xxx') is an invalid version, this may not work as e...
FAILED _distutils/tests/test_register.py::RegisterTestCase::test_strict - UserWarning: The version specified ('xxx') is an invalid version, this may not work as expected...
FAILED _distutils/tests/test_sdist.py::SDistTestCase::test_invalid_template_unknown_command - AssertionError: 0 != 1
FAILED _distutils/tests/test_sdist.py::SDistTestCase::test_invalid_template_wrong_arguments - AssertionError: 0 != 1
FAILED _distutils/tests/test_sdist.py::SDistTestCase::test_metadata_check_option - AssertionError: 0 != 2
FAILED _distutils/tests/test_unixccompiler.py::UnixCCompilerTestCase::test_runtime_libdir_option - ModuleNotFoundError: No module named '_sysconfigdata'
FAILED _distutils/tests/test_upload.py::uploadTestCase::test_upload - IndexError: list index out of range
FAILED _distutils/tests/test_upload.py::uploadTestCase::test_wrong_exception_order - AssertionError: OSError not raised
FAILED _distutils/tests/test_util.py::UtilTestCase::test_check_environ - KeyError: 'PLAT'
FAILED _distutils/tests/test_util.py::UtilTestCase::test_check_environ_getpwuid - KeyError: 'HOME'
FAILED _vendor/more_itertools/more.py::setuptools._vendor.more_itertools.more.collate
FAILED _vendor/more_itertools/more.py::setuptools._vendor.more_itertools.more.locate
FAILED _vendor/more_itertools/more.py::setuptools._vendor.more_itertools.more.make_decorator
FAILED _vendor/more_itertools/more.py::setuptools._vendor.more_itertools.more.side_effect
FAILED _vendor/more_itertools/recipes.py::setuptools._vendor.more_itertools.recipes.powerset
FAILED tests/test_depends.py::TestGetModuleConstant::test_basic - AssertionError: assert 'setuptools.tests.mod_with_constant' not in {'__future__': <module '__future__' ...
FAILED tests/test_develop.py::TestNamespaces::test_editable_prefix - subprocess.CalledProcessError: Command '[PosixPath('/tmp/pytest-of-tkloczko/pytest-149/test_editable...
FAILED tests/test_dist.py::test_dist_fetch_build_egg - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the next major release
FAILED tests/test_easy_install.py::TestEasyInstallTest::test_no_find_links - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the ...
FAILED tests/test_easy_install.py::TestEasyInstallTest::test_write_exception - distutils.errors.DistutilsError: can't create or remove files in install directory
FAILED tests/test_easy_install.py::TestEasyInstallTest::test_unicode_filename_in_sdist - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be rem...
FAILED tests/test_easy_install.py::TestEasyInstallTest::test_unicode_content_in_sdist - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be remo...
FAILED tests/test_easy_install.py::TestEasyInstallTest::test_script_install - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the...
FAILED tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_enabled - DeprecationWarning: Creating a LegacyVersion has been deprecate...
FAILED tests/test_easy_install.py::TestUserInstallTest::test_user_install_not_implied_user_site_disabled - DeprecationWarning: Creating a LegacyVersion has been deprecat...
FAILED tests/test_easy_install.py::TestUserInstallTest::test_local_index - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be removed in the ne...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVersion has b...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVersion has b...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVersion has b...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_overrides_version_conflict[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVersion has b...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVersion has been deprecat...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVersion has been deprecat...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVersion has been deprecat...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_override_nspkg[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVersion has been deprecat...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg0] - DeprecationWarning: Creating a LegacyVersion has been depre...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg1] - DeprecationWarning: Creating a LegacyVersion has been depre...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg2] - DeprecationWarning: Creating a LegacyVersion has been depre...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_attr_version[use_setup_cfg3] - DeprecationWarning: Creating a LegacyVersion has been depre...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_honors_pip_env - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be r...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_pep508_url - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be ...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_allow_hosts - DeprecationWarning: Creating a LegacyVersion has been deprecated and will be...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_python_requires - DeprecationWarning: Creating a LegacyVersion has been deprecated and wil...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[False] - DeprecationWarning: Creating a LegacyVersion has been dep...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_find_links_in_setup_cfg[True] - DeprecationWarning: Creating a LegacyVersion has been depr...
FAILED tests/test_easy_install.py::TestSetupRequires::test_setup_requires_with_transitive_extra_dependency - DeprecationWarning: Creating a LegacyVersion has been deprec...
FAILED tests/test_packageindex.py::TestPackageIndex::test_bad_url_double_scheme - distutils.errors.DistutilsError: http://http://svn.pythonpaste.org/Paste/wphp/trunk non...
FAILED tests/test_setuptools.py::TestDepends::testRequire - AssertionError: assert <Version('1.0.3')> == <Version('1.0.3')>
FAILED tests/test_setuptools.py::TestCommandTests::testTestIsCommand - AssertionError: assert False
=============================================== 76 failed, 854 passed, 45 skipped, 5 xfailed, 1 xpassed in 220.64s (0:03:40) ===============================================

@kloczek
Copy link
Author

kloczek commented Dec 25, 2021

Gosh just found that I had in my rpm small patch removing tests from install exclude list :/

--- a/setup.cfg~       2021-12-20 19:44:05.000000000 +0000
+++ b/setup.cfg        2021-12-20 20:04:13.697832584 +0000
@@ -33,7 +33,6 @@
        dist*
        docs*
        tests*
-       *.tests
        tools*

 [options.extras_require]

Nevertheless after remove that patch now pytest is not able to start at all

+ cd setuptools-60.1.0
+ PYTHONDONTWRITEBYTECODE=1
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-setuptools-60.1.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ pytest -ra -p no:randomly setuptools
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 703, in import_plugin
    __import__(importspec)
ModuleNotFoundError: No module named 'setuptools.tests'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/bin/pytest", line 33, in <module>
    sys.exit(load_entry_point('pytest==6.2.5', 'console_scripts', 'pytest')())
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 143, in main
    config = _prepareconfig(args, plugins)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File "/usr/lib/python3.8/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1191, in _preparse
    self.hook.pytest_load_initial_conftests(
  File "/usr/lib/python3.8/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File "/usr/lib/python3.8/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
  File "/usr/lib/python3.8/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/usr/lib/python3.8/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 1070, in pytest_load_initial_conftests
    self.pluginmanager._set_initial_conftests(early_config.known_args_namespace)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 500, in _set_initial_conftests
    self._try_load_conftest(anchor, namespace.importmode)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 508, in _try_load_conftest
    self._getconftestmodules(anchor, importmode)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 536, in _getconftestmodules
    mod = self._importconftest(conftestpath, importmode)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 587, in _importconftest
    self.consider_conftest(mod)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 663, in consider_conftest
    self.register(conftestmodule, name=conftestmodule.__file__)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 443, in register
    self.consider_module(plugin)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 669, in consider_module
    self._import_plugin_specs(getattr(mod, "pytest_plugins", []))
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 676, in _import_plugin_specs
    self.import_plugin(import_spec)
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 705, in import_plugin
    raise ImportError(
  File "/usr/lib/python3.8/site-packages/_pytest/config/__init__.py", line 703, in import_plugin
    __import__(importspec)
ImportError: Error importing plugin "setuptools.tests.fixtures": No module named 'setuptools.tests'

adding --pyargs setuptools.tests to pytest arrgs does not help.

@jaraco
Copy link
Member

jaraco commented Dec 28, 2021

The reason you remove the exclusion of the install of tests is because you're needing those to be installed in order to run the tests. Setuptools' own test suite invocation doesn't have this problem because it performs an editable install and those packages remain on an editable install.

Setuptools does provide an exclusion for collecting all of setuptools._distutils, but that exclusion is being missed, possibly due to the setuptools parameter to pytest.

I'm not sure there's much Setuptools can do to support the reported use-case (being able to run tests in an installed setting). This package is already massively complicated by (a) vendored dependencies, (b) adopted distutils, (c) two top-level packages setuptools and pkg_resources, and (d) demands that tests not be installed.

I'm open to proposals, but I don't have any good ideas myself.

@jaraco jaraco added help wanted Needs Investigation Issues which are likely in scope but need investigation to figure out the cause and removed bug Needs Triage Issues that need to be evaluated for severity and status. labels Dec 28, 2021
@abravalheri
Copy link
Contributor

Following up on Jason's comment, I can see in the provided logs the following errors:

ModuleNotFoundError: No module named 'setuptools.tests'

I believe this is the same problem described in #3032.

There is an existing request for adding that support in #2318, so I think the best is to centralise all the attention in that ticket.

@kloczek I will go ahead and also close this ticket in favour of #2318. Please let me know if you think the errors are being caused by a different reason.

@abravalheri abravalheri added duplicate and removed help wanted Needs Investigation Issues which are likely in scope but need investigation to figure out the cause labels Jan 19, 2022
@kloczek
Copy link
Author

kloczek commented Jan 19, 2022

@kloczek I will go ahead and also close this ticket in favour of #2318. Please let me know if you think the errors are being caused by a different reason.

I've already sbscibed to #2318. Thank you 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants