Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit c3f4e09

Browse files
committedJan 10, 2021
FIX #57 - Move requirements files as extra-requires to make install easier
1 parent 7bc28e1 commit c3f4e09

File tree

9 files changed

+36
-28
lines changed

9 files changed

+36
-28
lines changed
 

‎.github/workflows/test.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,21 @@ jobs:
2525
uses: actions/setup-python@v1
2626
with:
2727
python-version: ${{ matrix.python-version }}
28-
- name: Install dependencies
28+
- name: Install package
2929
run: |
3030
python -m pip install --upgrade pip
31-
pip install -r requirements/requirements.txt
32-
pip install -r requirements/test_requirements.txt
31+
pip install .
32+
- name: Install test dependencies
33+
run: |
34+
pip install kedro-mlflow[tests]
3335
- name: Lint with flake8
3436
run: |
3537
# stop the build if there are Python syntax errors or undefined names
3638
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics --exclude kedro_mlflow/template/project/run.py
3739
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
38-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics --exclude kedro_mlflow/template/project/run.py
40+
flake8 . --count --max-complexity=10 --max-line-length=127 --statistics --exclude kedro_mlflow/template/project/run.py
3941
- name: Test with pytest and generate coverage report
4042
run: |
41-
pip install -e . # required for some tests which launches commands via subprocess
4243
pytest --cov=./ --cov-report=xml
4344
- name: Upload coverage report to Codecov
4445
uses: codecov/codecov-action@v1

‎.readthedocs.yml

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ formats:
1818
python:
1919
version: 3.6
2020
install:
21-
- requirements: requirements/docs_requirements.txt
22-
- method: setuptools
21+
- method: pip
2322
path: .
23+
extra_requirements:
24+
- docs

‎CONTRIBUTING.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,14 @@
22

33
The current workflow is the following:
44

5-
1. Open an issue to describe your feature request or your bug fix with detailed explanation of what you want to achieve.
5+
1. Open an issue to describe your feature request or your bug fix with a detailed explanation of what you want to achieve.
66
2. Fork the repo
77
3. Develop locally:
88
- Install the precommit file (`pip install pre-commit`, then `pre-commit install`)
99
- Create a branch based on the develop branch (``git checkout -b <prefix-branchname> develop``)
10+
- Create a conda environment (conda create -n <your-env-name> python==3.7)
11+
- Activate this environment (`conda activate <your-env-name>`)
12+
- Install the extra dependencies for tests (`pip install kedro-mlflow[tests]`)
1013
- Apply your changes
1114
- Run pre-commit (black linting, flake8 errors, isort with ``pre-commit run``)
1215
4. Submit your changes:
@@ -42,4 +45,4 @@ The current workflow is the following:
4245
4. Checkout the [publish workflow](https://github.com/Galileo-Galilei/kedro-mlflow/actions?query=workflow%3Apublish) to see if:
4346
- The package has been uploaded on PyPI sucessfully
4447
- The changes have been merged back to develop
45-
5. If the pipeline has failed, please raise an issue to correct the CI, and ensure merge on develop "by hand"".
48+
5. If the pipeline has failed, please raise an issue to correct the CI, and ensure merge on develop manually.

‎kedro_mlflow/framework/cli/cli.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def commands():
5656
@commands.command(name="mlflow", cls=KedroClickGroup)
5757
def mlflow_commands():
5858
"""Use mlflow-specific commands inside kedro project."""
59-
pass
59+
pass # pragma: no cover
6060

6161

6262
@mlflow_commands.command()
File renamed without changes.

‎requirements/docs_requirements.txt

-6
This file was deleted.

‎requirements/test_requirements.txt

-8
This file was deleted.

‎setup.py

+21-3
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ def _parse_requirements(path, encoding="utf-8"):
1515

1616

1717
# get the dependencies and installs
18-
base_requirements = _parse_requirements("requirements/requirements.txt")
19-
test_requirements = _parse_requirements("requirements/test_requirements.txt")
18+
base_requirements = _parse_requirements("requirements.txt")
2019

2120

2221
# Get the long description from the README file
@@ -36,8 +35,27 @@ def _parse_requirements(path, encoding="utf-8"):
3635
packages=find_packages(exclude=["docs*", "tests*"]),
3736
setup_requires=["setuptools_scm"],
3837
include_package_data=True,
39-
tests_require=test_requirements,
4038
install_requires=base_requirements,
39+
extras_require={
40+
"docs": [
41+
"sphinx==3.4.2",
42+
"recommonmark==0.7.1",
43+
"sphinx_rtd_theme==0.5.1",
44+
"sphinx-markdown-tables==0.0.15",
45+
"pandas>=1.0.0, <1.3.0", # avoid to make readthedocs load rc version
46+
"numpy>=1.0.0, <1.19.0", # bug on windows for numpy 1.19.0->1.19.4
47+
],
48+
"tests": [
49+
"pytest>=5.4.0, <7.0.0",
50+
"pytest-cov>=2.8.0, <3.0.0",
51+
"pytest-lazy-fixture>=0.6.0, <1.0.0",
52+
"pytest-mock>=3.1.0, <4.0.0",
53+
"scikit-learn>=0.23.0, <0.25.0",
54+
"flake8==3.8.4", # ensure consistency with pre-commit
55+
"black==20.8b1", # pin black version because it is not compatible with a pip range (because of non semver version number)
56+
"isort==5.7.0", # ensure consistency with pre-commit
57+
],
58+
},
4159
author="Galileo-Galilei",
4260
entry_points={
4361
"kedro.project_commands": [

‎tests/test_utils.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
from kedro_mlflow.utils import (
77
KEDRO_VERSION,
8-
KedroContextError,
98
_already_updated,
109
_get_project_globals,
1110
_is_kedro_project,

0 commit comments

Comments
 (0)
Please sign in to comment.