Skip to content

Commit

Permalink
broke out extras_requires into separate files to avoid needing to cha…
Browse files Browse the repository at this point in the history
…nge dependency versions is multiple locations
  • Loading branch information
twheys committed Nov 11, 2019
1 parent f598983 commit 3ddee37
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 24 deletions.
12 changes: 6 additions & 6 deletions requirements-dev.txt
@@ -1,11 +1,11 @@
-r requirements.txt
-r requirements-db-vertica.txt
-r requirements-db-snowflake.txt
-r requirements-db-mysql.txt
-r requirements-db-redshift.txt
-r requirements-db-postgresql.txt
-r requirements-db-ipython.txt
mock
matplotlib
ipython
pymysql==0.8.0
vertica-python==0.7.3
psycopg2==2.7.3.2
snowflake-connector-python==1.9.1
bumpversion==0.5.3
wheel==0.30.0
watchdog==0.8.3
Expand Down
2 changes: 2 additions & 0 deletions requirements-extras-ipython.txt
@@ -0,0 +1,2 @@
matplotlib
ipython
1 change: 1 addition & 0 deletions requirements-extras-mysql.txt
@@ -0,0 +1 @@
pymysql==0.8.0
1 change: 1 addition & 0 deletions requirements-extras-postgresql.txt
@@ -0,0 +1 @@
psycopg2==2.7.3.2
1 change: 1 addition & 0 deletions requirements-extras-redshift.txt
@@ -0,0 +1 @@
psycopg2==2.7.3.2
2 changes: 2 additions & 0 deletions requirements-extras-snowflake.txt
@@ -0,0 +1,2 @@
snowflake-connector-python==2.0.3
cryptography==2.4.2
1 change: 1 addition & 0 deletions requirements-extras-vertica.txt
@@ -0,0 +1 @@
vertica-python==0.7.3
34 changes: 16 additions & 18 deletions setup.py
Expand Up @@ -21,8 +21,19 @@ def find_version(*file_paths):
raise RuntimeError("Unable to find version string.")


with open('requirements.txt') as f:
required = f.read().splitlines()
with open('requirements.txt') as file:
install_requires = file.read().splitlines()

extras_requires = {}
extras_requires_patterns = re.compile(r'requirements-extras-(\w+)\.txt')
for file_name in os.listdir('.'):
match = extras_requires_patterns.search(file_name)
if not match:
continue

with open(file_name) as file:
extras_name = match.group(1)
extras_requires[extras_name] = file.read().splitlines()

setup(
name='fireant',
Expand Down Expand Up @@ -80,21 +91,8 @@ def find_version(*file_paths):
keywords=('fireant python query builder querybuilder sql mysql postgres psql oracle vertica aggregated '
'relational database rdbms business analytics bi data science analysis pandas'),

install_requires=required,
tests_require=[
'mock'
],
extras_require={
'vertica': ['vertica-python==0.7.3'],
'snowflake': [
'snowflake-connector-python==2.0.3',
'cryptography==2.4.2',
],
'mysql': ['pymysql==0.8.0'],
'redshift': ['psycopg2==2.7.3.2'],
'postgresql': ['psycopg2==2.7.3.2'],
'ipython': ['matplotlib', 'ipython'],
},

install_requires=install_requires,
extras_require=extras_requires,
tests_require=['mock'],
test_suite='fireant.tests',
)

0 comments on commit 3ddee37

Please sign in to comment.