Skip to content
Snippets Groups Projects
Commit ca259d05 authored by Piotr Maślanka's avatar Piotr Maślanka
Browse files

2.1

parent 1645db6f
No related branches found
No related tags found
No related merge requests found
Pipeline #62448 canceled with stages
in 31 seconds
# v2.1
* added read_dependency_links
# v2.0 # v2.0
* got rid of the Mako dependency * got rid of the Mako dependency
......
...@@ -29,9 +29,12 @@ Then you can write the following in your setup.py: ...@@ -29,9 +29,12 @@ Then you can write the following in your setup.py:
.. code-block:: python .. code-block:: python
from snakehouse import read_requirements_txt from snakehouse import read_requirements_txt, read_dependency_links
setup(install_requires=read_requirements_txt()) setup(install_requires=read_requirements_txt(),
dependency_links=read_dependency_links())
.. autofunction:: snakehouse.read_requirements_txt .. autofunction:: snakehouse.read_requirements_txt
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
[metadata] [metadata]
name = snakehouse name = snakehouse
keywords = cython, extension, multiple, pyx keywords = cython, extension, multiple, pyx
version = 2.0 version = 2.1
long_description = file: README.md long_description = file: README.md
long_description_content_type = text/markdown; charset=UTF-8 long_description_content_type = text/markdown; charset=UTF-8
license_files = LICENSE license_files = LICENSE
......
...@@ -58,8 +58,16 @@ def read_requirements_txt(path: str = 'requirements.txt'): ...@@ -58,8 +58,16 @@ def read_requirements_txt(path: str = 'requirements.txt'):
lines = (line for line in lines if not line.startswith('git+')) lines = (line for line in lines if not line.startswith('git+'))
lines = (line for line in lines if not line.startswith('http')) lines = (line for line in lines if not line.startswith('http'))
lines = (line for line in lines if line) lines = (line for line in lines if line)
lines = (line for line in lines if not line.startwith('--'))
return list(lines) return list(lines)
def read_dependency_links(path: str = 'requirements.txt'):
lines = read_lines(path)
lines = (line for line in lines if line.startwith('--extra'))
return list(lines)
def read_lines(path: str, delete_empty_lines: bool = True, def read_lines(path: str, delete_empty_lines: bool = True,
encoding: str = 'utf-8') -> tp.List[str]: encoding: str = 'utf-8') -> tp.List[str]:
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment