pypa / flit

Simplified packaging of Python modules
https://flit.pypa.io/
BSD 3-Clause "New" or "Revised" License
2.16k stars 134 forks source link

Flit should generate PEP 508-compliant requirenemts #171

Open uranusjr opened 6 years ago

uranusjr commented 6 years ago

Currently Flit generates conditional requirements in the extras_require argument, but the currently blessed way is to put it in install_requires. Flit should try to use the new syntax instead, or support both syntaxes based on the version of Setuptools.

Reference: https://hynek.me/articles/conditional-python-dependencies/

takluyver commented 6 years ago

It doesn't sound like setuptools has any plans to stop supporting the extras_require syntax. The generated setup.py is only a temporary measure until PEP 518 is properly supported, so I'd rather not complicate it further.

dholth commented 5 years ago

Dang, it looks like setuptools no longer accepts the None / empty string extra as a synonym for install_requires. I thought this was a beautiful feature because it unifies extra and regular requirements, matching what they look like inside pkg_resources.

pkg_resources.working_set.by_key['some-package']._dep_map
Out[4]: 
{None: [Requirement.parse('an_install_requires')],
 'test': [Requirement.parse('bunch')]}