EDIT: Parece que o propósito do setup.py é produzir um pacote para o Mac OSX com py2app
. Então, a questão é agora: Como evitar que o plug-in do python snapcraft chame o setup.py?
Eu estou tentando criar um snap para um aplicativo python, tanto para aprender snap, quanto porque esse aplicativo só existe como um pacote deb 14.04, que não será instalado em meu sistema mais recente. Observe que sou muito novo em python e totalmente novo em snaps ...
O aplicativo é Iramuteq, de iramuteq.org
O arquivo control
do pacote deb existente se parece com isto:
Source: iramuteq
Standards-Version: 0.1.8
Section: science
Priority: extra
Maintainer: Pierre Ratinaud <[email protected]>
Build-Depends: debhelper (>= 7)
Homepage: http://www.iramuteq.org
Package: iramuteq
Architecture: all
Depends: python (>= 2.7), r-base (>= 3.0.0), python-wxgtk2.8 (>= 2.8), python-xlrd (>= 0.6), python-ooolib, r-cran-rgl (>= 0.79)
Description: Interface de R pour les analyses multidimensionnelles
Então, pelo que entendi, eu preciso de algumas bibliotecas python, e eu deveria incorporar o pacote r-cran-rgl.
Aqui está o arquivo snapcraft.yaml
que eu criei:
name: iramuteq # you probably want to 'snapcraft register <name>'
version: '0.7-alpha2' # just for humans, typically '1.2+git' or '1.3.2'
summary: R INTERFACE for multidimensional analysis of texts and questionnaires # 79 char long summary
description: |
IRAMUTEQ is a GNU GPL (v2) licensed software that provides users with
statistical analysis on text corpus and tables composed by individuals/words.
It is based on R software and on python language.
grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots
apps:
iramuteq:
command: iramuteq
parts:
iramuteq:
source: http://www.iramuteq.org/git/iramuteq
source-type: git
plugin: python
python-version: 'python2'
python-packages:
- ooolib
- xlrd
- wxgtk2.8
stage-packages:
- r-base # (>= 3.0.0)
- r-cran-rgl #(>= 0.79)
Em execução snapcraft
, recebo o seguinte erro:
Processing /home/franck/iramuteq/snap/parts/iramuteq/src
Link is a directory, ignoring download_dir
Complete output from command python setup.py egg_info:
warning: no directories found matching 'doc/_static'
warning: no directories found matching 'doc/_templates'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*__pycache__*' found anywhere in distribution
no previously-included directories found matching 'examples/*/build'
no previously-included directories found matching 'examples/*/dist'
no previously-included directories found matching 'examples/*/*/build'
no previously-included directories found matching 'examples/*/*/dist'
no previously-included directories found matching 'examples/*/*/*/build'
no previously-included directories found matching 'examples/*/*/*/dist'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-9UlL_H-build/setup.py", line 21, in <module>
setup_requires=['py2app'],
File "/home/franck/iramuteq/snap/parts/iramuteq/install/usr/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 317, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 372, in fetch_build_eggs
replace_conflicting=True,
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 851, in resolve
dist = best[req.key] = env.best_match(req, ws, installer)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1123, in best_match
return self.obtain(req, installer)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/pkg_resources/__init__.py", line 1135, in obtain
return installer(requirement)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/dist.py", line 440, in fetch_build_egg
return cmd.easy_install(req)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 674, in easy_install
return self.install_item(spec, dist.location, tmpdir, deps)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 700, in install_item
dists = self.install_eggs(spec, download, tmpdir)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 881, in install_eggs
return self.build_and_install(setup_script, setup_base)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1120, in build_and_install
self.run_setup(setup_script, setup_base, args)
File "/home/franck/iramuteq/snap/parts/iramuteq/install/lib/python2.7/site-packages/setuptools/command/easy_install.py", line 1108, in run_setup
raise DistutilsError("Setup script exited with %s" % (v.args[0],))
distutils.errors.DistutilsError: Setup script exited with error: This distribution is only supported on MacOSXdistuitls error.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-9UlL_H-build/
Agora, estou preso com o erro distutils ... e também não tenho certeza se o R deverá (deveria?) ser incorporado no meu snap ou instalado no meu sistema principal.