neovim / pynvim

Python client and plugin host for Nvim
http://pynvim.readthedocs.io/en/latest/
Apache License 2.0
1.51k stars 118 forks source link

Building a wheel for Python2 fails #513

Closed vfleuryrodeofx closed 2 years ago

vfleuryrodeofx commented 2 years ago

Hello,

I tried building a wheel with Python2 with the latest commit on master and it failed with this traceback :

Traceback (most recent call last):
  File "setup.py", line 56, in <module>
    zip_safe=False)
  File "/usr/lib64/python2.7/distutils/core.py", line 112, in setup
    _setup_distribution = dist = klass(attrs)
  File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 269, in __init__
  File "/usr/lib64/python2.7/distutils/dist.py", line 287, in __init__
    self.finalize_options()
  File "build/bdist.linux-x86_64/egg/setuptools/dist.py", line 324, in finalize_options
  File "/mnt/users/vfleury/.local/lib/python2.7/site-packages/setupmeta/hook.py", line 66, in register_keyword
    finalize_dist(dist, setup_requires=value)
  File "/mnt/users/vfleury/.local/lib/python2.7/site-packages/setupmeta/hook.py", line 24, in finalize_dist
    if any(dep.startswith("setupmeta") for dep in setup_requires):
  File "/mnt/users/vfleury/.local/lib/python2.7/site-packages/setupmeta/hook.py", line 24, in <genexpr>
    if any(dep.startswith("setupmeta") for dep in setup_requires):
AttributeError: 'tuple' object has no attribute 'startswith'

The reason I am trying this, is that the environment I am working in is still heavily using Python 2.7 (hello VFX).

Just flagging that I fixed this on my end removing the comma in setup.py at line 15.

From this :

import platform
import sys
import os

from setuptools import setup

 ...

setup_requires = [
] + pytest_runner,

To this :

import platform
import sys
import os

from setuptools import setup

 ...

setup_requires = [
] + pytest_runner

And then running : python setup.py bdist_wheel worked fine.

Hope this helps someone, or future me :) Cheers

vfleuryrodeofx commented 2 years ago

So I guess we can close this since Python2 support is being dropped :)