What is the syntax for passing conditional non-extra dependencies in setuptools?
How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently: extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't officially supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time. The same cannot be said for any other package, so use at your own risk. Or better yet, don't use it. ;-) (At least, not until it's a documented feature w/a PEP-approved syntax.) _______________________________________________
Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
On 28 Mar 2014 04:40, "PJ Eby"
On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
wrote: How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't officially
supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time.
The same cannot be said for any other package, so use at your own risk.
Or better yet, don't use it. ;-)
(At least, not until it's a documented feature w/a PEP-approved syntax.)
Various things got in the way of finalising at least PEP 440, but as far as I am aware, it, 426 and 459 are basically done aside from updating the JSON schema specs and redoing the PyPI compatibility analysis. The other thing they need is for people to read through from scratch, looking for inconsistencies and things that seem out of place, and reporting those as issues at https://bitbucket.org/pypa/pypi-metadata-formats Cheers, Nick.
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
On Mar 27, 2014, at 5:16 PM, Nick Coghlan
On 28 Mar 2014 04:40, "PJ Eby"
wrote: On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
wrote: How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't officially supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time.
The same cannot be said for any other package, so use at your own risk. Or better yet, don't use it. ;-)
(At least, not until it's a documented feature w/a PEP-approved syntax.)
Various things got in the way of finalising at least PEP 440, but as far as I am aware, it, 426 and 459 are basically done aside from updating the JSON schema specs and redoing the PyPI compatibility analysis.
The other thing they need is for people to read through from scratch, looking for inconsistencies and things that seem out of place, and reporting those as issues at https://bitbucket.org/pypa/pypi-metadata-formats
I can take a read through everything again this weekend and take a close look.
Cheers, Nick.
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
----------------- Donald Stufft PGP: 0x6E3CBCE93372DCFA // 7C6B 7C5D 5E2B 6356 A926 F04F 6E3C BCE9 3372 DCFA
On 28 Mar 2014 07:16, "Nick Coghlan"
On 28 Mar 2014 04:40, "PJ Eby"
wrote: On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
wrote: How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't
officially supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time.
The same cannot be said for any other package, so use at your own
risk. Or better yet, don't use it. ;-)
(At least, not until it's a documented feature w/a PEP-approved syntax.)
Various things got in the way of finalising at least PEP 440, but as far as I am aware, it, 426 and 459 are basically done aside from updating the JSON schema specs and redoing the PyPI compatibility analysis.
Actually, there are a some other existing issues I need to address as well (I especially want to do the SPDX one): https://bitbucket.org/pypa/pypi-metadata-formats/issues?status=new&status=open&component=Metadata%202.x Cheers, Nick.
The other thing they need is for people to read through from scratch,
looking for inconsistencies and things that seem out of place, and reporting those as issues at https://bitbucket.org/pypa/pypi-metadata-formats
Cheers, Nick.
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
I think setuptools' :-separated environment markers mechanism is
great, and shouldn't need to be ratified anywhere. I also think the
actual environment markers specification is stable, although I noticed
the IPython wheel for example is using the deprecated .-separated
rather than _-separated identifiers.
These kinds of conditionals are obviously an important feature for
wheel and replace a common if/else statement inside setup.py, but can
only be specified in wheels by placing a copy of the requirements in
setup.cfg. It would be better if bdist_wheel could also just translate
the setuptools requirements.txt to its own format.
I assume extras_require = { ":sys_platform='win32'" :
"wincertstore==0.2" } would be likely to specify a non-extra (the
extra named '' or None?) dependency?
On Thu, Mar 27, 2014 at 2:39 PM, PJ Eby
On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
wrote: How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't officially supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time.
The same cannot be said for any other package, so use at your own risk. Or better yet, don't use it. ;-)
(At least, not until it's a documented feature w/a PEP-approved syntax.)
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
OK, it does in fact work that way; empty-string-before-colon specifies
a default requirement with a marker.
Parses out to the following _dep_map with 'None' representing 'not an
extra dependency':
{None: [Requirement.parse('coding'), Requirement.parse('stuff')],
'quux': [Requirement.parse('more-stuff')]}
requirements.txt:
coding
[:sys_platform=='linux2']
stuff
[quux:sys_platform=='linux2']
more_stuff
On Mon, Apr 7, 2014 at 3:09 PM, Daniel Holth
I think setuptools' :-separated environment markers mechanism is great, and shouldn't need to be ratified anywhere. I also think the actual environment markers specification is stable, although I noticed the IPython wheel for example is using the deprecated .-separated rather than _-separated identifiers.
These kinds of conditionals are obviously an important feature for wheel and replace a common if/else statement inside setup.py, but can only be specified in wheels by placing a copy of the requirements in setup.cfg. It would be better if bdist_wheel could also just translate the setuptools requirements.txt to its own format.
I assume extras_require = { ":sys_platform='win32'" : "wincertstore==0.2" } would be likely to specify a non-extra (the extra named '' or None?) dependency?
On Thu, Mar 27, 2014 at 2:39 PM, PJ Eby
wrote: On Wed, Mar 26, 2014 at 11:29 PM, Daniel Holth
wrote: How do I specify a conditional (marker-guarded) non-extra dependency in setuptools? The syntax for a conditional extra dependency is currently:
extras_require = { "ssl:sys_platform=='win32'": "wincertstore==0.2", "certs": "certifi==1.0.1", },
I only implemented support via extras, and the feature wasn't officially supported (still isn't, I don't think) because the PEP specifying the syntax wasn't fully baked yet. I figured that if *only* setuptools itself used it, then if the syntax changed only setuptools would break... but fix itself at the same time.
The same cannot be said for any other package, so use at your own risk. Or better yet, don't use it. ;-)
(At least, not until it's a documented feature w/a PEP-approved syntax.)
_______________________________________________ Distutils-SIG maillist - Distutils-SIG@python.org https://mail.python.org/mailman/listinfo/distutils-sig
On Mon, Apr 7, 2014 at 4:03 PM, Daniel Holth
OK, it does in fact work that way; empty-string-before-colon specifies a default requirement with a marker.
Parses out to the following _dep_map with 'None' representing 'not an extra dependency':
{None: [Requirement.parse('coding'), Requirement.parse('stuff')], 'quux': [Requirement.parse('more-stuff')]}
requirements.txt:
coding
[:sys_platform=='linux2'] stuff
[quux:sys_platform=='linux2'] more_stuff
Huh. Either I did that intentionally and forgot about it, or it just fell out as a brilliant accidental side effect of the orthogonal design of the parsing functions. Either way, I feel like I did something smart there. ;-)
On 7 Apr 2014 15:09, "Daniel Holth"
I think setuptools' :-separated environment markers mechanism is great, and shouldn't need to be ratified anywhere. I also think the actual environment markers specification is stable, although I noticed the IPython wheel for example is using the deprecated .-separated rather than _-separated identifiers.
I think the one open question was whether or not to tolerate those dots from the previous iteration of the syntax where applicable. Cheers, Nick.
On Mon, Apr 7, 2014 at 11:40 PM, Nick Coghlan
On 7 Apr 2014 15:09, "Daniel Holth"
wrote: I think setuptools' :-separated environment markers mechanism is great, and shouldn't need to be ratified anywhere. I also think the actual environment markers specification is stable, although I noticed the IPython wheel for example is using the deprecated .-separated rather than _-separated identifiers.
I think the one open question was whether or not to tolerate those dots from the previous iteration of the syntax where applicable.
I'd lean towards saying we are stuck with them for now in the .dist-info directories or requirements.txt, but setuptools could choose to forbid you from passing new dots through setup.py. The only problem the dots caused was forgetting whether you should use dots or underscores, and now it's easy to remember that the answer is always underscore.
participants (4)
-
Daniel Holth
-
Donald Stufft
-
Nick Coghlan
-
PJ Eby