Skip to content

Commit

Permalink
Add spacy as extra
Browse files Browse the repository at this point in the history
  • Loading branch information
aCampello committed Oct 31, 2020
1 parent 2c8eedb commit c83829a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 7 deletions.
1 change: 0 additions & 1 deletion requirements/python
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ argcomplete
phonenumbers
pandas
sklearn
spacy-nightly[transformers]>=3.0.0rc1
typing_extensions
1 change: 1 addition & 0 deletions requirements/python-dev
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# install everything in the python requirements too.
-r python
-r python-extras

# needed for tests/run.py script to read .travis.yml file
PyYAML
Expand Down
1 change: 1 addition & 0 deletions requirements/python-extras
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spacy-nightly[transformers]>=3.0.0rc1
20 changes: 14 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,21 @@

github_url = 'https://github.com/LeapBeyond/scrubadub'


def read_packages_from_file(filename):
with open(filename, 'r') as stream:
for line in stream:
package = line.strip().split('#')[0]
if package:
yield package

# read in the dependencies from the virtualenv requirements file
dependencies = []
filename = os.path.join("requirements", "python")
with open(filename, 'r') as stream:
for line in stream:
package = line.strip().split('#')[0]
if package:
dependencies.append(package)
dependencies = list(read_packages_from_file(filename))

# read extra spacy dependencies from python-extras requirements file
filename = os.path.join("requirements", "python-extras")
extras = list(read_packages_from_file(filename))

# get the version
version = None
Expand Down Expand Up @@ -60,5 +67,6 @@
'Topic :: Utilities',
],
install_requires=dependencies,
extras_require={"spacy": extras},
zip_safe=False,
)

0 comments on commit c83829a

Please sign in to comment.