Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

BUILD: align build requirements pyproject.toml/meta.yaml/tox.ini & across repos #119

Merged
merged 5 commits into from
Feb 1, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 7 additions & 10 deletions condabuild/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,15 @@ requirements:
- gamma-pytools{{ environ.get('FACET_V_GAMMA_PYTOOLS') }}
- packaging>=20
run:
- python{{ environ.get('FACET_V_PYTHON') }}
- pandas{{ environ.get('FACET_V_PANDAS') }}
- numpy{{ environ.get('FACET_V_NUMPY') }}
- joblib{{ environ.get('FACET_V_JOBLIB') }}
- scipy{{ environ.get('FACET_V_SCIPY') }}
- pyyaml{{ environ.get('FACET_V_PYYAML') }}
- typing_inspect{{ environ.get('FACET_V_TYPING_INSPECT') }}
- scikit-learn{{ environ.get('FACET_V_SCIKIT_LEARN') }}
- boruta_py{{ environ.get('FACET_V_BORUTA') }}
- lightgbm{{ environ.get('FACET_V_LIGHTGBM') }}
- gamma-pytools{{ environ.get('FACET_V_GAMMA_PYTOOLS') }}
- packaging>=20
- lightgbm{{ environ.get('FACET_V_LIGHTGBM') }}
- numpy{{ environ.get('FACET_V_NUMPY') }}
- packaging{{ environ.get('FACET_V_PACKAGING') }}
- pandas{{ environ.get('FACET_V_PANDAS') }}
- python{{ environ.get('FACET_V_PYTHON') }}
- scikit-learn{{ environ.get('FACET_V_SCIKIT_LEARN') }}
- scipy{{ environ.get('FACET_V_SCIPY') }}
test:
imports:
- sklearndf
Expand Down
72 changes: 39 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ dist-name = "sklearndf"
license = "Apache Software License v2.0"

requires = [
"boruta >= 0.3",
"lightgbm >= 3.0",
"scikit-learn >=0.21,<0.24",
"tableone >= 0.7",
"pandas >= 0.24,<1.3",
"numpy >= 1.16,<1.20",
"joblib >= 0.13,<1.0",
"scipy >= 1.2,<1.6",
"typing_inspect >= 0.4",
"pyyaml >= 5.0",
"gamma-pytools >= 1.0.2,<2",
"packaging >= 20",
# direct requirements of sklearndf
"boruta >= 0.3",
"gamma-pytools >= 1.0.2,<2",
"lightgbm >= 3.0",
"numpy >=1.16,<1.20",
"packaging >=20",
"pandas >=0.24,<1.2",
"scikit-learn >=0.21,<0.24",
# additional requirements of gamma-pytools
"joblib >=0.13,<1.1",
"matplotlib >=3.0,<3.4",
"scipy >=1.2,<1.6",
"typing_inspect >=0.4,<0.6",
]

requires-python = ">=3.6,<4"
Expand Down Expand Up @@ -70,29 +71,34 @@ Documentation = "https://bcg-gamma.github.io/sklearndf/"
Repository = "https://github.com/BCG-Gamma/sklearndf"

[build.matrix.min]
python = "=3.6.*"
pandas = "=0.24.*"
numpy = "=1.16.*"
scipy = "=1.2.*"
joblib = "=0.13.*"
scikit-learn = "=0.21.*"
# direct requirements of sklearndf
boruta = "=0.3.*"
gamma-pytools = "=1.0.2"
lightgbm = "=3.0.*"
numpy = "=1.16.*"
pandas = "=0.24.*"
python = "=3.6.*"
scikit-learn = "=0.21.*"
# additional requirements of gamma-pytools
joblib = "=0.13.*"
matplotlib = "=3.0.*"
scipy = "=1.2.*"
typing_inspect = "=0.4"

[build.matrix.max]
python = "=3.8.*"
pandas = "=1.1.*"
numpy = "=1.19.*"
scipy = "=1.5.*"
joblib = "=0.16.*"
scikit-learn = "=0.23.*"

[build.matrix.unconstrained]
python = ">=3.6,<4"
pandas = ">=0.24"
numpy = ">=1.16"
scipy = ">=1.2,<1.6"
joblib = ">=0.13"
scikit-learn = ">=0.21,<0.24"
lightgbm = ">= 3.0"
# direct requirements of sklearndf
boruta = ">=0.3"
gamma-pytools = "<2"
lightgbm = ">=3.0.*"
numpy = "=1.19.*"
pandas = "=1.1.*"
python = "=3.8.*"
scikit-learn = "=0.23.*"
# additional requirements of gamma-pytools
joblib = "=1.0.*"
matplotlib = "=3.3.*"
scipy = "=1.5.*"
typing_inspect = "=0.6"

[tool.black]
# quiet = "True"
Expand Down
17 changes: 0 additions & 17 deletions test/test/__init__.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,10 @@
# noinspection PyPackageRequirements
import sklearn
import yaml
from packaging import version

from test.paths import TEST_CONFIG_YML


def read_test_config(section: str = None):
config_file_path = TEST_CONFIG_YML
with open(config_file_path, "r") as f:
config = yaml.safe_load(f)
if section is None:
return config
else:
for element in config:
if type(element) == dict:
for key in element.keys():
if key == section:
return element[key]

raise ValueError("Section %s not found in global config!" % section)


def check_sklearn_version(minimum: str = "0.21", maximum: str = "0.24"):
""" Utility to check sklearn version against provided string. """
v_sklearn = version.parse(sklearn.__version__)
Expand Down
7 changes: 1 addition & 6 deletions test/test/sklearndf/pipeline/test_pipeline_df.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
"""
import shutil
import time
from distutils.version import LooseVersion
from tempfile import mkdtemp
from typing import Any, Dict, Mapping

Expand Down Expand Up @@ -119,11 +118,7 @@ def test_pipeline_df_memory(
cache_dir = mkdtemp()

try:
if LooseVersion(joblib.__version__) < LooseVersion("0.12"):
# Deal with change of API in joblib
memory = joblib.Memory(cachedir=cache_dir, verbose=10)
else:
memory = joblib.Memory(location=cache_dir, verbose=10)
memory = joblib.Memory(location=cache_dir, verbose=10)

# Test with Transformer + SVC
clf = SVCDF(probability=True, random_state=0)
Expand Down
21 changes: 12 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ setenv =
PIP_EXTRA_INDEX_URL={env:FACET_PATH_URI}/pytools/dist/tox/simple

deps =
pip >= 20
gamma-pytools {env:FACET_V_GAMMA_PYTOOLS}
pip >= 20

extras =
testing
Expand All @@ -29,14 +29,17 @@ commands =

[testenv:{py3,py36,py37,py38,py39}-custom-deps]
deps =
pip >= 20
lightgbm {env:FACET_V_LIGHTGBM}
gamma-pytools {env:FACET_V_GAMMA_PYTOOLS}
pandas {env:FACET_V_PANDAS}
numpy {env:FACET_V_NUMPY}
joblib {env:FACET_V_JOBLIB}
scipy {env:FACET_V_SCIPY}
scikit-learn {env:FACET_V_SCIKIT_LEARN}
boruta{env:FACET_V_BORUTA}
gamma-pytools{env:FACET_V_GAMMA_PYTOOLS}
joblib{env:FACET_V_JOBLIB}
lightgbm{env:FACET_V_LIGHTGBM}
matplotlib{env:FACET_V_MATPLOTLIB}
numpy{env:FACET_V_NUMPY}
pandas{env:FACET_V_PANDAS}
pyyaml == 5.*
scikit-learn{env:FACET_V_SCIKIT_LEARN}
scipy{env:FACET_V_SCIPY}
typing_inspect{env:FACET_V_TYPING_INSPECT}

[flake8]

Expand Down