jauhien / gs-pypi Goto Github PK
View Code? Open in Web Editor NEWg-sorcery backend for pypi packages
License: GNU General Public License v2.0
g-sorcery backend for pypi packages
License: GNU General Public License v2.0
Tensorflow is distributed as a .whl
package, and official documentation recommends installing it with a command like this:
pip install --upgrade https://storage.googleapis.com/tensorflow/linux/gpu/tensorflow-0.6.0-cp34-none-linux_x86_64.whl
On my machine, I have successfully installed Tensorflow using this command with an extra --user
flag.
Would it be possible to use gs-pypi to generate an ebuild for Tensorflow if it is not distributed through PyPI?
Is the use of extra variablesREALNAME and REALVERSION necessary here? or is it just used to simplify the source location?
Native ebuild variables like P, PN and PV could be used instead. It would make simple to change ebuild name and use a newer version of some packages.
Noticed initially with the yoctopuce package (which supports all versions of CPython in Gentoo, but can only be installed through gs-pypi with 2.7, 3.4, or 3.5).
Further confirmed with numerous other packages (in fact, almost anything in PyPI which has a supported version list that isn't exactly equal to what is being offered by all the gs-pypi packages in PYTHON_TARGETS).
It looks like #13 is a special case of this (packages which trigger that don't support any version of Python that Gentoo provides, and thus should not even have ebuilds offered).
May also be of interest for #17.
https://github.com/gentoo/gentoo/blob/61b861acd7b49083dab687e133f30f3331cb7480/app-portage/gs-pypi/gs-pypi-0.2.ebuild#L6
Please add 3_5,3_6 and 3_7 if possible.
PS: I've checked with 3_6 - it works without modifications.
Ok, I am trying to use this method now and getting some errors. I have installed gs-pypi and edited
/etc/g-sorcery/g-sorcery.cfg
[main]
package_manager=portage
[gs-pypi]
pypi_packages=pyvisa
Then
eliasgentoo elias # layman -L | grep pypi
* pypi [g-sorcery ] (gs-pypi pypi )
Then (the error)
eliasgentoo elias # layman -a pypi
* Adding overlay...
* Overlay "pypi" is not an official. Continue install? [y/n]: y
* Running ... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi -r pypi sync )
--2015-07-01 10:12:40-- https://github.com/jauhien/gs-pypi-db/archive/bson.tar.gz
Resolving github.com... 192.30.252.130
Connecting to github.com|192.30.252.130|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/jauhien/gs-pypi-db/tar.gz/bson [following]
--2015-07-01 10:12:40-- https://codeload.github.com/jauhien/gs-pypi-db/tar.gz/bson
Resolving codeload.github.com... 192.30.252.147
Connecting to codeload.github.com|192.30.252.147|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘/tmp/tmprdHXS1/bson.tar.gz’
/tmp/tmprdHXS1/bson [ <=> ] 6.04M 9.13MB/s in 0.7s
2015-07-01 10:12:42 (9.13 MB/s) - ‘/tmp/tmprdHXS1/bson.tar.gz’ saved [6331065]
* unpacking /tmp/tmprdHXS1/bson.tar.gz
gs-pypi-db-bson/
gs-pypi-db-bson/categories.json
gs-pypi-db-bson/dev-python/
gs-pypi-db-bson/dev-python/packages.bson
gs-pypi-db-bson/manifest.json
gs-pypi-db-bson/metadata.json
* copy files to an actual database
‘/tmp/tmpMEz4me/gs-pypi-db-bson/categories.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/categories.json’
‘/tmp/tmpMEz4me/gs-pypi-db-bson/dev-python’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python’
‘/tmp/tmpMEz4me/gs-pypi-db-bson/dev-python/packages.bson’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python/packages.bson’
‘/tmp/tmpMEz4me/gs-pypi-db-bson/manifest.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/manifest.json’
‘/tmp/tmpMEz4me/gs-pypi-db-bson/metadata.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/metadata.json’
* Running g-sorcery... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi generate-tree )
* tree generation
* no package with name pyvisa found
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/g-sorcery", line 18, in <module>
sys.exit(g_sorcery.main())
File "/usr/lib64/python2.7/site-packages/g_sorcery/g_sorcery.py", line 68, in main
return backend.instance(sys.argv[2:], config, global_config)
File "/usr/lib64/python2.7/site-packages/g_sorcery/backend.py", line 641, in __call__
return args.func(args, config, global_config)
File "/usr/lib64/python2.7/site-packages/g_sorcery/backend.py", line 526, in generate_tree
dependencies |= self.get_dependencies(pkg_db, pkg)
File "/usr/lib64/python2.7/site-packages/g_sorcery/backend.py", line 347, in get_dependencies
raise DependencyError(error)
g_sorcery.exceptions.DependencyError: no package with name pyvisa found
* Failure result returned from g-sorcery
* Adding repository "pypi" failed! Possible remains of the operation have NOT been removed and may be left at "/var/lib/layman/pypi". Please remove them manually if required.
* CLI: Errors occurred processing action add
* Adding repository "pypi" failed! Possible remains of the operation have NOT been removed and may be left at "/var/lib/layman/pypi". Please remove them manually if required.
keras
is definitely in PyPI:
$ pip install keras
Collecting keras
Downloading Keras-0.3.1.tar.gz (69kB)
...
However, attempting to register it in /etc/g-sorcery/g-sorcery.cfg
and install it fails with DependencyError
:
$ sudo layman -s pypi
* Fetching remote list...
* Fetch Ok
* Syncing selected overlay(s)...
* Running ... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi -r pypi sync )
Already up-to-date.
* copy files to an actual database
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/categories.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/categories.json»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/dev-python» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/dev-python/packages.bson» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python/packages.bson»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/manifest.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/manifest.json»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/metadata.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/metadata.json»
* Running g-sorcery... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi generate-tree )
* tree generation
!!! Repository 'pypi' is missing masters attribute in '/var/lib/layman/pypi/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
* no package with name keras found
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.4/g-sorcery", line 18, in <module>
sys.exit(g_sorcery.main())
File "/usr/lib64/python3.4/site-packages/g_sorcery/g_sorcery.py", line 68, in main
return backend.instance(sys.argv[2:], config, global_config)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 652, in __call__
return args.func(args, config, global_config)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 530, in generate_tree
dependencies |= self.get_dependencies(pkg_db, pkg)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 351, in get_dependencies
raise DependencyError(error)
g_sorcery.exceptions.DependencyError: no package with name keras found
* Failure result returned from g-sorcery
*
* Errors:
* ------
* Failed to sync overlay "pypi".
* Error was: Syncing overlay "pypi" returned status 1!
* db.sync()
*
* CLI: Errors occurred processing action sync
*
* Errors:
* ------
* Failed to sync overlay "pypi".
* Error was: Syncing overlay "pypi" returned status 1!
* db.sync()
*
Attempting to import telegram
with python-telegram-bot
installed via gs-pypi
fails with:
File "/usr/lib64/python3.4/site-packages/telegram/__init__.py", line 46, in <module>
from .emoji import Emoji
File "/usr/lib64/python3.4/site-packages/telegram/emoji.py", line 24, in <module>
from future.utils import bytes_to_native_str as n
ImportError: No module named 'future'
However, pip
is able to resolve the dependency:
$ pip install --user python-telegram-bot
Collecting python-telegram-bot
Downloading python_telegram_bot-3.2.0-py2.py3-none-any.whl (66kB)
100% |████████████████████████████████| 69kB 402kB/s
Collecting future (from python-telegram-bot)
Downloading future-0.15.2.tar.gz (1.6MB)
100% |████████████████████████████████| 1.6MB 201kB/s
Building wheels for collected packages: future
Running setup.py bdist_wheel for future
Stored in directory: /home/pastafarianist/.cache/pip/wheels/d9/04/36/6bd807b5148e7c929d8f0991cc943a81f3287030a1b352e3fc
Successfully built future
Installing collected packages: future, python-telegram-bot
Successfully installed future-0.15.2 python-telegram-bot-3.2.0
UPD: sorry, I missed
Note, that at the moment gs-pypi doesn't support dependencies for pypi packages, so you need to add to this list package itself and all its dependencies.
I guess I should rename the issue.
Source URLs of the format http://pypi.python.org/packages/source/${REALNAME:0:1}/${REALNAME}/${REALNAME}-${REALVERSION}.tar.gz
are broken. This is a severe issue because atm, no package can be installed.
Hardcoding URL format in code is also a bad idea in general:
{"name" : "src_uri", "value" : 'http://pypi.python.org/packages/source/${REALNAME:0:1}/${REALNAME}/${REALNAME}-${REALVERSION}.tar.gz'}
should be using portage third-party mirror format (mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz
).
I configure gs-pypi:
[main]
package_manager=portage
[gs-pypi]
pypi_packages=msbackup
I added one package to list (my own pacgage) msbackup: https://pypi.python.org/pypi/msbackup
LOG::
$ sudo layman --add pypi
Traceback (most recent call last):
File "/usr/lib/python-exec/python2.7/g-sorcery", line 18, in
sys.exit(g_sorcery.main())
File "/usr/lib/python2.7/site-packages/g_sorcery/g_sorcery.py", line 68, in main
return backend.instance(sys.argv[2:], config, global_config)
File "/usr/lib/python2.7/site-packages/g_sorcery/backend.py", line 652, in call
return args.func(args, config, global_config)
File "/usr/lib/python2.7/site-packages/g_sorcery/backend.py", line 530, in generate_tree
dependencies |= self.get_dependencies(pkg_db, pkg)
File "/usr/lib/python2.7/site-packages/g_sorcery/backend.py", line 351, in get_dependencies
raise DependencyError(error)
g_sorcery.exceptions.DependencyError: no package with name msbackup found
(this time it's not Skflow or something like that)
$ sudo layman -s pypi
* Fetching remote list...
* Fetch Ok
* Syncing selected overlay(s)...
* Running ... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi -r pypi sync )
Already up-to-date.
* copy files to an actual database
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/categories.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/categories.json»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/dev-python» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/dev-python/packages.bson» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python/packages.bson»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/manifest.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/manifest.json»
«/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/persistent/remote/metadata.json» -> «/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/metadata.json»
* Running g-sorcery... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi generate-tree )
* tree generation
!!! Repository 'pypi' is missing masters attribute in '/var/lib/layman/pypi/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
* no package with name skflow found
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.4/g-sorcery", line 18, in <module>
sys.exit(g_sorcery.main())
File "/usr/lib64/python3.4/site-packages/g_sorcery/g_sorcery.py", line 68, in main
return backend.instance(sys.argv[2:], config, global_config)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 652, in __call__
return args.func(args, config, global_config)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 530, in generate_tree
dependencies |= self.get_dependencies(pkg_db, pkg)
File "/usr/lib64/python3.4/site-packages/g_sorcery/backend.py", line 351, in get_dependencies
raise DependencyError(error)
g_sorcery.exceptions.DependencyError: no package with name skflow found
* Failure result returned from g-sorcery
*
* Errors:
* ------
* Failed to sync overlay "pypi".
* Error was: Syncing overlay "pypi" returned status 1!
* db.sync()
*
* CLI: Errors occurred processing action sync
*
* Errors:
* ------
* Failed to sync overlay "pypi".
* Error was: Syncing overlay "pypi" returned status 1!
* db.sync()
*
$ pip install --user skflow
Collecting skflow
Downloading skflow-0.1.0.tar.gz
Collecting sklearn (from skflow)
Downloading sklearn-0.0.tar.gz
Requirement already satisfied (use --upgrade to upgrade): scipy in /usr/lib64/python3.4/site-packages (from skflow)
Requirement already satisfied (use --upgrade to upgrade): numpy in /usr/lib64/python3.4/site-packages (from skflow)
Requirement already satisfied (use --upgrade to upgrade): scikit-learn in /usr/lib64/python3.4/site-packages (from sklearn->skflow)
Building wheels for collected packages: skflow, sklearn
Running setup.py bdist_wheel for skflow
Stored in directory: /home/pastafarianist/.cache/pip/wheels/fe/1b/2c/25df8955c97d579fd768b3229088ee689e6c8c2b5d8103e155
Running setup.py bdist_wheel for sklearn
Stored in directory: /home/pastafarianist/.cache/pip/wheels/df/0e/0e/8f29513562deeafd8e895b4e60df6b05be4e937810d420f141
Successfully built skflow sklearn
Installing collected packages: sklearn, skflow
Successfully installed skflow-0.1.0 sklearn-0.0
Alot of packages spits out an error of this kind, for example:
* ERROR: dev-python/yubico-client-1.10.0::pypi failed (depend phase):
* No supported implementation in PYTHON_COMPAT.
I was trying to install guidata package and noticed that the database is outdated.
This is an issue cause either the older versions are removed online or they moved somewhere else.
How is the database generated? Automatically or you need to updated by hand? If it is automatic could not be possible to g-sorcery do it when requested?
I always get this warning when updating the pypi overlay
--2015-02-22 12:46:49-- https://github.com/jauhien/gs-pypi-db/archive/master.tar.gz
Resolving github.com... 192.30.252.129
Connecting to github.com|192.30.252.129|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://codeload.github.com/jauhien/gs-pypi-db/tar.gz/master [following]
--2015-02-22 12:46:51-- https://codeload.github.com/jauhien/gs-pypi-db/tar.gz/master
Resolving codeload.github.com... 192.30.252.145
Connecting to codeload.github.com|192.30.252.145|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/x-gzip]
Saving to: ‘/tmp/tmp6oO6r7/master.tar.gz’
master.tar.gz [ <=> ] 7.25M 1.34MB/s in 9.5s
2015-02-22 12:47:03 (779 KB/s) - ‘/tmp/tmp6oO6r7/master.tar.gz’ saved [7597221]
* unpacking /tmp/tmp6oO6r7/master.tar.gz
gs-pypi-db-master/
gs-pypi-db-master/categories.json
gs-pypi-db-master/dev-python/
gs-pypi-db-master/dev-python/packages.json
gs-pypi-db-master/manifest.json
* checking manifest
* copy files to an actual database
‘/tmp/tmpi78Z5G/gs-pypi-db-master/categories.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/categories.json’
‘/tmp/tmpi78Z5G/gs-pypi-db-master/dev-python’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python’
‘/tmp/tmpi78Z5G/gs-pypi-db-master/dev-python/packages.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/dev-python/packages.json’
‘/tmp/tmpi78Z5G/gs-pypi-db-master/manifest.json’ -> ‘/var/lib/layman/pypi/.g-sorcery/gs_pypi/pypi/db/manifest.json’
* checking manifest
* Running g-sorcery... # ( cd /var/lib/layman/pypi && /usr/bin/g-sorcery gs-pypi -o /var/lib/layman/pypi generate-tree )
* tree generation
* checking manifest
!!! Repository 'pypi' is missing masters attribute in '/var/lib/layman/pypi/metadata/layout.conf'
!!! Set 'masters = gentoo' in this file for future compatibility
* generating dev-python/shadowsocks-2.4.3
* fast digesting overlay
‰ gs-pypi-generate-db .g-sorcery/gs_pypi/pypi/db/
--2018-04-24 23:38:00-- https://pypi.python.org/pypi?%3Aaction=index
Resolving pypi.python.org (pypi.python.org)... 151.101.84.223, 2a04:4e42:14::223
Connecting to pypi.python.org (pypi.python.org)|151.101.84.223|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pypi.org/pypi?%3Aaction=index [following]
--2018-04-24 23:38:00-- https://pypi.org/pypi?%3Aaction=index
Resolving pypi.org (pypi.org)... 151.101.64.223, 151.101.0.223, 151.101.128.223, ...
Connecting to pypi.org (pypi.org)|151.101.64.223|:443... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://pypi.org/pypi/?%3Aaction=index [following]
--2018-04-24 23:38:01-- https://pypi.org/pypi/?%3Aaction=index
Reusing existing connection to pypi.org:443.
HTTP request sent, awaiting response... 404 Not Found
2018-04-24 23:38:01 ERROR 404: Not Found.
Traceback (most recent call last):
File "/usr/lib/python-exec/python3.5/gs-pypi-generate-db", line 18, in <module>
sys.exit(gs_pypi_generate_db.main())
File "/usr/lib64/python3.5/site-packages/gs_pypi/gs_pypi_generate_db.py", line 68, in main
common_config=config["common_config"])
File "/usr/lib64/python3.5/site-packages/g_sorcery/package_db.py", line 563, in __call__
self.generate_tree(pkg_db, common_config, config)
File "/usr/lib64/python3.5/site-packages/g_sorcery/package_db.py", line 577, in generate_tree
data = self.download_data(common_config, config)
File "/usr/lib64/python3.5/site-packages/g_sorcery/package_db.py", line 595, in download_data
self.process_uri(uri, data)
File "/usr/lib64/python3.5/site-packages/g_sorcery/package_db.py", line 606, in process_uri
data.update(load_remote_file(**uri))
File "/usr/lib64/python3.5/site-packages/g_sorcery/fileutils.py", line 283, in load_remote_file
raise DownloadingError("wget failed: " + uri)
g_sorcery.exceptions.DownloadingError: wget failed: https://pypi.python.org/pypi?%3Aaction=index
Hi jauhien,
Currently when doing a layman -S
, gs-pypi will always redownload tarball https://codeload.github.com/jauhien/gs-pypi-db/tar.gz/bson
. Since the snapshot is hosted on github, is it possible to use git to update the database to save the bandwidth and speed up the whole process?
pypi.pyhton.org now requires https for download. The link produced in the ebuilds are using http, which means that downloading code when emerging now does not work.
Testing with wget to confirm problem:
--2017-12-08 15:19:18-- http://pypi.python.org/packages/source/g/geographiclib/geographiclib-1.45.tar.gz
Slår opp vertsnavn pypi.python.org (pypi.python.org) … 151.101.0.223, 151.101.64.223, 151.101.128.223, ...
Kobler til pypi.python.org (pypi.python.org)|151.101.0.223|:80 …tilkoblet.
HTTP-forespørsel sendt. Venter på svar … 403 SSL is required
2017-12-08 15:19:18 PROGRAMFEIL 403: SSL is required.
--2017-12-08 15:19:26-- https://pypi.python.org/packages/source/g/geographiclib/geographiclib-1.45.tar.gz
Slår opp vertsnavn pypi.python.org (pypi.python.org) … 151.101.0.223, 151.101.64.223, 151.101.128.223, ...
Kobler til pypi.python.org (pypi.python.org)|151.101.0.223|:443 …tilkoblet.
HTTP-forespørsel sendt. Venter på svar … 200 OK
Lengde: 28859 (28K) [application/octet-stream]
Lagrer til: «geographiclib-1.45.tar.gz»
geographiclib-1.45.tar.gz 100%[=======================================================
2017-12-08 15:19:27 (930 KB/s) - «geographiclib-1.45.tar.gz» lagret [28859/28859]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.