You are not logged in.

#1 2026-02-13 01:53:01

krvkir
Member
Registered: 2013-09-28
Posts: 8

The right way to package jupyter-ai python package?

jupyter-ai is a Python package which adds LLM chats and other features to ipython and jupyterlab. Nobody packaged it yet, so I tried to do so.

Appears that the package has a huge number of dependencies which are also not in AUR. For example, it depends on datalayer-core Python package (which provides agentic apis for data science tools or something like that, I'm still figuring out). I made a MAKEPKG draft for datalayer-core, and when I tried to build it, makepkg -s said that it itself depends on some packages not in AUR:

$ cat PKGBUILD
cat PKGBUILD 
cat PKGBUILD 
# Maintainer: krvkir <krvkir@protonmail.com>
pkgname=python-datalayer-core
_name=datalayer-core
_pyname=datalayer_core
pkgver=1.1.15
pkgrel=1
pkgdesc="Datalayer Core - Python and TypeScript clients for Datalayer."
arch=('any')
url="https://github.com/datalayer/core"
license=('BSD')
# Took those deps from the repo's pyproject.toml file; 
#some packages are in AUR and some aren't; 
# those who do may have slightly different names.
depends=(
    'python-jupyter-console'
    'python-jupyter-client'
    'python-jupyter-nbmodel-client'
    'python-jupyter-server'
    'python-keyring'
    'python-mcp'
    'python-pydantic-settings'
    'python-pydantic'
    'python-yaml'
    'python-questionary'
    'python-requests'
    'python-rich'
    'python-traitlets'
    'python-typer'
)
makedepends=('python-build' 'python-installer' 'python-wheel')
source=("https://files.pythonhosted.org/packages/py3/${_name::1}/$_name/$_pyname-$pkgver-py3-none-any.whl")
sha256sums=('SKIP')

package() {
    PIP_CONFIG_FILE=/dev/null pip install --isolated --root="$pkgdir" --ignore-installed --no-deps *.whl
}

$ makepkg -s
makepkg -s
==> Making package: python-datalayer-core 1.1.15-1 (Пт 13 фев 2026 05:30:52)
==> Checking runtime dependencies...
==> Installing missing dependencies...
error: target not found: python-jupyter-console
error: target not found: python-jupyter-nbmodel-client
error: target not found: python-jupyter-server
==> ERROR: 'pacman' failed to install missing dependencies.
==> Missing dependencies:
  -> python-jupyter-console
  -> python-jupyter-nbmodel-client
  -> python-jupyter-server
==> ERROR: Could not resolve all dependencies.

And I guess it goes down recursively for some iterations.

So do I understand it correctly, that to pack such a package, I need to go all the way down the rabbit hole and create an AUR package for each Python package in this dependency tree that is not in AUR yet?

If yes, how to resolve the naming mismatches between Python packages and AUR packages? E.g. there's no python-jupyter-server package in AUR, but there's python-jupterlab-server one, and maybe jupyter-server is already included in it? I could check it by hands but maybe there's the better way?

Last edited by krvkir (2026-02-13 02:22:14)

Offline

#2 2026-02-13 02:53:38

stu
Member
Registered: 2021-10-19
Posts: 15

Re: The right way to package jupyter-ai python package?

jupyter packages don't always have the "python-" prefix:


https://archlinux.org/packages/extra/an … r-console/
https://archlinux.org/packages/extra/an … er-server/
https://archlinux.org/packages/extra/an … -nbclient/
...

Why do you insist on using AUR packages if things are already packed in extra?
Have you at least tried if it works with those?

Last edited by stu (2026-02-13 02:56:02)

Offline

#3 2026-02-13 03:47:37

krvkir
Member
Registered: 2013-09-28
Posts: 8

Re: The right way to package jupyter-ai python package?

Totally don't insist, will try, thanks for the tip!

The datalayer-core example is just one of the top-level dependencies. For now I'm trying to figure out the general strategy of packaging the thing.

Offline

#4 2026-02-13 05:26:26

killertofus
Member
Registered: 2025-02-10
Posts: 156

Re: The right way to package jupyter-ai python package?

pkgname=python-datalayer-core
_pkgname=datalayer-core
pkgver=1.1.15
pkgrel=1
pkgdesc="Datalayer Core - Python and TypeScript clients for Datalayer."
arch=(any)
url="https://core.datalayer.tech/"
license=(BSD-3-Clause)
depends=( 'python' 'jupyter-console' 'python-jupyter-client' 'jupyter-nbclient' 'jupyter-server' 'python-keyring' 'python-mcp' 'python-pydantic-settings' 'python-pydantic' 'python-yaml' 'python-questionary' 'python-requests' 'python-rich' 'python-traitlets' 'python-typer' 'python-traitlets')
makedepends=('python-build' 'python-installer' 'python-wheel' )
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
build() {
  cd "$_pkgname-$pkgver"
  python -m build --wheel --no-isolation
}
package() {
  cd "$srcdir/$_pkgname-$pkgver"
  python -m installer --destdir="$pkgdir" dist/*.whl
}
sha256sums=('')

of course you will need to edit the sha256sums


please enter your credit card number and expiration date to continue this conversation

Offline

#5 2026-02-14 02:35:48

krvkir
Member
Registered: 2013-09-28
Posts: 8

Re: The right way to package jupyter-ai python package?

Thanks killertofus, yes, I'll include the correct checksums in the final PKGBUILDs before pushing them into AUR—that is, if it ever happens, since the problems with this package keep growing.

One more question. It appears that jupyter-nbmodel-client depends on jupyter-ydoc==3.0.5 while the upstream version of jupyter-ydoc (also missing in AUR) is 3.4.0. I can of course pin the older version in jupyter-ydoc PKGBUILD but it'll make this package unusable for other potential packages. Or I can set the upstream version in PKGBUILD and pray it'll work with nbmodel-client. I guess I have no way to solve this dilemma by the means of archlinux packaging system?

Last edited by krvkir (2026-02-14 02:37:21)

Offline

#6 2026-02-14 16:25:51

loqs
Member
Registered: 2014-03-06
Posts: 18,772

Re: The right way to package jupyter-ai python package?

@killerofus that PKGBUILD does not work as https://pypi.org/project/datalayer-core/#files only provides a wheel no source. If there was a source then there would be a missing makedepends on a python build backend. Also BSD-3-Clause is one the licenses that needs to be installed per package.

Offline

Board footer

Powered by FluxBB