Skip to content

Commit

Permalink
Upper bound dependencies and dependabot support (#349)
Browse files Browse the repository at this point in the history
* Upper bound dependencies and dependabot support

* Update CI config to use new requirement files

* Remove dependency section from readme to avoid going out of sync

* Relax dependency bounds

* Fix typo

* Fix more typos

* Update ray upper bound, fix some mroe typos
  • Loading branch information
jklaise committed Feb 15, 2021
1 parent f74e748 commit 656a5eb
Show file tree
Hide file tree
Showing 14 changed files with 64 additions and 122 deletions.
9 changes: 9 additions & 0 deletions .github/dependabot.yml
@@ -0,0 +1,9 @@
version: 2
updates:
- package-ecosystem: pip
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
reviewers:
- "jklaise"
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Expand Up @@ -31,7 +31,7 @@ jobs:
run: |
sudo apt-get install pandoc
pip install --upgrade pip setuptools
pip install -r requirements/requirements_all.txt
pip install -r requirements/dev.txt -r requirements/docs.txt
python -m spacy download en_core_web_md
pip install -e .
pip freeze
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Expand Up @@ -9,7 +9,7 @@ When you contribute code, you affirm that the contribution is your original work
The easiest way to get started is to install all the development dependencies
in a separate virtual environment:
```
pip install -r requirements/requirements_all.txt
pip install -r requirements/dev.txt -r requirements/docs.txt
```
This will install everything needed to run alibi and all the dev tools
(docs builder, testing, linting etc.)
Expand Down
23 changes: 0 additions & 23 deletions README.md
Expand Up @@ -209,29 +209,6 @@ Key:
[Iris dataset](https://docs.seldon.io/projects/alibi/en/latest/examples/linearity_measure_iris.html),
[fashion MNIST](https://docs.seldon.io/projects/alibi/en/latest/examples/linearity_measure_fashion_mnist.html)

## Dependencies
```bash
attrs
beautifulsoup4
matplotlib
numpy
Pillow
pandas
requests
scikit-learn
scikit-image!=0.17.1
scipy
shap>=0.36
spacy[lookups]
tensorflow>=2.0
typing-extensions>=3.7.2
```

Dependencies for distributed computation of explanations:
```bash
ray
```

## Citations
If you use alibi in your research, please consider citing it.

Expand Down
2 changes: 1 addition & 1 deletion doc/README.md
Expand Up @@ -10,7 +10,7 @@ docstrings.
## Building documentation locally
To build the documentation, first we need to install Python requirements:

`pip install -r ../requirements/requirements_ci.txt -r ../requirements/requirements.txt`
`pip install -r ../requirements/docs.txt`

We also need `pandoc` for parsing Jupyter notebooks, the easiest way
to install this is using conda:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/conf.py
Expand Up @@ -71,7 +71,7 @@

# mock imports
autodoc_mock_imports = ['sklearn', 'skimage', 'requests',
'cv2', 'bs4', 'keras', 'seaborn', 'PIL', 'tensorflow', 'spacy']
'cv2', 'bs4', 'keras', 'seaborn', 'PIL', 'tensorflow', 'spacy', 'catboost']

# Napoleon settings
napoleon_google_docstring = True
Expand Down
18 changes: 18 additions & 0 deletions requirements/dev.txt
@@ -0,0 +1,18 @@
# development dependencies (see docs.txt for documentation building dependencies)
# linting and static type-checking
flake8>=3.7.7, <4.0.0
mypy>=0.670, <0.900
# testing
pytest>=5.3.5, <7.0.0
pytest-cov>=2.6.1, <3.0.0
pytest-xdist>=1.28.0, <3.0.0 # for distributed testing, currently unused (see setup.cfg)s
pytest-lazy-fixture>=0.6.3, <0.7.0
codecov>=2.0.15, <3.0.0
catboost>=0.23.0, <0.25.0
Keras>=2.2.4, <2.4.0 # Keras 2.4 specifies tensorflow>=2.2
alibi-testing @ git+git://github.com/SeldonIO/alibi-testing@master#egg=alibi-testing # pre-trained models for testing
ray>=0.8.7, <2.0.0
# other
pre-commit>=1.20.0, <3.0.0
tox>=3.21.0, <4.0.0 # used to generate licence info via `make licenses`
twine>3.2.0, <4.0.0
16 changes: 16 additions & 0 deletions requirements/docs.txt
@@ -0,0 +1,16 @@
# dependencies for building docs, separate from dev.txt as this is also used for builds on readthedocs.org
# core dependencies
sphinx>=2.1.2, <3.0.0 # m2r breaks with sphinx 3.0
sphinx-autodoc-typehints>=1.6.0, <1.11.0 # later versions depend on sphinx 3.0
sphinx-rtd-theme>=0.4.3, <0.6.0
m2r>=0.2.1, <0.3.0 # TODO: unmaintained, deprecate (currently useful for `mdinclude` directive)
sphinxcontrib-apidoc>=0.3.0, <0.4.0
nbsphinx>=0.4.2, <0.9.0
nbsphinx-link>=1.2.0, <2.0.0
ipykernel>=5.1.0, <6.0.0 # required for executing notebooks via nbsphinx
ipython>=7.2.0, <8.0.0 # required for executing notebooks nbsphinx
# dependencies required for imports to work and docs to render properly (as mocking doesn't work well)
# these should be identical to the ones in `setup.py` or `dev.txt`
shap>=0.36.0, !=0.38.1, <0.39 # https://github.com/SeldonIO/alibi/issues/333
# pandoc
# pandoc==1.16.02 # NB: as this is not a Python library, it should be installed manually on the system or via a package manager such as `conda`
14 changes: 0 additions & 14 deletions requirements/requirements.txt

This file was deleted.

37 changes: 0 additions & 37 deletions requirements/requirements_all.txt

This file was deleted.

23 changes: 0 additions & 23 deletions requirements/requirements_ci.txt

This file was deleted.

2 changes: 0 additions & 2 deletions requirements/requirements_examples.txt

This file was deleted.

3 changes: 0 additions & 3 deletions setup.cfg
Expand Up @@ -30,9 +30,6 @@ ignore_errors = True
# tox test environment for generating licenses
[tox:tox]

[testenv]
deps = -r{toxinidir}/requirements/reqruirements-ci.txt

[testenv:licenses]
basepython = python
deps =
Expand Down
33 changes: 17 additions & 16 deletions setup.py
Expand Up @@ -10,8 +10,8 @@ def readme():
exec(open('alibi/version.py').read())

extras_require = {
'examples': ['seaborn', 'xgboost'],
'ray': ['ray'],
'examples': ['seaborn>=0.9.0', 'xgboost>=0.90'],
'ray': ['ray>=0.8.7, <2.0.0'], # from requirements/dev.txt
}

setup(name='alibi',
Expand All @@ -26,21 +26,22 @@ def readme():
packages=find_packages(),
include_package_data=True,
python_requires='>=3.6',
# lower bounds based on Debian Stable versions where available
install_requires=[
'attrs',
'beautifulsoup4',
'matplotlib',
'numpy',
'Pillow',
'pandas',
'requests',
'scikit-learn',
'spacy[lookups]',
'scikit-image!=0.17.1', # https://github.com/SeldonIO/alibi/issues/215
'tensorflow>=2.0',
'shap>=0.36,!=0.38.1', # https://github.com/SeldonIO/alibi/issues/333
'scipy',
'typing-extensions>=3.7.2'
'numpy>=1.16.2, <2.0.0',
'pandas>=0.23.3, <2.0.0',
'scikit-learn>=0.20.2, <0.25.0',
'spacy[lookups]>=2.0.0, <4.0.0',
'scikit-image>=0.14.2, !=0.17.1, <0.19', # https://github.com/SeldonIO/alibi/issues/215
'requests>=2.21.0, <3.0.0',
'Pillow>=5.4.1, <9.0',
'beautifulsoup4>=4.7.1, <5.0.0',
'tensorflow>=2.0.0, <2.5.0',
'attrs>=19.2.0, <21.0.0',
'shap>=0.36.0, !=0.38.1, <0.39.0', # https://github.com/SeldonIO/alibi/issues/333
'scipy>=1.1.0, <2.0.0',
'matplotlib>=3.0.0, <4.0.0',
'typing-extensions>=3.7.2; python_version < "3.8"', # https://github.com/SeldonIO/alibi/pull/248
],
extras_require=extras_require,
test_suite='tests',
Expand Down

0 comments on commit 656a5eb

Please sign in to comment.