Skip to content

Commit baf8dfc

Browse files
committed
Support dependencies with environment markers
This puts the dependencies into extra_requires in order to achieve maximum compatibility with setuptools and pip.
1 parent 1a2a464 commit baf8dfc

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

templates/setup.py.jj2

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,26 @@ KEYWORDS = [
2222

2323
INSTALL_REQUIRES = [
2424
{% for dependency in dependencies: %}
25+
{% if ';' not in dependency: %}
2526
'{{dependency}}',
27+
{% endif %}
2628
{% endfor %}
2729
]
2830

29-
{% if extra_dependencies: %}
31+
{% if extra_dependencies or dependencies: %}
3032
EXTRAS_REQUIRE = {
3133
{% for dependency in extra_dependencies: %}
3234
{% for key, value in dependency.items(): %}
3335
'{{key}}': {{value}},
3436
{% endfor %}
3537
{% endfor %}
38+
{% for dependency in dependencies: %}
39+
{% if ';' in dependency: %}
40+
'{{dependency.split(';')[1].strip()}}': [
41+
'{{dependency.split(';')[0].strip()}}'
42+
],
43+
{% endif %}
44+
{% endfor %}
3645
}
3746
{% else: %}
3847
EXTRAS_REQUIRE = {}

0 commit comments

Comments
 (0)