Skip to content

Commit

Permalink
Fix conditional install_requires
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
mgorny committed Nov 4, 2024
1 parent 503af55 commit d0a02f2
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

install_requires = [
'msgpack>=0.5.0',
'greenlet>=3.0; python_implementation != "PyPy"',
'typing-extensions>=4.5; python_version < "3.12"',
]

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

if platform.python_implementation() != 'PyPy':
# pypy already includes an implementation of the greenlet module
install_requires.append('greenlet>=3.0')

if sys.version_info < (3, 12):
install_requires.append('typing-extensions>=4.5')


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

0 comments on commit d0a02f2

Please sign in to comment.