Skip to content

Commit a2adeec

Browse files
authored
build: fix conditional install_requires #581
Fix conditional `install_requires` in `setup.py` to use environment markers instead of inline conditions. The latter do not work correctly with universal wheels -- e.g. a wheel made on Python 3.12 would not have a dependency on `typing-extensions` at all, even if it were installed on Python 3.11 or older, and the other way around.
1 parent 503af55 commit a2adeec

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

setup.py

+2-7
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@
1010

1111
install_requires = [
1212
'msgpack>=0.5.0',
13+
'greenlet>=3.0; python_implementation != "PyPy"',
14+
'typing-extensions>=4.5; python_version < "3.12"',
1315
]
1416

1517
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
@@ -32,13 +34,6 @@
3234
'docs': docs_require,
3335
}
3436

35-
if platform.python_implementation() != 'PyPy':
36-
# pypy already includes an implementation of the greenlet module
37-
install_requires.append('greenlet>=3.0')
38-
39-
if sys.version_info < (3, 12):
40-
install_requires.append('typing-extensions>=4.5')
41-
4237

4338
# __version__: see pynvim/_version.py
4439
with open(os.path.join(__PATH__, "pynvim/_version.py"),

0 commit comments

Comments
 (0)