-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
34 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,47 @@ | ||
#!/usr/bin/env python | ||
# -*- coding: utf-8 -*- | ||
|
||
import re | ||
from pathlib import Path | ||
from setuptools import setup | ||
|
||
with open('README.md') as readme_file: | ||
readme = readme_file.read() | ||
|
||
with open('LICENSE') as license_file: | ||
license = license_file.read() | ||
ROOT_PATH = Path(__file__).parent | ||
|
||
with open('requirements.txt') as requirements_file: | ||
requirements = requirements_file.readlines() | ||
LICENSE_PATH = ROOT_PATH / 'LICENSE' | ||
|
||
README_PATH = ROOT_PATH / 'README.md' | ||
|
||
REQUIREMENTS_PATH = ROOT_PATH / 'requirements.txt' | ||
|
||
REQUIREMENTS_TEST_PATH = ROOT_PATH / 'requirements_dev.txt' | ||
|
||
|
||
def stream_requirements(fd): | ||
"""For a given requirements file descriptor, generate lines of | ||
distribution requirements, ignoring comments and chained requirement | ||
files. | ||
""" | ||
for line in fd: | ||
cleaned = re.sub(r'#.*$', '', line).strip() | ||
if cleaned and not cleaned.startswith('-r'): | ||
yield cleaned | ||
|
||
|
||
with REQUIREMENTS_PATH.open() as requirements_file: | ||
REQUIREMENTS = list(stream_requirements(requirements_file)) | ||
|
||
|
||
with REQUIREMENTS_TEST_PATH.open() as test_requirements_file: | ||
REQUIREMENTS_TEST = REQUIREMENTS[:] | ||
REQUIREMENTS_TEST.extend(stream_requirements(test_requirements_file)) | ||
|
||
with open('requirements_dev.txt') as requirements_dev_file: | ||
test_requirements = requirements + requirements_dev_file.readlines() | ||
|
||
setup( | ||
name='results_schema', | ||
version='1.2.1', | ||
description="Store results of modeling runs", | ||
long_description=readme, | ||
long_description=README_PATH.read_text(), | ||
author="Center for Data Science and Public Policy", | ||
author_email='[email protected]', | ||
url='https://github.com/dssg/results-schema', | ||
|
@@ -29,9 +51,9 @@ | |
'results_schema.alembic.versions', | ||
], | ||
include_package_data=True, | ||
install_requires=requirements, | ||
tests_require=test_requirements, | ||
license=license, | ||
install_requires=REQUIREMENTS, | ||
tests_require=REQUIREMENTS_TEST, | ||
license=LICENSE_PATH.read_text(), | ||
zip_safe=False, | ||
keywords='analytics datascience modeling modelevaluation', | ||
classifiers=[ | ||
|