This is just a report of the problem discussed in [1] which I think is still present (or something similar).
The problem is that for rapid-photo-downloader, the cwd during build holds a setup.cfg, which then gets applied to all python installs during build.
I created a (stupid?) adaptation of the author's defunct snapcraft.yaml from [2] which I put at [3].
On a clean digital-ocean applet (Ubuntu 17.10 server) a "snapcraft" call (both with current HEAD and with current "snap install snapcraft --classic" results in an error while installing the first python package, in this case pip:
(snapcraft) snapper@snapbuild:~/test-snapcraft/rapid$ snapcraft
Preparing to pull rapid-photo-downloader
Hit http://lon1.mirrors.digitalocean.com/ubuntu artful InRelease
Get:1 http://lon1.mirrors.digitalocean.com/ubuntu artful-updates InRelease [81.7 kB]
Get:2 http://lon1.mirrors.digitalocean.com/ubuntu artful-backports InRelease [72.2 kB]
Get:3 http://security.ubuntu.com/ubuntu artful-security InRelease [78.6 kB]
Get:4 http://lon1.mirrors.digitalocean.com/ubuntu artful-updates/universe amd64 Packages [102 kB]
Fetched 335 kB in 0s (0 B/s)
Pulling rapid-photo-downloader
Fetching and installing pip...
Collecting pip
File was already downloaded /home/snapper/test-snapcraft/rapid/parts/rapid-photo-downloader/python-packages/pip-9.0.3-py2.py3-none-any.whl
Successfully downloaded pip
Collecting pip
Installing collected packages: pip
Exception:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 360, in run
prefix=options.prefix_path,
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 784, in install
**kwargs
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 851, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 1064, in move_wheel_files
isolated=self.isolated,
File "/usr/lib/python3/dist-packages/pip/wheel.py", line 247, in move_wheel_files
prefix=prefix,
File "/usr/lib/python3/dist-packages/pip/locations.py", line 153, in distutils_scheme
i.finalize_options()
File "/usr/lib/python3.6/distutils/command/install.py", line 390, in finalize_options
('build_lib', 'build_lib'))
File "/usr/lib/python3.6/distutils/cmd.py", line 286, in set_undefined_options
src_cmd_obj = self.distribution.get_command_obj(src_cmd)
File "/usr/lib/python3.6/distutils/dist.py", line 857, in get_command_obj
self._set_command_options(cmd_obj, options)
File "/usr/lib/python3.6/distutils/dist.py", line 901, in _set_command_options
% (source, command_name, option))
distutils.errors.DistutilsOptionError: error in setup.cfg: command 'build' has no such option 'i18n'
Traceback (most recent call last):
File "/home/snapper/venv/snapcraft/bin/snapcraft", line 11, in <module>
load_entry_point('snapcraft', 'console_scripts', 'snapcraft')()
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 1043, in invoke
return Command.invoke(self, ctx)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/cli/_runner.py", line 79, in run
ctx.forward(lifecyclecli.commands['snap'])
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 553, in forward
return self.invoke(cmd, **kwargs)
File "/home/snapper/venv/snapcraft/lib/python3.6/site-packages/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/cli/lifecycle.py", line 139, in snap
project_options, directory=directory, output=output)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/lifecycle/_packer.py", line 46, in snap
execute('prime', project_options)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 80, in execute
_Executor(config, project_options).run(step, part_names)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 191, in run
self._run_step(step, part, part_names)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/lifecycle/_runner.py", line 236, in _run_step
getattr(part, step)()
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/pluginhandler/__init__.py", line 286, in pull
self.plugin.pull()
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/plugins/python.py", line 199, in pull
self._pip.setup()
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/plugins/_python/_pip.py", line 144, in setup
self._ensure_pip_installed()
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/plugins/_python/_pip.py", line 171, in _ensure_pip_installed
self.install({'pip'}, ignore_installed=True)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/plugins/_python/_pip.py", line 299, in install
'--find-links', self._python_package_dir] + args, cwd=cwd)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/plugins/_python/_pip.py", line 436, in _run
**kwargs)
File "/home/snapper/test-snapcraft/snapcraft/snapcraft/internal/common.py", line 64, in run
subprocess.check_call(['/bin/sh', f.name] + cmd, **kwargs)
File "/usr/lib/python3.6/subprocess.py", line 291, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/bin/sh', '/tmp/tmplmdgvrgr', '/home/snapper/test-snapcraft/rapid/parts/rapid-photo-downloader/install/usr/bin/python3', '-m', 'pip', 'install', '--user', '--no-compile', '--no-index', '--find-links', '/home/snapper/test-snapcraft/rapid/parts/rapid-photo-downloader/python-packages', 'pip', '--ignore-installed']' returned non-zero exit status 2.
This is just a report of the problem discussed in [1] which I think is still present (or something similar).
The problem is that for rapid-photo- downloader, the cwd during build holds a setup.cfg, which then gets applied to all python installs during build.
I created a (stupid?) adaptation of the author's defunct snapcraft.yaml from [2] which I put at [3].
On a clean digital-ocean applet (Ubuntu 17.10 server) a "snapcraft" call (both with current HEAD and with current "snap install snapcraft --classic" results in an error while installing the first python package, in this case pip:
(snapcraft) snapper@ snapbuild: ~/test- snapcraft/ rapid$ snapcraft downloader lon1.mirrors. digitalocean. com/ubuntu artful InRelease lon1.mirrors. digitalocean. com/ubuntu artful-updates InRelease [81.7 kB] lon1.mirrors. digitalocean. com/ubuntu artful-backports InRelease [72.2 kB] security. ubuntu. com/ubuntu artful-security InRelease [78.6 kB] lon1.mirrors. digitalocean. com/ubuntu artful- updates/ universe amd64 Packages [102 kB] downloader test-snapcraft/ rapid/parts/ rapid-photo- downloader/ python- packages/ pip-9.0. 3-py2.py3- none-any. whl python3/ dist-packages/ pip/basecommand .py", line 215, in main python3/ dist-packages/ pip/commands/ install. py", line 360, in run options. prefix_ path, python3/ dist-packages/ pip/req/ req_set. py", line 784, in install python3/ dist-packages/ pip/req/ req_install. py", line 851, in install move_wheel_ files(self. source_ dir, root=root, prefix=prefix) python3/ dist-packages/ pip/req/ req_install. py", line 1064, in move_wheel_files self.isolated, python3/ dist-packages/ pip/wheel. py", line 247, in move_wheel_files python3/ dist-packages/ pip/locations. py", line 153, in distutils_scheme options( ) python3. 6/distutils/ command/ install. py", line 390, in finalize_options python3. 6/distutils/ cmd.py" , line 286, in set_undefined_ options on.get_ command_ obj(src_ cmd) python3. 6/distutils/ dist.py" , line 857, in get_command_obj _set_command_ options( cmd_obj, options) python3. 6/distutils/ dist.py" , line 901, in _set_command_ options errors. DistutilsOption Error: error in setup.cfg: command 'build' has no such option 'i18n' snapper/ venv/snapcraft/ bin/snapcraft" , line 11, in <module> entry_point( 'snapcraft' , 'console_scripts', 'snapcraft')() snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 722, in __call__ snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 697, in main snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 1043, in invoke invoke( self, ctx) snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 895, in invoke self.callback, **ctx.params) snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 535, in invoke snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/decorator s.py", line 17, in new_func context( ), *args, **kwargs) snapper/ test-snapcraft/ snapcraft/ snapcraft/ cli/_runner. py", line 79, in run forward( lifecyclecli. commands[ 'snap'] ) snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 553, in forward snapper/ venv/snapcraft/ lib/python3. 6/site- packages/ click/core. py", line 535, in invoke snapper/ test-snapcraft/ snapcraft/ snapcraft/ cli/lifecycle. py", line 139, in snap options, directory= directory, output=output) snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ lifecycle/ _packer. py", line 46, in snap 'prime' , project_options) snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ lifecycle/ _runner. py", line 80, in execute config, project_ options) .run(step, part_names) snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ lifecycle/ _runner. py", line 191, in run _run_step( step, part, part_names) snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ lifecycle/ _runner. py", line 236, in _run_step snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ pluginhandler/ __init_ _.py", line 286, in pull plugin. pull() snapper/ test-snapcraft/ snapcraft/ snapcraft/ plugins/ python. py", line 199, in pull _pip.setup( ) snapper/ test-snapcraft/ snapcraft/ snapcraft/ plugins/ _python/ _pip.py" , line 144, in setup _ensure_ pip_installed( ) snapper/ test-snapcraft/ snapcraft/ snapcraft/ plugins/ _python/ _pip.py" , line 171, in _ensure_ pip_installed install( {'pip'} , ignore_ installed= True) snapper/ test-snapcraft/ snapcraft/ snapcraft/ plugins/ _python/ _pip.py" , line 299, in install package_ dir] + args, cwd=cwd) snapper/ test-snapcraft/ snapcraft/ snapcraft/ plugins/ _python/ _pip.py" , line 436, in _run snapper/ test-snapcraft/ snapcraft/ snapcraft/ internal/ common. py", line 64, in run check_call( ['/bin/ sh', f.name] + cmd, **kwargs) python3. 6/subprocess. py", line 291, in check_call ror(retcode, cmd) CalledProcessEr ror: Command '['/bin/sh', '/tmp/tmplmdgvrgr', '/home/ snapper/ test-snapcraft/ rapid/parts/ rapid-photo- downloader/ install/ usr/bin/ python3' , '-m', 'pip', 'install', '--user', '--no-compile', '--no-index', '--find-links', '/home/ snapper/ test-snapcraft/ rapid/parts/ rapid-photo- downloader/ python- packages' , 'pip', '--ignore- installed' ]' returned non-zero exit status 2.
Preparing to pull rapid-photo-
Hit http://
Get:1 http://
Get:2 http://
Get:3 http://
Get:4 http://
Fetched 335 kB in 0s (0 B/s)
Pulling rapid-photo-
Fetching and installing pip...
Collecting pip
File was already downloaded /home/snapper/
Successfully downloaded pip
Collecting pip
Installing collected packages: pip
Exception:
Traceback (most recent call last):
File "/usr/lib/
status = self.run(options, args)
File "/usr/lib/
prefix=
File "/usr/lib/
**kwargs
File "/usr/lib/
self.
File "/usr/lib/
isolated=
File "/usr/lib/
prefix=prefix,
File "/usr/lib/
i.finalize_
File "/usr/lib/
('build_lib', 'build_lib'))
File "/usr/lib/
src_cmd_obj = self.distributi
File "/usr/lib/
self.
File "/usr/lib/
% (source, command_name, option))
distutils.
Traceback (most recent call last):
File "/home/
load_
File "/home/
return self.main(*args, **kwargs)
File "/home/
rv = self.invoke(ctx)
File "/home/
return Command.
File "/home/
return ctx.invoke(
File "/home/
return callback(*args, **kwargs)
File "/home/
return f(get_current_
File "/home/
ctx.
File "/home/
return self.invoke(cmd, **kwargs)
File "/home/
return callback(*args, **kwargs)
File "/home/
project_
File "/home/
execute(
File "/home/
_Executor(
File "/home/
self.
File "/home/
getattr(part, step)()
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/home/
self.
File "/home/
'--find-links', self._python_
File "/home/
**kwargs)
File "/home/
subprocess.
File "/usr/lib/
raise CalledProcessEr
subprocess.
[1] https:/ /forum. snapcraft. io/t/python- setup-cfg- wrongly- applied- to-all- python- package- dependencies/ 1097 bazaar. launchpad. net/~dlynch3/ rapid/zeromq_ pyqt/view/ head:/snap/ snapcraft. yaml /gist.github. com/black- puppydog/ 90de8778b4006ed 89196992e7d8002 71
[2] http://
[3] https:/