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

sabnzbd: python target dependencies #20096

Merged
merged 1 commit into from May 16, 2024
Merged

sabnzbd: python target dependencies #20096

merged 1 commit into from May 16, 2024

Conversation

tqfx
Copy link
Contributor

@tqfx tqfx commented May 11, 2024

Close #20060

@tqfx
Copy link
Contributor Author

tqfx commented May 11, 2024

How about using termux_step_post_get_source to get the main dependencies of this python target?

termux_step_post_get_source() {
	export TERMUX_PKG_PYTHON_TARGET_DEPS=""
	while IFS="" read -r dep
	do
		if [ -z "$dep" ]; then
			break
		fi
		dep="${dep/[# ]*}"
		if [ -z "$dep" ]; then
			continue
		fi
		TERMUX_PKG_PYTHON_TARGET_DEPS+="'$dep', "
	done < $TERMUX_PKG_SRCDIR/requirements.txt
}

Don't want to worry about tomorrow!

@tqfx tqfx marked this pull request as ready for review May 11, 2024 12:08
@licy183
Copy link
Member

licy183 commented May 11, 2024

For this package, parsing them from requirements.txt seems okay, because it is not a regular python package, but a program using python.

Maybe it is off-topic, but I want to discuss this issue for other regular python packages.

In fact, in python packages, requirements.txt does not guarantee that all existing items are runtime dependencies - it may contain some build-time dependencies, or some dependencies that exist when building the extra module. If possible, a better approach is to get the METADATA file from the already-built wheel and read the Requires-Dist entry from it. Besides, just installing the package itself in postinst will be a possible approach to this issue too.

termux_step_create_debscripts() {
	cat <<- EOF > ./postinst
	#!$TERMUX_PREFIX/bin/sh
	echo "Installing dependencies through pip..."
	pip3 install the-package-name
	EOF
}

Copy link
Member

@TomJo2000 TomJo2000 left a comment

Choose a reason for hiding this comment

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

I think we're good to merge this in the meantime.

@licy183
Copy link
Member

licy183 commented May 16, 2024

Thanks!

@licy183 licy183 merged commit 6cf374c into termux:master May 16, 2024
@tqfx tqfx deleted the sabnzbd branch May 16, 2024 09:00
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.

[Bug]: sabnzbd>=4.3.0 missing dependency apprise
3 participants