Skip to content

Commit cc8ce3e

Browse files
committed
Updates to setup.py for python 2.6
1 parent 690d5c5 commit cc8ce3e

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

setup.py

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
"""
1+
"""tmuxp lives at <https://github.com/tony/tmuxp>.
2+
23
tmuxp
34
-----
45
56
Manage tmux workspaces from JSON and YAML, pythonic API, shell completion.
67
78
89
"""
10+
import sys
911
from setuptools import setup
10-
try:
11-
from pip.req import parse_requirements
12-
except ImportError:
13-
def requirements(f):
14-
reqs = open(f, 'r').read().splitlines()
15-
reqs = [r for r in reqs if not r.strip().startswith('#')]
16-
return reqs
17-
else:
18-
def requirements(f):
19-
install_reqs = parse_requirements(f)
20-
reqs = [str(r.req) for r in install_reqs]
21-
return reqs
12+
13+
with open('requirements.pip') as f:
14+
install_reqs = [line for line in f.read().split('\n') if line]
15+
tests_reqs = []
16+
17+
if sys.version_info < (2, 7):
18+
install_reqs += ['argparse']
19+
tests_reqs += ['unittest2']
2220

2321
import re
2422
VERSIONFILE = "tmuxp/__init__.py"
@@ -44,7 +42,8 @@ def requirements(f):
4442
long_description=open('README.rst').read(),
4543
packages=['tmuxp', 'tmuxp.testsuite'],
4644
include_package_data=True,
47-
install_requires=requirements('requirements.pip'),
45+
install_requires=install_reqs,
46+
tests_require=tests_reqs,
4847
scripts=['pkg/tmuxp.bash', 'pkg/tmuxp.zsh', 'pkg/tmuxp.tcsh'],
4948
entry_points=dict(console_scripts=['tmuxp=tmuxp:main']),
5049
classifiers=[

0 commit comments

Comments
 (0)