Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support external dependencies #1478

Closed
wants to merge 2 commits into from

Conversation

svartkanin
Copy link
Collaborator

@svartkanin svartkanin commented Sep 21, 2022

This should enable support for external dependencies, fix #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 :)

@Torxed
Copy link
Member

Torxed commented Sep 21, 2022

Interesting, I'll have a gander at this :) Would this solve pypa/flit#509? :)

@svartkanin
Copy link
Collaborator Author

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

@svartkanin
Copy link
Collaborator Author

I do remember though that in the reworked profile PR #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
Copy link
Collaborator Author

@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
Copy link
Collaborator Author

I'll take this as a reference #1477 (comment) :)

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:)

@Torxed
Copy link
Member

Torxed commented Oct 4, 2022

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

Comment on lines +22 to +25
dependencies = [
"pyparted==3.12.0",
"simple-term-menu==1.5.0",
]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we update the PR to only include this change, after merging upstream master into this PR branch, I think we're good to merge this.

I've replaced flit and the build process in #1655

@svartkanin
Copy link
Collaborator Author

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

@svartkanin svartkanin closed this Apr 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

External Python dependencies
2 participants