Skip to content

Commit

Permalink
Merge pull request #90 from jayvdb/minreqs-comma
Browse files Browse the repository at this point in the history
🔨 improve min_requirements template
  • Loading branch information
chfw authored Jul 13, 2019
2 parents 4281b47 + 63d3e88 commit 5c14d01
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions templates/min_requirements.txt.jj2
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
{% for dependency in dependencies: %}
{% if ';' in dependency: %}
{{dependency.split(';')[0].replace('>=', '==').replace('>', '==') + ';' + dependency.split(';')[1]}}
{% else: %}
{{dependency.replace('>=', '==').replace('>', '==')}}
{% endif %}
{% if ';' in dependency %}
{% set dependency, marker = dependency.split(';') %}
{% else %}
{% set marker = None %}
{% endif %}
{% set dependency = dependency.split(',')[0] %}
{% set dependency = dependency.replace('>=', '==').replace('>', '==') %}
{% if marker %}
{{dependency + ';' + marker }}
{% else: %}
{{dependency}}
{% endif %}
{% endfor %}

0 comments on commit 5c14d01

Please sign in to comment.