Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
https://wiki.archlinux.org/title/Bug_reporting_guidelines
Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.
REPEAT: Do NOT report bugs for outdated packages!
FS#52477 - [python-entrypoints] install from PyPI for distribution info
Attached to Project:
Community Packages
Opened by Phil Schaf (flying-sheep) - Tuesday, 10 January 2017, 16:49 GMT
Last edited by Kyle Keen (keenerd) - Wednesday, 08 March 2017, 13:08 GMT
Opened by Phil Schaf (flying-sheep) - Tuesday, 10 January 2017, 16:49 GMT
Last edited by Kyle Keen (keenerd) - Wednesday, 08 March 2017, 13:08 GMT
|
DetailsPython packages should always contain distribution info so that PIP and other tools know about them.
E.g. I get this when trying to update jupyter_contrib_nbextensions: > The 'entrypoints>=0.2.2' distribution was not found and is required by nbconvert You can use this URL template, which saves you from always having to adapt hashes in the PyPI URL: _name=entrypoints source=("https://files.pythonhosted.org/packages/py2.py3/${_name::1}/$_name/$_name-$pkgver-$_name-$pkgver-py2.py3-none-any.whl") For completeness’ sake; this is how a version- and arch-specific URL template would look: _py=cp36 source_x86_64=("https://files.pythonhosted.org/packages/$_py/${_name::1}/$_name/$_name-$pkgver-$_py-${_py}m-manylinux1_x86_64.whl") |
This task depends upon
Closed by Kyle Keen (keenerd)
Wednesday, 08 March 2017, 13:08 GMT
Reason for closing: Fixed
Additional comments about closing: python-entrypoints-0.2.2-3
Wednesday, 08 March 2017, 13:08 GMT
Reason for closing: Fixed
Additional comments about closing: python-entrypoints-0.2.2-3
pip install --compile --no-deps --ignore-installed --root="$pkgdir" "$_name-$pkgver-$_name-$pkgver-py2.py3-none-any.whl"
and the real url is:
_name=entrypoints
source=("https://files.pythonhosted.org/packages/py2.py3/${_name::1}/$_name/$_name-$pkgver-py2.py3-none-any.whl")
here’s an updated PKGBUILD:
# $Id$
# Maintainer: Kyle Keen <keenerd@gmail.com>
_name=entrypoints
pkgname=python-entrypoints
pkgver=0.2.2
pkgrel=3
pkgdesc="https://pypi.python.org/pypi/entrypoints"
arch=('any')
url="https://github.com/takluyver/entrypoints"
license=('MIT')
depends=('python')
_wheel="$_name-$pkgver-py2.py3-none-any.whl"
source=("https://files.pythonhosted.org/packages/py2.py3/${_name::1}/$_name/$_wheel")
noextract=("$_wheel")
md5sums=('73bd7ce92c19b25dc5a20aff41be996a')
package() {
pip install --compile --no-deps --ignore-installed --root="$pkgdir" "$_wheel"
}
It’s an actual bug, so please don’t. PKG-INFO and friends is missing from the package the way it’s installed now.
> we don't use pip and don't encourage it
Hmm, in this case it’s easy: This .whl file’s contents can probably just be extracted to:
$pkgdir$(python3 -c 'import site; print(site.getsitepackages()[-1])')
which will create the necessary directory entrypoints-0.2.2.dist-info/
There’s probably more to do for packages containing scripts and so on.
> We had that problem for one week, and then PyPI fixed it after maintainers from every distro complained.
exactly, so we can now use the files.pythonhosted.org URLs.
python3 -m wheel install "$_wheel"
since build() is chrooted into $pkgdir, this will do the right thing.
the package metadata (egg-info file or dist-info directory) is missing, using
"jupyter nbconvert" with a notebook file fails with this error:
$ pkg_resources.DistributionNotFound: The 'entrypoints>=0.2.2' distribution was not found and is required by nbconvert
The author of python-entrypoints is using flit ( https://github.com/takluyver/flit )
as a simpler alternative to setuptools for packaging. Thus, I don't think upstream
is willing to add a setup.py file.
The debian package maintainer for python-entrypoints has created an egg-file,
that will be included in the package alongside the Python file. Please see the rules file in
https://anonscm.debian.org/cgit/python-modules/packages/entrypoints.git/tree/debian/
I think there are 3 possibilities for fixing this:
* Creating a python-flit package and using it in the PKGBUILD. This could then
also be used for python-testpath, which is by now a missing dependency for
jupyter-nbconvert
* Manually adding an egg-info file to the package as done in debian
* Using python-wheel in the PKGBUILD for installing package as suggested by Phil
in his last comment
and i need nbconvert for work.
> * Creating a python-flit package and using it in the PKGBUILD.
you mean using flit to create a non-wheel package file? can it do that?
> * Manually adding an egg-info file to the package as done in debian
this is silly, as the dist-info inside of the wheel file is equivalent, but newer metadata
> * Using python-wheel in the PKGBUILD for installing package
i think i was wrong. it still says the files in /usr/lib exist… so there is no chroot done automatically(?)
and if we only extract it, it won’t contain __pycache__
so i guess our real options are (if flit can’t create a non-wheel package from it):
1. just use pip. the way i call it above it simply unpacks the files and creates __pycache__
2. extract the wheel and manually create __pycache__ using python -m compileall (which is very manual)
$ flit install --env
If you want to install the wheel file inside the PKGBUILD, than you have to change the root directory to $pkgdir. The files will then be copied to $pkdir/usr/lib/pythonx.y/site-packages
$ pip install entrypoints-0.2.2-py2.py3-none-any.whl --root="$pkgdir"
the former seems much cleaner and more error-proof to me. for reference here’s the correct set of options again:
pip install --compile --no-deps --ignore-installed --root="$pkgdir" "$_wheel"
--compile adds __pycache__ as we want
--no-deps prevents installing dependencies (as we manage them)
--ignore-installed makes it not complain if it finds the module already in PYTHONPATH
--root is obvious