Skip to content

Commit

Permalink
Update numpy dependency (#139)
Browse files Browse the repository at this point in the history
* push numpy cap

* add separate tests for mlblocks

* fix command

* create new unit test environment

* pin jinja2

* pin markupsafe

* add docutils

* pin scikit learn for docs

* unpin scikit-learn and add okwarning
  • Loading branch information
sarahmish authored Dec 11, 2022
1 parent 515d0a7 commit 79fc8fb
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 15 deletions.
35 changes: 26 additions & 9 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package
Expand All @@ -29,11 +29,11 @@ jobs:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest]
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
Expand All @@ -46,31 +46,48 @@ jobs:
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest]
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
run: pip install .[test]
run: pip install .[unit]
- name: make test-unit
run: make test-unit

unit-mlprimitives:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-20.04, macos-latest]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install package and dependencies
run: pip install .[test]
- name: make test-mlprimitives
run: make test-mlprimitives

tutorials:
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest]
os: [ubuntu-20.04]
steps:
- uses: actions/checkout@v1
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- if: matrix.os == 'ubuntu-latest'
- if: matrix.os == 'ubuntu-20.04'
name: Install dependencies - Ubuntu
run: sudo apt-get install graphviz
- name: Install package and dependencies
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ lint-docs: ## check docs formatting with doc8 and pydocstyle

.PHONY: test-unit
test-unit: ## run tests quickly with the default Python
python -m pytest --cov=mlblocks --ignore=tests/features/

.PHONY: test-mlprimitives
test-mlprimitives: ## run tests quickly with the default Python
python -m pytest --cov=mlblocks

.PHONY: test-readme
Expand All @@ -132,7 +136,7 @@ test-tutorials: ## run the tutorial notebooks
jupyter nbconvert --execute --ExecutePreprocessor.timeout=3600 --stdout --to html {} > /dev/null +

.PHONY: test
test: test-unit test-readme ## test everything that needs test dependencies
test: test-unit test-mlprimitives test-readme ## test everything that needs test dependencies

.PHONY: check-dependencies
check-dependencies: ## test if there are any broken dependencies
Expand Down
2 changes: 2 additions & 0 deletions docs/getting_started/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ To do this, we first call the ``fit`` method passing the training data and the c
labels.

.. ipython:: python
:okwarning:
from mlprimitives.datasets import load_census
dataset = load_census()
Expand All @@ -112,6 +113,7 @@ Once we have fitted our model to our data, we can call the ``predict`` method pa
to obtain predictions from the pipeline.

.. ipython:: python
:okwarning:
predictions = pipeline.predict(X_test)
predictions
Expand Down
8 changes: 6 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

install_requires = [
'graphviz>=0.9,<1',
'numpy>=1.17.1,<1.21',
'numpy>=1.17.1,<2',
'psutil>=5,<6',
]

Expand All @@ -23,6 +23,7 @@
'mlprimitives>=0.3.0,<0.4',
'h5py<2.11.0,>=2.10.0', # <- tensorflow 2.3.2 conflict
'matplotlib<3.2.2,>=2.2.2', # <- copulas 0.3.3
'protobuf<4', # <- importlib
]

examples_require = mlprimitives_requires + [
Expand All @@ -34,7 +35,6 @@
tests_require = [
'pytest>=3.4.2',
'pytest-cov>=2.6.0',
'mlprimitives>=0.3.0.dev0,<0.4',
'setuptools>=41.0.0',
'rundoc>=0.4.3',
'prompt-toolkit>=2.0,<3.0',
Expand All @@ -56,8 +56,11 @@
'm2r>=0.2.0,<0.3',
'Sphinx>=1.7.1,<3',
'sphinx_rtd_theme>=0.2.4,<0.5',
'docutils>=0.12,<0.18',
'ipython>=6.5.0',
'autodocsumm>=0.1.10',
'Jinja2>=2,<3', # >=3 makes sphinx theme fail
'markupsafe<2.1.0',

# style check
'flake8>=3.7.7,<4',
Expand Down Expand Up @@ -97,6 +100,7 @@
description='Pipelines and primitives for machine learning and data science.',
extras_require={
'dev': development_requires + tests_require + examples_require,
'unit': tests_require,
'test': tests_require + examples_require,
'examples': examples_require,
'mlprimitives': mlprimitives_requires,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_mlpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1124,7 +1124,7 @@ def test_get_diagram_simple(self):
]
pipeline.blocks['a_primitive#1'].produce_output = output

assert str(pipeline.get_diagram()) == expected
assert str(pipeline.get_diagram()).strip() == expected.strip()

@patch('mlblocks.mlpipeline.MLBlock', new=get_mlblock_mock)
def test_get_diagram_fit(self):
Expand Down Expand Up @@ -1155,7 +1155,7 @@ def test_get_diagram_fit(self):
]
pipeline.blocks['a_primitive#1'].produce_output = output

assert str(pipeline.get_diagram()) == expected
assert str(pipeline.get_diagram()).strip() == expected.strip()

@patch('mlblocks.mlpipeline.MLBlock', new=get_mlblock_mock)
def test_get_diagram_multiple_blocks(self):
Expand Down Expand Up @@ -1189,7 +1189,7 @@ def test_get_diagram_multiple_blocks(self):
pipeline.blocks['b_primitive#1'].produce_args = first_output
pipeline.blocks['b_primitive#1'].produce_output = second_output

assert str(pipeline.get_diagram()) == expected
assert str(pipeline.get_diagram()).strip() == expected.strip()

def test_fit(self):
pass
Expand Down

0 comments on commit 79fc8fb

Please sign in to comment.