I'm trying to package your module as an rpm package. So I'm using the typical build, install and test cycle used on building packages from non-root account.
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.10.0, pluggy-0.13.1
rootdir: /home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1
plugins: rerunfailures-9.1.1, cov-2.12.1, forked-1.3.0, xdist-2.3.0, flake8-1.0.7, shutil-1.7.0, virtualenv-1.7.0, trio-0.7.0, mock-3.6.1, timeout-2.0.1
collected 66 items
tests/test_build_api.py ........ [ 12%]
tests/test_core_functions.py ....... [ 22%]
tests/test_datafiles_install.py FFFFFFFFFF [ 37%]
tests/test_datafiles_paths.py ........ [ 50%]
tests/test_deprecated.py ....sF.... [ 65%]
tests/test_install.py FFF [ 69%]
tests/test_is_stale.py ........... [ 86%]
tests/test_main.py . [ 87%]
tests/test_utility_functions.py ........ [100%]
================================================================================= FAILURES =================================================================================
_______________________________________________________ test_develop[source0-spec0-jupyter-packaging-test/test.txt] ________________________________________________________
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c6263820>, source = ('share/test.txt',), spec = ('jupyter-packaging-test', 'share', '**/*')
target = 'jupyter-packaging-test/test.txt'
@fail_if_not_removed
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_develop(make_package_deprecated, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package_deprecated(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c62318b0>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...Installing collected packages: jupyter-packaging-test-foo\n Running setup.py develop for jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/
Complete output (42 lines):
running develop
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py:10: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = create_cmdclass('jsdeps', data_files_spec=[('jupyter-packaging-test', 'share', '**/*')], exclude=exclude)
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py:11: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['jsdeps'] = install_npm()
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'skip_if_exists'
warnings.warn(msg)
/tmp/pip-build-env-am0ch5u2/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-am0ch5u2/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20477.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source0_spec0_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
____________________________________________________ test_develop[source1-spec1-jupyter-packaging-test/level1/test.txt] ____________________________________________________
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c6732e50>, source = ('share/test.txt',)
spec = ('jupyter-packaging-test/level1', 'share', '**/[a-z]est.txt'), target = 'jupyter-packaging-test/level1/test.txt'
@fail_if_not_removed
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_develop(make_package_deprecated, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package_deprecated(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c6220670>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...Installing collected packages: jupyter-packaging-test-foo\n Running setup.py develop for jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/
Complete output (42 lines):
running develop
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py:10: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = create_cmdclass('jsdeps', data_files_spec=[('jupyter-packaging-test/level1', 'share', '**/[a-z]est.txt')], exclude=exclude)
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py:11: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['jsdeps'] = install_npm()
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'skip_if_exists'
warnings.warn(msg)
/tmp/pip-build-env-4skow_50/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-4skow_50/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20499.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source1_spec1_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
_______________________________________________________ test_develop[source2-spec2-jupyter-packaging-test/test.txt] ________________________________________________________
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c6263550>, source = ('level1/test/test.txt',)
spec = ('jupyter-packaging-test', 'level1/test', '**/*'), target = 'jupyter-packaging-test/test.txt'
@fail_if_not_removed
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_develop(make_package_deprecated, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package_deprecated(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c620ec70>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...Installing collected packages: jupyter-packaging-test-foo\n Running setup.py develop for jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/
Complete output (42 lines):
running develop
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py:10: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = create_cmdclass('jsdeps', data_files_spec=[('jupyter-packaging-test', 'level1/test', '**/*')], exclude=exclude)
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py:11: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['jsdeps'] = install_npm()
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'skip_if_exists'
warnings.warn(msg)
/tmp/pip-build-env-22g02x5u/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-22g02x5u/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20559.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source2_spec2_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
________________________________________________ test_develop[source3-spec3-jupyter-packaging-test//level1/level2/test.txt] ________________________________________________
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c6343550>, source = ('level1/test/test.txt',)
spec = ('jupyter-packaging-test/level1/level2', 'level1/test', '**/*'), target = 'jupyter-packaging-test//level1/level2/test.txt'
@fail_if_not_removed
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_develop(make_package_deprecated, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package_deprecated(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c6265e20>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...Installing collected packages: jupyter-packaging-test-foo\n Running setup.py develop for jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/
Complete output (42 lines):
running develop
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py:10: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = create_cmdclass('jsdeps', data_files_spec=[('jupyter-packaging-test/level1/level2', 'level1/test', '**/*')], exclude=exclude)
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py:11: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['jsdeps'] = install_npm()
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'skip_if_exists'
warnings.warn(msg)
/tmp/pip-build-env-d7ipludc/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-d7ipludc/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20587.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source3_spec3_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
_________________________________________________ test_develop[source4-spec4-jupyter-packaging-test/level2/test/test.txt] __________________________________________________
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c61f19d0>, source = ('level1/level2/test/test.txt',)
spec = ('jupyter-packaging-test', 'level1', '**/*'), target = 'jupyter-packaging-test/level2/test/test.txt'
@fail_if_not_removed
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_develop(make_package_deprecated, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package_deprecated(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:69:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c60d22b0>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...Installing collected packages: jupyter-packaging-test-foo\n Running setup.py develop for jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/
Complete output (42 lines):
running develop
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py:10: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = create_cmdclass('jsdeps', data_files_spec=[('jupyter-packaging-test', 'level1', '**/*')], exclude=exclude)
/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py:11: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['jsdeps'] = install_npm()
/usr/lib64/python3.8/distutils/dist.py:274: UserWarning: Unknown distribution option: 'skip_if_exists'
warnings.warn(msg)
/tmp/pip-build-env-1wj4wxah/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-1wj4wxah/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20613.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_develop_source4_spec4_jup0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
_______________________________________________________ test_install[source0-spec0-jupyter-packaging-test/test.txt] ________________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c60478b0>, source = ('share/test.txt',), spec = ('jupyter-packaging-test', 'share', '**/*')
target = 'jupyter-packaging-test/test.txt'
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_install(make_package, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> assert target_path.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/test.txt')>()
E + where <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/test.txt')> = PosixPath('/usr/jupyter-packaging-test/test.txt').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:89: AssertionError
____________________________________________________ test_install[source1-spec1-jupyter-packaging-test/level1/test.txt] ____________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c5f370d0>, source = ('share/test.txt',)
spec = ('jupyter-packaging-test/level1', 'share', '**/[a-z]est.txt'), target = 'jupyter-packaging-test/level1/test.txt'
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_install(make_package, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> assert target_path.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level1/test.txt')>()
E + where <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level1/test.txt')> = PosixPath('/usr/jupyter-packaging-test/level1/test.txt').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:89: AssertionError
_______________________________________________________ test_install[source2-spec2-jupyter-packaging-test/test.txt] ________________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c5f37c10>, source = ('level1/test/test.txt',)
spec = ('jupyter-packaging-test', 'level1/test', '**/*'), target = 'jupyter-packaging-test/test.txt'
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_install(make_package, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> assert target_path.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/test.txt')>()
E + where <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/test.txt')> = PosixPath('/usr/jupyter-packaging-test/test.txt').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:89: AssertionError
________________________________________________ test_install[source3-spec3-jupyter-packaging-test//level1/level2/test.txt] ________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c5f37a60>, source = ('level1/test/test.txt',)
spec = ('jupyter-packaging-test/level1/level2', 'level1/test', '**/*'), target = 'jupyter-packaging-test//level1/level2/test.txt'
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_install(make_package, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> assert target_path.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level1/level2/test.txt')>()
E + where <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level1/level2/test.txt')> = PosixPath('/usr/jupyter-packaging-test/level1/level2/test.txt').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:89: AssertionError
_________________________________________________ test_install[source4-spec4-jupyter-packaging-test/level2/test/test.txt] __________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c5f37ee0>, source = ('level1/level2/test/test.txt',)
spec = ('jupyter-packaging-test', 'level1', '**/*'), target = 'jupyter-packaging-test/level2/test/test.txt'
@pytest.mark.parametrize(
'source,spec,target',
data_files_combinations
)
def test_install(make_package, source,spec,target):
name = 'jupyter_packaging_test_foo'
package_dir = make_package(name=name, data_files=source, data_files_spec=[spec])
target_path = pathlib.Path(sys.prefix).joinpath(target)
if target_path.exists():
shutil.rmtree(str(target_path.parent))
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> assert target_path.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level2/test/test.txt')>()
E + where <bound method Path.exists of PosixPath('/usr/jupyter-packaging-test/level2/test/test.txt')> = PosixPath('/usr/jupyter-packaging-test/level2/test/test.txt').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_datafiles_install.py:89: AssertionError
___________________________________________________________________________ test_create_cmdclass ___________________________________________________________________________
self = <jupyter_packaging.setupbase._wrap_command.<locals>.WrappedCommand object at 0x7f37c61d4ca0>
def check_site_dir(self): # noqa: C901 # is too complex (12) # FIXME
"""Verify that self.install_dir is .pth-capable dir, if needed"""
instdir = normalize_path(self.install_dir)
pth_file = os.path.join(instdir, 'easy-install.pth')
if not os.path.exists(instdir):
try:
os.makedirs(instdir)
except (OSError, IOError):
self.cant_write_to_target()
# Is it a configured, PYTHONPATH, implicit, or explicit site dir?
is_site_dir = instdir in self.all_site_dirs
if not is_site_dir and not self.multi_version:
# No? Then directly test whether it does .pth file processing
is_site_dir = self.check_pth_processing()
else:
# make sure we can write to target dir
testfile = self.pseudo_tempname() + '.write-test'
test_exists = os.path.exists(testfile)
try:
if test_exists:
os.unlink(testfile)
> open(testfile, 'w').close()
E PermissionError: [Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20261.write-test'
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:471: PermissionError
During handling of the above exception, another exception occurred:
make_package_deprecated = <function make_package_base.<locals>.do_stuff at 0x7f37c6200b80>, mocker = <pytest_mock.plugin.MockerFixture object at 0x7f37c6347ac0>
def test_create_cmdclass(make_package_deprecated, mocker):
source = ("share/test.txt",)
spec = ("jupyter-packaging-test", "share", "**/*")
target = "jupyter-packaging-test/test.txt"
pkg_path = make_package_deprecated(data_files=source, data_files_spec=spec)
os.chdir(pkg_path)
cmdclass = pkg.create_cmdclass(
package_data_spec=dict(foo="*.*"),
data_files_spec=[spec],
exclude=lambda x: False
)
for name in ['build_py', 'handle_files', 'sdist', 'bdist_wheel']:
assert name in cmdclass
dist = Distribution()
cmdclass['handle_files'](dist).run()
assert dist.data_files == [('jupyter-packaging-test', ['share/test.txt'])]
assert dist.package_data == {'foo': []}
# Test installation of data_files in develop mode
dist = Distribution()
handler = cmdclass['handle_files'](dist)
develop = cmdclass['develop'](dist)
def run_command(name):
cmdclass[name](dist).run()
mocker.patch.object(pkg.develop, 'install_for_development')
develop.run_command = run_command
> develop.install_for_development()
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:101:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:685: in install_for_development
self.finalize_options()
/usr/lib/python3.8/site-packages/setuptools/command/develop.py:52: in finalize_options
easy_install.finalize_options(self)
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:315: in finalize_options
self.check_site_dir()
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:474: in check_site_dir
self.cant_write_to_target()
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <jupyter_packaging.setupbase._wrap_command.<locals>.WrappedCommand object at 0x7f37c61d4ca0>
def cant_write_to_target(self):
msg = self.__cant_write_msg % (sys.exc_info()[1], self.install_dir,)
if not os.path.exists(self.install_dir):
msg += '\n' + self.__not_exists_id
else:
msg += '\n' + self.__access_msg
> raise DistutilsError(msg)
E distutils.errors.DistutilsError: can't create or remove files in install directory
E
E The following error occurred while trying to add or remove files in the
E installation directory:
E
E [Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20261.write-test'
E
E The installation directory you specified (via --install-dir, --prefix, or
E the distutils default setting) was:
E
E /usr/lib/python3.8/site-packages/
E
E Perhaps your account does not have write access to this directory? If the
E installation directory is a system-owned directory, you may need to sign in
E as the administrator or "root" account. If you do not have administrative
E access to this machine, you may wish to choose a different installation
E directory, preferably one that is listed in your PYTHONPATH environment
E variable.
E
E For information on other options, you may wish to consult the
E documentation at:
E
E https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
E
E Please make the appropriate changes for your system and try again.
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:534: DistutilsError
_______________________________________________________________________________ test_install _______________________________________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c6200c10>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-0/test_install0')
def test_install(make_package, tmp_path):
name = 'jupyter_packaging_test_foo'
ensured_targets=[f'{name}/main.py']
package_dir = make_package(name=name, ensured_targets=ensured_targets)
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
# Get site packages where the package is installed.
sitepkg = Path(sysconfig.get_paths()["purelib"])
installed_file = sitepkg / f"{name}/main.py"
> assert installed_file.exists()
E AssertionError: assert False
E + where False = <bound method Path.exists of PosixPath('/usr/lib/python3.8/site-packages/jupyter_packaging_test_foo/main.py')>()
E + where <bound method Path.exists of PosixPath('/usr/lib/python3.8/site-packages/jupyter_packaging_test_foo/main.py')> = PosixPath('/usr/lib/python3.8/site-packages/jupyter_packaging_test_foo/main.py').exists
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_install.py:18: AssertionError
___________________________________________________________________________ test_install_hybrid ____________________________________________________________________________
make_hybrid_package = <function make_package_base.<locals>.do_stuff at 0x7f37c600ff70>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-0/test_install_hybrid0')
def test_install_hybrid(make_hybrid_package, tmp_path):
name = 'jupyter_packaging_test_foo'
ensured_targets = [f"{name}/main.py", f"{name}/generated.js"]
package_dir = make_hybrid_package(name=name, ensured_targets=ensured_targets, skip_if_exists=[f"{name}/generated.js"])
> subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_install.py:29:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_install_hybrid0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c631b9a0>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nProcessing /tmp/pytest-of-tkloczko/py...upyter-packaging-test-foo (pyproject.toml): finished with status 'error'\nFailed to build jupyter-packaging-test-foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp52zj7g6v
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_install_hybrid0/package
Complete output (36 lines):
running bdist_wheel
running pre_dist
`npm` unavailable. If you're running this command using sudo, make sure `npm` is available to sudo
running ensure_targets
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 13, in <module>
setuptools.setup(data_files=data_files, cmdclass=cmdclass, packages=setuptools.find_packages('.'),
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/jupyter_packaging/setupbase.py", line 133, in run
self.run_command('ensure_targets')
File "/usr/lib64/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-0bvi_ope/overlay/lib/python3.8/site-packages/jupyter_packaging/setupbase.py", line 409, in run
raise ValueError(('missing files: %s' % missing))
ValueError: missing files: ['jupyter_packaging_test_foo/generated.js']
----------------------------------------
ERROR: Failed building wheel for jupyter-packaging-test-foo
ERROR: Could not build wheels for jupyter-packaging-test-foo, which is required to install pyproject.toml-based projects
___________________________________________________________________________ test_install_missing ___________________________________________________________________________
make_package = <function make_package_base.<locals>.do_stuff at 0x7f37c6282040>, tmp_path = PosixPath('/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0')
def test_install_missing(make_package, tmp_path):
name = 'jupyter_packaging_test_foo'
ensured_targets=[f'{name}/missing.py']
package_dir = make_package(name=name, ensured_targets=ensured_targets)
with pytest.raises(subprocess.CalledProcessError):
subprocess.check_output([shutil.which('pip'), 'install', '.'], cwd=str(package_dir))
> subprocess.check_output([shutil.which('pip'), 'install', '-e', '.'], cwd=str(package_dir))
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_install.py:53:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib64/python3.8/subprocess.py:415: in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
input = None, capture_output = False, timeout = None, check = True, popenargs = (['/usr/bin/pip', 'install', '-e', '.'],)
kwargs = {'cwd': '/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package', 'stdout': -1}, process = <subprocess.Popen object at 0x7f37c622a8e0>
stdout = b"Defaulting to user installation because normal site-packages is not writeable\nObtaining file:///tmp/pytest-of-tkloc...es/jupyter_packaging_test_foo/\n from /home/tkloczko/.local/lib/python3.8/site-packages/~upyter_packaging_test_foo\n"
stderr = None, retcode = 1
def run(*popenargs,
input=None, capture_output=False, timeout=None, check=False, **kwargs):
"""Run command with arguments and return a CompletedProcess instance.
The returned instance will have attributes args, returncode, stdout and
stderr. By default, stdout and stderr are not captured, and those attributes
will be None. Pass stdout=PIPE and/or stderr=PIPE in order to capture them.
If check is True and the exit code was non-zero, it raises a
CalledProcessError. The CalledProcessError object will have the return code
in the returncode attribute, and output & stderr attributes if those streams
were captured.
If timeout is given, and the process takes too long, a TimeoutExpired
exception will be raised.
There is an optional argument "input", allowing you to
pass bytes or a string to the subprocess's stdin. If you use this argument
you may not also use the Popen constructor's "stdin" argument, as
it will be used internally.
By default, all communication is in bytes, and therefore any "input" should
be bytes, and the stdout and stderr will be bytes. If in text mode, any
"input" should be a string, and stdout and stderr will be strings decoded
according to locale encoding, or by "encoding" if set. Text mode is
triggered by setting any of text, encoding, errors or universal_newlines.
The other arguments are the same as for the Popen constructor.
"""
if input is not None:
if kwargs.get('stdin') is not None:
raise ValueError('stdin and input arguments may not both be used.')
kwargs['stdin'] = PIPE
if capture_output:
if kwargs.get('stdout') is not None or kwargs.get('stderr') is not None:
raise ValueError('stdout and stderr arguments may not be used '
'with capture_output.')
kwargs['stdout'] = PIPE
kwargs['stderr'] = PIPE
with Popen(*popenargs, **kwargs) as process:
try:
stdout, stderr = process.communicate(input, timeout=timeout)
except TimeoutExpired as exc:
process.kill()
if _mswindows:
# Windows accumulates the output in a single blocking
# read() call run on child threads, with the timeout
# being done in a join() on those threads. communicate()
# _after_ kill() is required to collect that and add it
# to the exception.
exc.stdout, exc.stderr = process.communicate()
else:
# POSIX _communicate already populated the output so
# far into the TimeoutExpired exception.
process.wait()
raise
except: # Including KeyboardInterrupt, communicate handled that.
process.kill()
# We don't call process.wait() as .__exit__ does that for us.
raise
retcode = process.poll()
if check and retcode:
> raise CalledProcessError(retcode, process.args,
output=stdout, stderr=stderr)
E subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
/usr/lib64/python3.8/subprocess.py:516: CalledProcessError
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 /usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmpis447da5
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package
Complete output (35 lines):
running bdist_wheel
running pre_dist
running ensure_targets
Traceback (most recent call last):
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
main()
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
json_out['return_val'] = hook(**hook_input['kwargs'])
File "/usr/lib/python3.8/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 230, in build_wheel
return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 215, in _build_with_temp_dir
self.run_setup()
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 158, in run_setup
exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 13, in <module>
setuptools.setup(data_files=data_files, cmdclass=cmdclass, packages=setuptools.find_packages('.'),
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 159, in setup
return distutils.core.setup(**attrs)
File "/usr/lib64/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/usr/lib64/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/jupyter_packaging/setupbase.py", line 133, in run
self.run_command('ensure_targets')
File "/usr/lib64/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/tmp/pip-build-env-ddyf2q8l/overlay/lib/python3.8/site-packages/jupyter_packaging/setupbase.py", line 409, in run
raise ValueError(('missing files: %s' % missing))
ValueError: missing files: ['jupyter_packaging_test_foo/missing.py']
----------------------------------------
ERROR: Failed building wheel for jupyter-packaging-test-foo
ERROR: Could not build wheels for jupyter-packaging-test-foo, which is required to install pyproject.toml-based projects
ERROR: Command errored out with exit status 1:
command: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix=
cwd: /tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package/
Complete output (32 lines):
running develop
/tmp/pip-build-env-3ujs3lv4/overlay/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
WARNING: The user site-packages directory is disabled.
/tmp/pip-build-env-3ujs3lv4/overlay/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(
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
[Errno 13] Permission denied: '/usr/lib/python3.8/site-packages/test-easy-install-20965.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/lib/python3.8/site-packages/
Perhaps your account does not have write access to this directory? If the
installation directory is a system-owned directory, you may need to sign in
as the administrator or "root" account. If you do not have administrative
access to this machine, you may wish to choose a different installation
directory, preferably one that is listed in your PYTHONPATH environment
variable.
For information on other options, you may wish to consult the
documentation at:
https://setuptools.readthedocs.io/en/latest/deprecated/easy_install.html
Please make the appropriate changes for your system and try again.
----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package/setup.py'"'"'; __file__='"'"'/tmp/pytest-of-tkloczko/pytest-0/test_install_missing0/package/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' develop --no-deps --user --prefix= Check the logs for full command output.
============================================================================= warnings summary =============================================================================
tests/test_deprecated.py::test_ensure_python
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:58: DeprecatedWarning: ensure_python is deprecated as of 0.7 and will be removed in 1.0. Use `setuptools` `python_requires` instead
pkg.ensure_python('>=3.6')
tests/test_deprecated.py::test_ensure_python
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:59: DeprecatedWarning: ensure_python is deprecated as of 0.7 and will be removed in 1.0. Use `setuptools` `python_requires` instead
pkg.ensure_python(['>=3.6', '>=3.5'])
tests/test_deprecated.py::test_ensure_python
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:62: DeprecatedWarning: ensure_python is deprecated as of 0.7 and will be removed in 1.0. Use `setuptools` `python_requires` instead
pkg.ensure_python('<3.5')
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:78: DeprecatedWarning: create_cmdclass is deprecated as of 0.8 and will be removed in 1.0. "
Use `wrap_installers` to handle prebuild steps in cmdclass.
Use `get_data_files` to handle data files.
Use `include_package_data=True` and `MANIFEST.in` for package data.
cmdclass = pkg.create_cmdclass(
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:563: DeprecatedWarning: _get_file_handler is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
handle_files = _get_file_handler(package_data_spec, data_files_spec, exclude)
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:564: DeprecatedWarning: _get_develop_handler is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
develop_handler = _get_develop_handler()
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:574: DeprecatedWarning: _wrap_command is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
build_py=wrapper(build_py, strict=is_repo),
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:576: DeprecatedWarning: _wrap_command is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
sdist=wrapper(sdist, strict=True),
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:581: DeprecatedWarning: _wrap_command is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['bdist_wheel'] = wrapper(bdist_wheel, strict=True)
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:583: DeprecatedWarning: _wrap_command is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmdclass['develop'] = wrapper(develop_handler, strict=True)
tests/test_deprecated.py::test_create_cmdclass
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:666: DeprecatedWarning: _get_package_data is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
files = _get_package_data(key, patterns)
tests/test_deprecated.py::test_create_cmdclass
/usr/lib/python3.8/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
tests/test_deprecated.py::test_create_cmdclass
/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(
tests/test_deprecated.py::test_command_for_func
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:111: DeprecatedWarning: command_for_func is deprecated as of 0.8 and will be removed in 1.0. Use `BaseCommand` directly instead
cmd = pkg.command_for_func(func)
tests/test_deprecated.py::test_command_for_func
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:458: DeprecatedWarning: update_package_data is deprecated as of 0.8 and will be removed in 1.0. Use `use_package_data=True` and `MANIFEST.in` instead
update_package_data(self.distribution)
tests/test_deprecated.py::test_install_npm
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:117: DeprecatedWarning: install_npm is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
builder = pkg.install_npm()
tests/test_deprecated.py::test__wrap_command
/home/tkloczko/rpmbuild/BUILD/jupyter-packaging-0.11.1/tests/test_deprecated.py:131: DeprecatedWarning: _wrap_command is deprecated as of 0.8 and will be removed in 1.0. Use `npm_builder` and `wrap_installers`
cmd = pkg._wrap_command(['js'], TestCommand)
tests/test_deprecated.py::test__wrap_command
/home/tkloczko/rpmbuild/BUILDROOT/python-jupyter-packaging-0.11.1-2.fc35.x86_64/usr/lib/python3.8/site-packages/jupyter_packaging/setupbase.py:647: DeprecatedWarning: update_package_data is deprecated as of 0.8 and will be removed in 1.0. Use `use_package_data=True` and `MANIFEST.in` instead
update_package_data(self.distribution)
tests/test_utility_functions.py::test_get_version
<string>:421: DeprecationWarning: invalid escape sequence \d
-- Docs: https://docs.pytest.org/en/stable/warnings.html
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_deprecated.py:65: Tests RuntimeError for Python 3.10+
FAILED tests/test_datafiles_install.py::test_develop[source0-spec0-jupyter-packaging-test/test.txt] - subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install',...
FAILED tests/test_datafiles_install.py::test_develop[source1-spec1-jupyter-packaging-test/level1/test.txt] - subprocess.CalledProcessError: Command '['/usr/bin/pip', 'in...
FAILED tests/test_datafiles_install.py::test_develop[source2-spec2-jupyter-packaging-test/test.txt] - subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install',...
FAILED tests/test_datafiles_install.py::test_develop[source3-spec3-jupyter-packaging-test//level1/level2/test.txt] - subprocess.CalledProcessError: Command '['/usr/bin/p...
FAILED tests/test_datafiles_install.py::test_develop[source4-spec4-jupyter-packaging-test/level2/test/test.txt] - subprocess.CalledProcessError: Command '['/usr/bin/pip'...
FAILED tests/test_datafiles_install.py::test_install[source0-spec0-jupyter-packaging-test/test.txt] - AssertionError: assert False
FAILED tests/test_datafiles_install.py::test_install[source1-spec1-jupyter-packaging-test/level1/test.txt] - AssertionError: assert False
FAILED tests/test_datafiles_install.py::test_install[source2-spec2-jupyter-packaging-test/test.txt] - AssertionError: assert False
FAILED tests/test_datafiles_install.py::test_install[source3-spec3-jupyter-packaging-test//level1/level2/test.txt] - AssertionError: assert False
FAILED tests/test_datafiles_install.py::test_install[source4-spec4-jupyter-packaging-test/level2/test/test.txt] - AssertionError: assert False
FAILED tests/test_deprecated.py::test_create_cmdclass - distutils.errors.DistutilsError: can't create or remove files in install directory
FAILED tests/test_install.py::test_install - AssertionError: assert False
FAILED tests/test_install.py::test_install_hybrid - subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '.']' returned non-zero exit status 1.
FAILED tests/test_install.py::test_install_missing - subprocess.CalledProcessError: Command '['/usr/bin/pip', 'install', '-e', '.']' returned non-zero exit status 1.
==================================================== 14 failed, 51 passed, 1 skipped, 19 warnings in 243.86s (0:04:03) =====================================================