mirror of
https://github.com/spiral-project/ihatemoney.git
synced 2025-05-05 20:51:49 +02:00
This commit is contained in:
parent
330ffcd1ea
commit
26ee7cbe91
1 changed files with 8 additions and 19 deletions
27
setup.py
27
setup.py
|
@ -3,24 +3,6 @@ import codecs
|
||||||
import os
|
import os
|
||||||
from setuptools import setup, find_packages
|
from setuptools import setup, find_packages
|
||||||
|
|
||||||
import pip
|
|
||||||
if pip.__version__ < "10":
|
|
||||||
try:
|
|
||||||
from pip.req import parse_requirements
|
|
||||||
from pip.download import PipSession
|
|
||||||
except ImportError:
|
|
||||||
print('Cannot find pip.')
|
|
||||||
raise
|
|
||||||
# Get requirements from the requirements.txt file.
|
|
||||||
pip_requirements = parse_requirements("requirements.txt", session=PipSession())
|
|
||||||
install_requires = [str(ir.req) for ir in pip_requirements]
|
|
||||||
else:
|
|
||||||
def parse_requirements(filename):
|
|
||||||
""" load requirements from a pip requirements file """
|
|
||||||
lineiter = (line.strip() for line in open(filename))
|
|
||||||
return [line for line in lineiter if line and not line.startswith("#")]
|
|
||||||
install_requires = parse_requirements('requirements.txt')
|
|
||||||
|
|
||||||
here = os.path.abspath(os.path.dirname(__file__))
|
here = os.path.abspath(os.path.dirname(__file__))
|
||||||
|
|
||||||
|
|
||||||
|
@ -31,6 +13,13 @@ def read_file(filename):
|
||||||
return content
|
return content
|
||||||
|
|
||||||
|
|
||||||
|
def parse_requirements(filename):
|
||||||
|
""" load requirements from a pip requirements file """
|
||||||
|
with open(filename) as lines:
|
||||||
|
lineiter = (line.strip() for line in lines)
|
||||||
|
return [line for line in lineiter if line and not line.startswith("#")]
|
||||||
|
|
||||||
|
|
||||||
README = read_file('README.rst')
|
README = read_file('README.rst')
|
||||||
CHANGELOG = read_file('CHANGELOG.rst')
|
CHANGELOG = read_file('CHANGELOG.rst')
|
||||||
|
|
||||||
|
@ -67,5 +56,5 @@ setup(name='ihatemoney',
|
||||||
packages=find_packages(),
|
packages=find_packages(),
|
||||||
include_package_data=True,
|
include_package_data=True,
|
||||||
zip_safe=False,
|
zip_safe=False,
|
||||||
install_requires=install_requires,
|
install_requires=parse_requirements('requirements.txt'),
|
||||||
entry_points=ENTRY_POINTS)
|
entry_points=ENTRY_POINTS)
|
||||||
|
|
Loading…
Reference in a new issue