|
2 | 2 | # -*- coding: utf-8 -*-
|
3 | 3 |
|
4 | 4 | """The setup script."""
|
5 |
| - |
| 5 | +import io |
| 6 | +import os |
6 | 7 | from setuptools import setup, find_packages
|
7 | 8 |
|
| 9 | + |
| 10 | +def get_pkg_info(info_file, info): |
| 11 | + val = "" |
| 12 | + info_file.seek(0) |
| 13 | + for line in info_file: |
| 14 | + if line.startswith('__{}__'.format(info)): |
| 15 | + val = line.split("=")[1].replace("'", "").replace('"', "").strip() |
| 16 | + return val |
| 17 | + |
| 18 | +with open(os.path.join('swmmnetwork', '__init__.py')) as init_file: |
| 19 | + author = get_pkg_info(init_file, 'author') |
| 20 | + email = get_pkg_info(init_file, 'email') |
| 21 | + version = get_pkg_info(init_file, 'version') |
| 22 | + |
| 23 | + |
8 | 24 | with open('README.rst') as readme_file:
|
9 | 25 | readme = readme_file.read()
|
10 | 26 |
|
11 | 27 | with open('HISTORY.rst') as history_file:
|
12 | 28 | history = history_file.read()
|
13 | 29 |
|
14 | 30 | requirements = [
|
15 |
| - # TODO: put package requirements here |
16 |
| -] |
17 |
| - |
18 |
| -setup_requirements = [ |
19 |
| - 'pytest-runner', |
20 |
| - # TODO(austinorr): put setup requirements (distutils extensions, etc.) here |
| 31 | + 'networkx>=1.11,<2', |
| 32 | + 'pandas', |
| 33 | + 'numpy', |
21 | 34 | ]
|
22 | 35 |
|
23 | 36 | test_requirements = [
|
24 | 37 | 'pytest',
|
25 |
| - # TODO: put package test requirements here |
26 | 38 | ]
|
27 | 39 |
|
28 | 40 | package_data = {
|
|
31 | 43 |
|
32 | 44 | setup(
|
33 | 45 | name='swmmnetwork',
|
34 |
| - version='0.1.1', |
| 46 | + author=author, |
| 47 | + author_email=email, |
| 48 | + version=version, |
35 | 49 | description="SWMMNetwork helps users of EPA SWMM 5.1 perform water quality and load reduction calculations. ",
|
36 | 50 | long_description=readme + '\n\n' + history,
|
37 |
| - author="Austin Orr", |
38 |
| - |
39 | 51 | url='https://github.com/austinorr/swmmnetwork',
|
40 | 52 | packages=find_packages(),
|
41 | 53 | package_data=package_data,
|
42 | 54 | include_package_data=True,
|
43 | 55 | install_requires=requirements,
|
44 | 56 | license="BSD license",
|
45 | 57 | zip_safe=False,
|
46 |
| - py_modules=['swmmnetwork'], |
47 | 58 | keywords='swmmnetwork',
|
48 | 59 | classifiers=[
|
49 | 60 | 'Development Status :: 2 - Pre-Alpha',
|
|
60 | 71 | ],
|
61 | 72 | test_suite='tests',
|
62 | 73 | tests_require=test_requirements,
|
63 |
| - setup_requires=setup_requirements, |
64 | 74 | )
|
0 commit comments