flatpak-builder-tools icon indicating copy to clipboard operation
flatpak-builder-tools copied to clipboard

flatpak-pip-generator misses one of `pyee`'s deps

Open strugee opened this issue 2 years ago • 1 comments

Generating a dep tree for this package works okay:

$ cat com.example.Example.json
{
    "app-id": "com.example.Example",
    "runtime": "org.gnome.Platform",
    "runtime-version": "40",
    "sdk": "org.gnome.Sdk",
    "command": "true",
    "finish-args" : [
    ],
    "modules": [
        "pyee.json"
    ]
}

$ ./flatpak-builder-tools/pip/flatpak-pip-generator pyee --output=pyee
========================================================================
Downloading sources
========================================================================
Running: "pip3 download --exists-action=i --dest /tmp/pip-generator-pyeenouq806z -r /tmp/requirements.6hp0c3eq"
Collecting pyee
  Using cached pyee-8.1.0-py2.py3-none-any.whl (12 kB)
Saved /tmp/pip-generator-pyeenouq806z/pyee-8.1.0-py2.py3-none-any.whl
Successfully downloaded pyee
========================================================================
Downloading arch independent packages
========================================================================
Deleting pyee-8.1.0-py2.py3-none-any.whl
Downloading https://files.pythonhosted.org/packages/fd/f8/d1c597ce15f3fd32ebdec9695da97a1af6e102c1ad8f9de32db84b05986c/pyee-8.1.0.tar.gz
========================================================================
Obtaining hashes and urls
========================================================================
Generating hash for pyee-8.1.0.tar.gz
Extracting download url for pyee
========================================================================
Generating dependencies
========================================================================
Generating dependencies for pyee

Output saved to pyee.json

So far so good. But when you go to build this package, flatpak-builder errors out because for some reason, Pip wants to access the network:

$ flatpak-builder --force-clean build-dir com.example.Example.json 
Emptying app dir 'build-dir'
Downloading sources
Initializing build dir
Committing stage init to cache
Starting build of com.example.Example
========================================================================
Building module python3-pyee in /var/home/alex/Development/pyee-flatpak-test/.flatpak-builder/build/python3-pyee-3
========================================================================
Running: pip3 install --verbose --exists-action=i --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pyee" --no-build-isolation
Using pip 21.0.1 from /usr/lib/python3.8/site-packages/pip (python 3.8)
Non-user install due to --prefix or --target option
Ignoring indexes: https://pypi.org/simple
Created temporary directory: /tmp/pip-ephem-wheel-cache-ipifnxha
Created temporary directory: /tmp/pip-req-tracker-7si9cpxx
Initialized build tracking at /tmp/pip-req-tracker-7si9cpxx
Created build tracker: /tmp/pip-req-tracker-7si9cpxx
Entered build tracker: /tmp/pip-req-tracker-7si9cpxx
Created temporary directory: /tmp/pip-install-3bpbit09
Looking in links: file:///run/build/python3-pyee
0 location(s) to search for versions of pyee:
Skipping link: not a file: file:///run/build/python3-pyee (from -f)
Found link file:///run/build/python3-pyee/pyee-8.1.0.tar.gz, version: 8.1.0
Local files found: /run/build/python3-pyee/pyee-8.1.0.tar.gz
Given no hashes to check 1 links for project 'pyee': discarding no candidates
Processing ./pyee-8.1.0.tar.gz
  Added pyee from file:///run/build/python3-pyee/pyee-8.1.0.tar.gz to build tracker '/tmp/pip-req-tracker-7si9cpxx'
    Running setup.py (path:/tmp/pip-install-3bpbit09/pyee_bca0b5491b5b4e41a0cf5350ea3307de/setup.py) egg_info for package pyee
    Created temporary directory: /tmp/pip-pip-egg-info-pirzft_u
    Running command python setup.py egg_info
    WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcc6a6314f0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/vcversioner/
    WARNING: Retrying (Retry(total=3, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcc6a631700>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/vcversioner/
    WARNING: Retrying (Retry(total=2, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcc6a6318b0>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/vcversioner/
    WARNING: Retrying (Retry(total=1, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcc6a631a60>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/vcversioner/
    WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('<pip._vendor.urllib3.connection.HTTPSConnection object at 0x7fcc6a631c10>: Failed to establish a new connection: [Errno -3] Temporary failure in name resolution')': /simple/vcversioner/
    ERROR: Could not find a version that satisfies the requirement vcversioner
    ERROR: No matching distribution found for vcversioner
    Traceback (most recent call last):
      File "/usr/lib/python3.8/site-packages/setuptools/installer.py", line 119, in fetch_build_egg
        subprocess.check_call(cmd)
      File "/usr/lib/python3.8/subprocess.py", line 364, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmprzgrxz68', '--quiet', 'vcversioner']' returned non-zero exit status 1.

    The above exception was the direct cause of the following exception:

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-3bpbit09/pyee_bca0b5491b5b4e41a0cf5350ea3307de/setup.py", line 11, in <module>
        setup(
      File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 152, in setup
        _install_setup_requires(attrs)
      File "/usr/lib/python3.8/site-packages/setuptools/__init__.py", line 147, in _install_setup_requires
        dist.fetch_build_eggs(dist.setup_requires)
      File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 686, in fetch_build_eggs
        resolved_dists = pkg_resources.working_set.resolve(
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 766, in resolve
        dist = best[req.key] = env.best_match(
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1051, in best_match
        return self.obtain(req, installer)
      File "/usr/lib/python3.8/site-packages/pkg_resources/__init__.py", line 1063, in obtain
        return installer(requirement)
      File "/usr/lib/python3.8/site-packages/setuptools/dist.py", line 745, in fetch_build_egg
        return fetch_build_egg(self, req)
      File "/usr/lib/python3.8/site-packages/setuptools/installer.py", line 121, in fetch_build_egg
        raise DistutilsError(str(e)) from e
    distutils.errors.DistutilsError: Command '['/usr/bin/python3', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/tmp/tmprzgrxz68', '--quiet', 'vcversioner']' returned non-zero exit status 1.
WARNING: Discarding file:///run/build/python3-pyee/pyee-8.1.0.tar.gz. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pyee
ERROR: No matching distribution found for pyee
Exception information:
Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
    crit = self.state.criteria[name]
KeyError: 'pyee'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 318, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion
    crit = Criterion.from_requirement(self._p, requirement, parent)
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 83, in from_requirement
    raise RequirementsConflicted(criterion)
pip._vendor.resolvelib.resolvers.RequirementsConflicted: Requirements conflict: SpecifierRequirement('pyee')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 121, in resolve
    self._result = resolver.resolve(
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 453, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/usr/lib/python3.8/site-packages/pip/_vendor/resolvelib/resolvers.py", line 320, in resolve
    raise ResolutionImpossible(e.criterion.information)
pip._vendor.resolvelib.resolvers.ResolutionImpossible: [RequirementInformation(requirement=SpecifierRequirement('pyee'), parent=None)]

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 189, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 178, in wrapper
    return func(self, options, args)
  File "/usr/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 316, in run
    requirement_set = resolver.resolve(
  File "/usr/lib/python3.8/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 127, in resolve
    six.raise_from(error, e)
  File "<string>", line 3, in raise_from
pip._internal.exceptions.DistributionNotFound: No matching distribution found for pyee
Removed pyee from file:///run/build/python3-pyee/pyee-8.1.0.tar.gz from build tracker '/tmp/pip-req-tracker-7si9cpxx'
Removed build tracker: '/tmp/pip-req-tracker-7si9cpxx'
Error: module python3-pyee: Child process exited with code 1

strugee avatar Aug 11 '21 09:08 strugee