Skip to content

Commit

Permalink
feat(setup): Drop dill dependency and add io extra.
Browse files Browse the repository at this point in the history
  • Loading branch information
vinci1it2000 committed Mar 12, 2020
1 parent 2583773 commit 69445ab
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python:

env:
- EXTRAS=base
- EXTRAS=io
- EXTRAS=web
- EXTRAS=plot
- EXTRAS=sphinx
Expand Down
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ Install extras
--------------
Some additional functionality is enabled installing the following extras:

- ``io``: enables to read/write functions (see : ).
- ``plot``: enables the plot of the Dispatcher model and workflow
(see :func:`~schedula.utils.base.Base.plot`).
- ``web``: enables to build a dispatcher Flask app (see
Expand Down
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ dependencies:
- multiprocess
- pandas
- numpy >=1.15
- dill !=0.2.7
- openpyxl
- scipy
- xlrd
Expand Down
1 change: 1 addition & 0 deletions requirements/all.pip
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
-r web.pip
-r sphinx.pip
-r parallel.pip
-r io.pip
2 changes: 0 additions & 2 deletions requirements/base.pip
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
# io
dill!=0.2.7
3 changes: 3 additions & 0 deletions requirements/io.pip
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-r base.pip

dill!=0.2.7
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ def get_long_description(cleanup=True):
print('LONG DESCRIPTION ERROR:\n %r', ex)

extras = {
'io': ['dill!=0.2.7'],
'web': ['regex', 'flask'],
'parallel': ['multiprocess'],
'plot': ['graphviz', 'regex', 'flask', 'Pygments', 'jinja2', 'docutils']
Expand Down Expand Up @@ -139,7 +140,7 @@ def get_long_description(cleanup=True):
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities",
],
install_requires=['dill!=0.2.7'],
install_requires=[],
extras_require=extras,
test_suite='nose.collector',
tests_require=['nose>=1.0', 'requests', 'cryptography'],
Expand Down
4 changes: 3 additions & 1 deletion test/utils/test_blue.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl

import os
import doctest
import unittest
import schedula as sh

EXTRAS = os.environ.get('EXTRAS', 'all')

class TestDoctest(unittest.TestCase):
def runTest(self):
Expand All @@ -22,6 +23,7 @@ def runTest(self):
self.assertEqual(failure_count, 0, (failure_count, test_count))


@unittest.skipIf(EXTRAS not in ('all', 'io'), 'Not for extra %s.' % EXTRAS)
class TestBlueDispatcher(unittest.TestCase):
def setUp(self):
import functools
Expand Down
6 changes: 5 additions & 1 deletion test/utils/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,16 @@
# Licensed under the EUPL (the 'Licence');
# You may not use this work except in compliance with the Licence.
# You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl

import os
import doctest
import unittest
import tempfile
import schedula as sh

EXTRAS = os.environ.get('EXTRAS', 'all')


@unittest.skipIf(EXTRAS not in ('all', 'io'), 'Not for extra %s.' % EXTRAS)
class TestDoctest(unittest.TestCase):
def runTest(self):
import schedula.utils.io as utl
Expand All @@ -23,6 +26,7 @@ def runTest(self):
self.assertEqual(failure_count, 0, (failure_count, test_count))


@unittest.skipIf(EXTRAS not in ('all', 'io'), 'Not for extra %s.' % EXTRAS)
class TestReadWrite(unittest.TestCase):
def setUp(self):
dsp = sh.Dispatcher()
Expand Down

0 comments on commit 69445ab

Please sign in to comment.