archinstall icon indicating copy to clipboard operation
archinstall copied to clipboard

Support external dependencies

Open svartkanin opened this issue 3 years ago • 3 comments

This should enable support for external dependencies, fix https://github.com/archlinux/archinstall/issues/1447

Since the project is using flit as a install/build/publish utility, we should no longer need the legacy setup.{py,cfg} files since everything is managed in the pyproject.toml.

Now, flit has some downsides unfortunately, like it can't install "only" dependencies from a pyproject.toml file and it also doesn't allow to specify a target installation directory. Since https://wiki.archlinux.org/title/Python_package_guidelines#Installation_methods mentions that installation has to be done into a temporary directory flit can't achieve this and therefore can't be used in the PKGBUILD file. Looking at other projects, a fair amount of them are using pip to install both, the dependencies and the package, into the temporary directory, so I borrowed the approach from those

I'm not an expert in the PKGBUILD space so @Torxed please advise if this is a bad idea :)

svartkanin avatar Sep 21 '22 10:09 svartkanin

Interesting, I'll have a gander at this :) Would this solve https://github.com/pypa/flit/issues/509? :)

Torxed avatar Sep 21 '22 10:09 Torxed

@Torxed I haven't tried that actually, I'll test that tomorrow

svartkanin avatar Sep 21 '22 11:09 svartkanin

I do remember though that in the reworked profile PR https://github.com/archlinux/archinstall/pull/1434, I had removed the links since they caused some issues in various IDEs and I wasn't sure about the usage of them. Are those symlinks necessary to keep around and if so is there another use case except having them in the root for more visibility?

svartkanin avatar Sep 21 '22 11:09 svartkanin

@Torxed I run it on my local this is the resulting structure

$ ls pkg/archinstall/usr/lib/python3.10/site-packages/archinstall/
drwxr-xr-x  3 dan dan 4.0K Sep 22 11:37 examples
-rw-r--r--  1 dan dan  12K Sep 22 11:37 __init__.py
drwxr-xr-x 10 dan dan 4.0K Sep 22 11:37 lib
drwxr-xr-x 16 dan dan 4.0K Sep 22 11:37 locales
-rw-r--r--  1 dan dan  481 Sep 22 11:37 __main__.py
drwxr-xr-x  4 dan dan 4.0K Sep 22 11:37 profiles
drwxr-xr-x  2 dan dan 4.0K Sep 22 11:37 __pycache__

when running master with

python setup.py install

it results in

$ ls /usr/lib/python3.10/site-packages/archinstall-2.5.1rc1-py3.10.egg/archinstall/
drwxr-xr-x  3 root root 4.0K Sep 22 11:47 examples
-rw-r--r--  1 root root  13K Sep 22 11:47 __init__.py
drwxr-xr-x 10 root root 4.0K Sep 22 11:47 lib
drwxr-xr-x 20 root root 4.0K Sep 22 11:47 locales
-rw-r--r--  1 root root  481 Sep 22 11:47 __main__.py
drwxr-xr-x  4 root root 4.0K Sep 22 11:47 profiles
drwxr-xr-x  2 root root 4.0K Sep 22 11:47 __pycache__

which seems to be the same

svartkanin avatar Sep 22 '22 01:09 svartkanin

I'll take this as a reference https://github.com/archlinux/archinstall/issues/1477#issuecomment-1265519354 :)

Anything I can help here with further? If we're certain that we're moving forward with external dependencies I'd be keen on starting implementation with pyparted meanwhile:)

svartkanin avatar Oct 03 '22 20:10 svartkanin

Let me check some things first, especially around packaging :)

Torxed avatar Oct 04 '22 06:10 Torxed

This work has all been merged with another PR so I'll close this PR

svartkanin avatar Apr 30 '23 09:04 svartkanin