ionelmc / python-lazy-object-proxy

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

The release [1.7.0] is not working under Python 2.7 #61

Closed sshishov closed 2 years ago

sshishov commented 2 years ago

Python version:

(.env) root@cfb0a1a02221:/home/user/# python --version
Python 2.7.18

The traceback:

Collecting lazy-object-proxy==1.7.0
  Using cached lazy-object-proxy-1.7.0.tar.gz (42 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: /home/user/.env/bin/python /home/user/.env/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py prepare_metadata_for_build_wheel /tmp/tmp5y4EZd
         cwd: /tmp/pip-install-5jUvL6/lazy-object-proxy
    Complete output (46 lines):
    running dist_info
    creating /tmp/pip-modern-metadata-Vpm3FB/lazy_object_proxy.egg-info
    writing /tmp/pip-modern-metadata-Vpm3FB/lazy_object_proxy.egg-info/PKG-INFO
    writing top-level names to /tmp/pip-modern-metadata-Vpm3FB/lazy_object_proxy.egg-info/top_level.txt
    writing dependency_links to /tmp/pip-modern-metadata-Vpm3FB/lazy_object_proxy.egg-info/dependency_links.txt
    writing manifest file '/tmp/pip-modern-metadata-Vpm3FB/lazy_object_proxy.egg-info/SOURCES.txt'
    Traceback (most recent call last):
      File "/home/user/.env/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
        main()
      File "/home/user/.env/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/home/user/.env/lib/python2.7/site-packages/pip/_vendor/pep517/_in_process.py", line 133, in prepare_metadata_for_build_wheel
        return hook(metadata_directory, config_settings)
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 156, in prepare_metadata_for_build_wheel
        self.run_setup()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 243, in run_setup
        self).run_setup(setup_script=setup_script)
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/build_meta.py", line 142, in run_setup
        exec(compile(code, __file__, 'exec'), locals())
      File "setup.py", line 146, in <module>
        distclass=BinaryDistribution,
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/__init__.py", line 162, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/dist_info.py", line 31, in run
        egg_info.run()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 296, in run
        self.find_sources()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 303, in find_sources
        mm.run()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 534, in run
        self.add_defaults()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/egg_info.py", line 570, in add_defaults
        sdist.add_defaults(self)
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 36, in add_defaults
        self._add_defaults_ext()
      File "/tmp/pip-build-env-K6kHtx/overlay/lib/python2.7/site-packages/setuptools/command/py36compat.py", line 118, in _add_defaults_ext
        if self.distribution.has_ext_modules():
      File "setup.py", line 70, in has_ext_modules
        return super().has_ext_modules() or 'SETUP_PY_ALLOW_PURE' not in os.environ
    TypeError: super() takes at least 1 argument (0 given)

I guess that this version should be marked as not Python2 compatible to not break on "legacy" systems.

szubersk commented 2 years ago

Same error here. Is this release meant to be compatible with Python 2 at all?

# python --version
Python 2.7.18
sshishov commented 2 years ago

No, It should not be compatible, at least they stated it in their CHANGELOG:

1.7.0 (2021-12-15)

hansingt commented 2 years ago

In this case, the markers on pypi are incorrect: https://pypi.org/project/lazy-object-proxy/ still states:

Requires: Python >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*

Should be changed then

ionelmc commented 2 years ago

Ooooof, damn. I guess deleting 1.7.0 and making a proper 1.7.1 would fix this issue?

hansingt commented 2 years ago

you should, at least, change the classifiers and python_requires

Sadly some (older) tools do not respect these fields and thus, still some pinning might be required in projects still using python 2.

sbidoul commented 2 years ago

Instead of deleting you can yank the release on PyPI. This will unblock the situation for python2 users while not disturbing python3 users who have pinned 1.7.0. And give you time to do 1.7.1 with an updated python_requires. Thanks!

ionelmc commented 2 years ago

Alternatively I can remove the super() stuff from setup.py and leave the removal of py2 stuff to a later date (no other py2 code has been removed, it's not not tested on CI anymore).

sbidoul commented 2 years ago

Yes but you still need to yank 1.7.0 otherwise pip will continue to pick it up for python 2.

ionelmc commented 2 years ago

It's yanked now.

sbidoul commented 2 years ago

Sweet. Thank you so much for the quick reaction!

ionelmc commented 2 years ago

Just released 1.7.1. Lemme know if you still have issues.

sshishov commented 2 years ago

Thank you very much @ionelmc ! Should I close the issue, or what should I do with it?

ionelmc commented 2 years ago

Isn't it already closed? :-)

dbadaya1 commented 2 years ago

Still getting this on 1.7.1 with python2.7:

Collecting lazy-object-proxy==1.7.1
  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:
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls'
      warnings.warn(msg)
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires'
      warnings.warn(msg)
    /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_scm_version'
      warnings.warn(msg)
    running egg_info
    creating pip-egg-info/lazy_object_proxy.egg-info
    writing pip-egg-info/lazy_object_proxy.egg-info/PKG-INFO
    writing top-level names to pip-egg-info/lazy_object_proxy.egg-info/top_level.txt
    writing dependency_links to pip-egg-info/lazy_object_proxy.egg-info/dependency_links.txt
    writing manifest file 'pip-egg-info/lazy_object_proxy.egg-info/SOURCES.txt'
    warning: manifest_maker: standard file '-c' not found

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-X3ScCt/lazy-object-proxy/setup.py", line 146, in <module>
        distclass=BinaryDistribution,
      File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
        dist.run_commands()
      File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
        self.run_command(cmd)
      File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
        cmd_obj.run()
      File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 186, in run
        self.find_sources()
      File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 209, in find_sources
        mm.run()
      File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 293, in run
        self.add_defaults()
      File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 322, in add_defaults
        sdist.add_defaults(self)
      File "/usr/lib/python2.7/dist-packages/setuptools/command/sdist.py", line 131, in add_defaults
        if self.distribution.has_ext_modules():
      File "/tmp/pip-build-X3ScCt/lazy-object-proxy/setup.py", line 70, in has_ext_modules
        return super().has_ext_modules() or not os.environ.get('SETUPPY_ALLOW_PURE')
    TypeError: super() takes at least 1 argument (0 given)

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-X3ScCt/lazy-object-proxy/
ionelmc commented 2 years ago

You're not supposed to be able to install 1.7 and later on python2.7.

On Fri, Dec 17, 2021, 09:57 Dhananjay Badaya @.***> wrote:

Still getting this on 1.7.1 with python2.7:

Collecting lazy-object-proxy==1.7.1 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: /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'project_urls' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'python_requires' warnings.warn(msg) /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'use_scm_version' warnings.warn(msg) running egg_info creating pip-egg-info/lazy_object_proxy.egg-info writing pip-egg-info/lazy_object_proxy.egg-info/PKG-INFO writing top-level names to pip-egg-info/lazy_object_proxy.egg-info/top_level.txt writing dependency_links to pip-egg-info/lazy_object_proxy.egg-info/dependency_links.txt writing manifest file 'pip-egg-info/lazy_object_proxy.egg-info/SOURCES.txt' warning: manifest_maker: standard file '-c' not found

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/pip-build-X3ScCt/lazy-object-proxy/setup.py", line 146, in <module>
    distclass=BinaryDistribution,
  File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
    dist.run_commands()
  File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 186, in run
    self.find_sources()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 209, in find_sources
    mm.run()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 293, in run
    self.add_defaults()
  File "/usr/lib/python2.7/dist-packages/setuptools/command/egg_info.py", line 322, in add_defaults
    sdist.add_defaults(self)
  File "/usr/lib/python2.7/dist-packages/setuptools/command/sdist.py", line 131, in add_defaults
    if self.distribution.has_ext_modules():
  File "/tmp/pip-build-X3ScCt/lazy-object-proxy/setup.py", line 70, in has_ext_modules
    return super().has_ext_modules() or not os.environ.get('SETUPPY_ALLOW_PURE')
TypeError: super() takes at least 1 argument (0 given)

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-X3ScCt/lazy-object-proxy/

— Reply to this email directly, view it on GitHub https://github.com/ionelmc/python-lazy-object-proxy/issues/61#issuecomment-996511200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7TXP6C3OFFZJZDUKHVJTURLUMVANCNFSM5KC3UTMA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

You are receiving this because you were mentioned.Message ID: @.***>

sshishov commented 2 years ago

If you are using Python2, please either install the package without pin, or pin it to latest py2 supported version, which is 1.6.0 I guess