Anand Doshi | db6b832 | 2016-06-09 16:29:12 +0530 | [diff] [blame] | 1 | # -*- coding: utf-8 -*- |
Rushabh Mehta | e460aa2 | 2013-12-11 11:32:21 +0530 | [diff] [blame] | 2 | from setuptools import setup, find_packages |
Ameya Shenoy | 7cb8f89 | 2018-04-15 03:43:21 +0530 | [diff] [blame] | 3 | try: # for pip >= 10 |
| 4 | from pip._internal.req import parse_requirements |
| 5 | except ImportError: # for pip <= 9.0.3 |
| 6 | from pip.req import parse_requirements |
Anand Doshi | db6b832 | 2016-06-09 16:29:12 +0530 | [diff] [blame] | 7 | import re, ast |
Rushabh Mehta | e460aa2 | 2013-12-11 11:32:21 +0530 | [diff] [blame] | 8 | |
Anand Doshi | db6b832 | 2016-06-09 16:29:12 +0530 | [diff] [blame] | 9 | # get version from __version__ variable in erpnext/__init__.py |
| 10 | _version_re = re.compile(r'__version__\s+=\s+(.*)') |
| 11 | |
| 12 | with open('erpnext/__init__.py', 'rb') as f: |
Ameya Shenoy | 7cb8f89 | 2018-04-15 03:43:21 +0530 | [diff] [blame] | 13 | version = str(ast.literal_eval(_version_re.search( |
| 14 | f.read().decode('utf-8')).group(1))) |
Anand Doshi | db6b832 | 2016-06-09 16:29:12 +0530 | [diff] [blame] | 15 | |
Anand Doshi | 29fe53f | 2015-12-09 12:15:20 +0530 | [diff] [blame] | 16 | requirements = parse_requirements("requirements.txt", session="") |
Nabin Hait | c07537b | 2014-03-21 12:25:49 +0530 | [diff] [blame] | 17 | |
Rushabh Mehta | e460aa2 | 2013-12-11 11:32:21 +0530 | [diff] [blame] | 18 | setup( |
Anand Doshi | 29fe53f | 2015-12-09 12:15:20 +0530 | [diff] [blame] | 19 | name='erpnext', |
| 20 | version=version, |
| 21 | description='Open Source ERP', |
| 22 | author='Frappe Technologies', |
| 23 | author_email='info@erpnext.com', |
| 24 | packages=find_packages(), |
| 25 | zip_safe=False, |
| 26 | include_package_data=True, |
| 27 | install_requires=[str(ir.req) for ir in requirements], |
| 28 | dependency_links=[str(ir._link) for ir in requirements if ir._link] |
Pratik Vyas | 0240dc5 | 2014-02-14 16:10:55 +0530 | [diff] [blame] | 29 | ) |