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

flatpak-pip-generator balks on requirements-parser #410

Open
memnochproxy opened this issue May 23, 2024 · 2 comments
Open

flatpak-pip-generator balks on requirements-parser #410

memnochproxy opened this issue May 23, 2024 · 2 comments

Comments

@memnochproxy
Copy link

flatpak-builder version

1.4.2

Linux distribution and version

Ubuntu 24.04

Affected flatpak-builder tool

pip/flatpak-pip-generator

flatpak-builder tool cli args

--repo=repo --force-clean --user build.d com.candelatech.py3-10

Source repository URL

private

Flatpak-builder manifest URL

private

Description

When running a generator from a makefile target, flatpak-pip-generator cannot finish find the requirements-parser that it project virtual environment has installed:

 $ make
( \
	source ./builder-env/bin/activate && \
	pip3 install requirements-parser pipdeptree \
)
Requirement already satisfied: requirements-parser in ./builder-env/lib/python3.12/site-packages (0.9.0)
Requirement already satisfied: pipdeptree in ./builder-env/lib/python3.12/site-packages (2.21.0)
Requirement already satisfied: types-setuptools>=69.1.0 in ./builder-env/lib/python3.12/site-packages (from requirements-parser) (70.0.0.20240523)
Requirement already satisfied: packaging>=23.1 in ./builder-env/lib/python3.12/site-packages (from pipdeptree) (24.0)
Requirement already satisfied: pip>=23.1.2 in ./builder-env/lib/python3.12/site-packages (from pipdeptree) (24.0)
( \
	cd /home/jreynolds/git; \
	if [ ! -d flatpak-builder-tools ]; then \
    	git clone https://github.com/flatpak/flatpak-builder-tools/; \
	fi \
)
( \
	source ./builder-env/bin/activate && \
	./builder-env/bin/python3 /home/jreynolds/git/flatpak-builder-tools/pip/flatpak-pip-generator \
		--requirements-file requirements.txt \
		--build-only -o requirements \
)
Requirements modules is not installed. Run "pip install requirements-parser"
make: *** [Makefile:34: requirements] Error 1

This is the same error I get when executing the command from bash, not in make.

Python version 3.12.3

SHELL=/bin/bash
PYV=py3-10
PAKNAME=com.candelatech.$(PYV)
PAKFILE=$(PAKNAME).flatpak
PAKJSON=$(PAKNAME).json
BUILDDIR=build.d
BUNDLEFILE=candela-$(PYV).flatpak
PAK_TOOLS=${HOME}/git/flatpak-builder-tools/pip
PAK_PIP=$(PAK_TOOLS)/flatpak-pip-generator

all: bundle

builder-env:
	if [ ! -d builder-env ]; then mkdir builder-env; fi
	if [ ! -r builder-env/bin/activate ]; then python3 -m venv builder-env; fi

flatpak-tools: builder-env
	( \
		source ./builder-env/bin/activate && \
		pip3 install requirements-parser pipdeptree \
	)
	( \
		cd ${HOME}/git; \
		if [ ! -d flatpak-builder-tools ]; then \
	    	git clone https://github.com/flatpak/flatpak-builder-tools/; \
		fi \
	)

# this builds a requirements.json file
requirements:
	( \
		source ./builder-env/bin/activate && \
		./builder-env/bin/python3 $(PAK_PIP) \
			--requirements-file requirements.txt \
			--build-only -o requirements \
	)

bundle: $(PAKFILE)
	flatpak build-bundle -v ./repo $(BUNDLEFILE) $(PAKNAME)

$(BUILDDIR):
	mkdir $(BUILDDIR)

$(PAKFILE): | flatpak-tools $(BUILDDIR) $(PAKJSON) requirements
	cp ~/lfs/py-scripts/update_dependencies.py .
	flatpak-builder --repo=repo --force-clean --user $(BUILDDIR) $(PAKJSON)

run: $(PAKFILE)
	flatpak-builder --run $(BUILDDIR) $(PAKJSON) ctpy.bash

clean:
	rm -rf $(BUILDDIR) .flatpak-builder $(BUNDLEFILE)

distclean: clean
	rm -rf repo/* repo/.lock builder-env
@memnochproxy
Copy link
Author

memnochproxy commented May 23, 2024

This makefile does work with Fedora 36, python 3.10.11

@yyyyyiiiiii
Copy link

Got this Requirements modules is not installed. Run "pip install requirements-parser" too. In Python interpreter got:

>>> import requirements
...
ModuleNotFoundError: No module named 'pkg_resources'
>>>

Running

pip3 install setuptools

fixed error.

@hfiguiere hfiguiere added the pip label Sep 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants