|
1 | 1 | #!/usr/bin/python
|
2 | 2 | # -*- coding: utf-8 -*-
|
| 3 | +import re |
3 | 4 | from setuptools import setup, find_packages
|
4 | 5 |
|
5 | 6 |
|
6 |
| -def _requires_from_file(filename): |
7 |
| - return open(filename).read().splitlines() |
| 7 | +# def _requires_from_file(filename): |
| 8 | +# return open(filename).read().splitlines() |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | +def parse_requirements_txt(f): |
| 13 | + pat_hash = re.compile(r'--hash=[^:]+:[a-fA-F0-9]+') |
| 14 | + with open(f) as fh: |
| 15 | + content = fh.read() |
| 16 | + content = re.sub(pat_hash, "", content) |
| 17 | + content = content.replace("\\\n", "") |
| 18 | + lines = content.split("\n") |
| 19 | + lines = [ line.strip() for line in lines ] |
| 20 | + lines = [ line for line in lines if line != "" ] |
| 21 | + lines = [ line.split(";")[0] for line in lines ] |
| 22 | + |
| 23 | + return lines |
8 | 24 |
|
9 | 25 |
|
10 | 26 | setup(
|
11 | 27 | name='python-sox',
|
12 |
| - version='0.2.0', |
| 28 | + version='0.2.1', |
13 | 29 | description='Sensor Over XMPP library for python',
|
14 | 30 | author='Hide. Tokuda Laboratory',
|
15 | 31 |
|
16 | 32 | url='',
|
17 | 33 | packages=find_packages(),
|
18 | 34 | license=open('LICENSE').read(),
|
19 | 35 | include_package_data=True,
|
20 |
| - install_requires=_requires_from_file('requirements.txt'), |
| 36 | + install_requires=parse_requirements_txt('requirements.txt'), |
21 | 37 | tests_requires=['nose'],
|
22 | 38 | test_suite='nose.collector'
|
23 | 39 | )
|
0 commit comments