Skip to content

Commit

Permalink
Merge pull request #53 from ayan-b/req-comments
Browse files Browse the repository at this point in the history
setup.py.jj2: Allow comments in requirements.txt
  • Loading branch information
chfw authored Nov 8, 2018
2 parents 3426693 + 9635dda commit 55392da
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .moban.dt/local-README.rst.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ setup.py
- automatically do git release while uploading to pypi

3. configured to build universial wheels by default

4. comes with a feature of removing comments from requirements.txt while loading
into setup.py

{% endblock %}

{% block bottom_block %}
Expand Down
4 changes: 4 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ setup.py

3. configured to build universial wheels by default

4. comes with a feature of removing comments from requirements.txt while loading
into setup.py


Installation
================================================================================

Expand Down
13 changes: 13 additions & 0 deletions templates/setup.py.jj2
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,20 @@ if python_implementation == "PyPy":
INSTALL_REQUIRES = [
{% for dependency in dependencies: %}
{% if ';' not in dependency and not dependency.startswith('#'): %}
{% if '#egg=' in dependency: %}
{% set dependency = dependency.split('#egg=') %}
{% set repo_link, egg_name = dependency[0], dependency[1] %}
{% set repo_link = repo_link.strip() %}
{% if '#' in egg_name: %}
{% set egg_name = egg_name.split('#')[0].strip() %}
{% endif %}
'{{[repo_link, egg_name] | join('#egg=')}}',
{% elif '#' in dependency: %}
{% set dependency = dependency.split('#')[0].strip() %}
'{{dependency}}',
{% else %}
'{{dependency}}',
{% endif %}
{% endif %}
{% endfor %}
]
Expand Down

0 comments on commit 55392da

Please sign in to comment.