Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Move requirements from setup.py to requirements.txt
  • Loading branch information
danielhers committed May 16, 2018
1 parent 0b8bad2 commit a1822c0
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
3 changes: 3 additions & 0 deletions requirements.distances.txt
@@ -0,0 +1,3 @@
distances>=1.0
zss>=1.2
munkres>=1.0.12
4 changes: 4 additions & 0 deletions requirements.txt
@@ -0,0 +1,4 @@
numpy>=1.13.3
spacy==2.0.11
requests>=2.18.4
tqdm>=4.23.3
2 changes: 2 additions & 0 deletions requirements.visualize.txt
@@ -0,0 +1,2 @@
matplotlib>=2.1.0
networkx>=2.0
14 changes: 11 additions & 3 deletions setup.py
Expand Up @@ -3,6 +3,8 @@
import sys

import os
import re
from glob import glob
from setuptools import setup, find_packages

try:
Expand All @@ -11,6 +13,13 @@
this_file = sys.argv[0]
os.chdir(os.path.dirname(os.path.abspath(this_file)))

extras_require = {}
install_requires = []
for requirements_file in glob("requirements.*txt"):
suffix = re.match("[^.]*\.(.*)\.?txt", requirements_file).group(1).rstrip(".")
with open(requirements_file) as f:
(extras_require.setdefault(suffix, []) if suffix else install_requires).extend(f.read().splitlines())

try:
import pypandoc
try:
Expand All @@ -24,9 +33,8 @@

setup(name="UCCA",
version="1.0.69",
install_requires=["numpy", "spacy==2.0.11", "requests", "tqdm"],
extras_require={"visualize": ["matplotlib", "networkx"],
"distances": ["distances", "zss", "munkres"]},
install_requires=install_requires,
extras_require=extras_require,
description="Universal Conceptual Cognitive Annotation",
long_description=long_description,
author="Daniel Hershcovich",
Expand Down

0 comments on commit a1822c0

Please sign in to comment.