ionelmc / python-lazy-object-proxy

A fast and thorough lazy object proxy.
BSD 2-Clause "Simplified" License
247 stars 36 forks source link

Platform compatibility tags for wheels do not match the ones supported on Docker Desktop and M1 Macs #69

Closed vjraitila closed 1 year ago

vjraitila commented 2 years ago

The wheels seem to be broken at https://pypi.org/project/lazy-object-proxy/#files - and have been for quite some time.

Run into it with the following Dockerfile:

FROM ubuntu:bionic

RUN apt-get -q update \
    && apt-get -q install -y --no-install-recommends \
        python3 \
        python3-pip \
        python3-setuptools

RUN pip3 install packaging
RUN python3 -c "import packaging.tags; import sys; print(list(packaging.tags.sys_tags()))"
RUN pip3 install pylint==2.6.0 python-dateutil==2.8.1

which not only fails retrieving the appropriate wheel for aarch64, but also does not compile from source (due to older version of Python in Ubuntu Bionic):

Collecting lazy-object-proxy>=1.4.0 (from astroid<=2.5,>=2.4.0->pylint==2.6.0)
  Downloading https://files.pythonhosted.org/packages/75/93/3fc1cc28f71dd10b87a53b9d809602d7730e84cc4705a062def286232a9c/lazy-object-proxy-1.7.1.tar.gz (41kB)
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-aot57_9r/lazy-object-proxy/setup.py", line 146, in <module>
        distclass=BinaryDistribution,
      File "/usr/lib/python3/dist-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/lib/python3.6/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 372, in __init__
        _Distribution.__init__(self, attrs)
      File "/usr/lib/python3.6/distutils/dist.py", line 281, in __init__
        self.finalize_options()
      File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 528, in finalize_options
        ep.load()(self, ep.name, value)
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2324, in load
        return self.resolve()
      File "/usr/lib/python3/dist-packages/pkg_resources/__init__.py", line 2330, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/tmp/pip-build-aot57_9r/lazy-object-proxy/.eggs/setuptools_scm-7.0.5-py3.6.egg/setuptools_scm/__init__.py", line 5
        from __future__ import annotations
        ^
    SyntaxError: future feature annotations is not defined

I know next to nothing about Python wheels, but looking at the available ones at PyPI, this one looks strange to me:

lazy_object_proxy-1.7.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl

It looks like two tags have been clobbed together. What I would expect is two separate wheels like:

lazy_object_proxy-1.7.1-cp36-cp36m-manylinux_2_17_aarch64.whl
lazy_object_proxy-1.7.1-cp36-cp36m-manylinux2014_aarch64.whl
ionelmc commented 1 year ago

Bionic is really old. And that pip version is old too (note the eggs). Pretty sure it will work fine if you modernize your tooling.

The joined tags are fine, it simply means it's compatible with both manylinux_2_17_aarch64 and manylinux2014_aarch64.

vjraitila commented 1 year ago

Okay, gotcha. That fact that joined tags are fine was new to me. I did try to find a mention of this in the PEP, but could not find one. I ran into this while attempting to build Hadoop (to be exact, the development container) for aarch64. The problem only surfaced with the then latest set of wheels (for 1.7.1) which introduced the one with joined tags - the earlier ones worked. It seems that 1.8.0 yet again does not have them.

Anyway, my particular downstream issue has since been resolved by exactly that - modernizing the tooling.