separate requirements for logger dependencies (#792)

* added file that contains information on the minimal versions needed for the supported loggers

* copied minimal version, combined files, deleted duplicates

* sorted functions in tests/test_loggers.py to be consistent

* expanded wandb logging test; added minimal versions for requirements-extra.txt; increased the amount of training data that is used for tests

* formatting

* added requirements-extra.txt to MANIFEST.in

* reverted wandb test; ensured minimal version for dependencies in requirements-extra.txt in ci-testing.yml
This commit is contained in:
Aljoscha Steffens 2020-02-21 18:30:27 +00:00 committed by GitHub
parent 897def2cac
commit 9eb1907151
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 21 deletions

View File

@ -25,6 +25,7 @@ jobs:
if: matrix.requires == 'minimal'
run: |
python -c "req = open('requirements.txt').read().replace('>', '=') ; open('requirements.txt', 'w').write(req)"
python -c "req = open('requirements-extra.txt').read().replace('>', '=') ; open('requirements-extra.txt', 'w').write(req)"
- name: Cache pip
uses: actions/cache@v1

View File

@ -29,6 +29,7 @@ recursive-include docs/source/_static/images/ lightning_logo* pl_overview* tf_*
# Include the Requirements
include requirements.txt
include requirements-extra.txt
# Exclude build configs
exclude *.yml

5
requirements-extra.txt Normal file
View File

@ -0,0 +1,5 @@
neptune-client>=0.4.4
comet-ml>=1.0.56
mlflow>=1.0.0
test_tube>=0.7.5
wandb>=0.8.21

View File

@ -7,11 +7,6 @@ pytest-cov
pytest-flake8
flake8
check-manifest
test-tube>=0.7.5
mlflow
comet_ml
wandb
sacred
neptune-client
twine==1.13.0
pillow<7.0.0
-r ../requirements-extra.txt

View File

@ -29,7 +29,7 @@ def test_testtube_logger(tmpdir):
trainer_options = dict(
default_save_path=tmpdir,
max_epochs=1,
train_percent_check=0.01,
train_percent_check=0.05,
logger=logger
)
@ -53,7 +53,7 @@ def test_testtube_pickle(tmpdir):
trainer_options = dict(
default_save_path=tmpdir,
max_epochs=1,
train_percent_check=0.01,
train_percent_check=0.05,
logger=logger
)
@ -76,7 +76,7 @@ def test_mlflow_logger(tmpdir):
trainer_options = dict(
default_save_path=tmpdir,
max_epochs=1,
train_percent_check=0.01,
train_percent_check=0.05,
logger=logger
)
trainer = Trainer(**trainer_options)
@ -132,7 +132,7 @@ def test_comet_logger(tmpdir, monkeypatch):
trainer_options = dict(
default_save_path=tmpdir,
max_epochs=1,
train_percent_check=0.01,
train_percent_check=0.05,
logger=logger
)
@ -182,7 +182,16 @@ def test_wandb_logger(tmpdir):
tutils.reset_seed()
wandb_dir = os.path.join(tmpdir, "wandb")
_ = WandbLogger(save_dir=wandb_dir, anonymous=True)
_ = WandbLogger(save_dir=wandb_dir, anonymous=True, offline=True)
def test_wandb_pickle(tmpdir):
"""Verify that pickling trainer with wandb logger works."""
tutils.reset_seed()
wandb_dir = str(tmpdir)
logger = WandbLogger(save_dir=wandb_dir, anonymous=True, offline=True)
assert logger is not None
def test_neptune_logger(tmpdir):
@ -196,7 +205,7 @@ def test_neptune_logger(tmpdir):
trainer_options = dict(
default_save_path=tmpdir,
max_epochs=1,
train_percent_check=0.01,
train_percent_check=0.05,
logger=logger
)
trainer = Trainer(**trainer_options)
@ -206,15 +215,6 @@ def test_neptune_logger(tmpdir):
assert result == 1, "Training failed"
def test_wandb_pickle(tmpdir):
"""Verify that pickling trainer with wandb logger works."""
tutils.reset_seed()
wandb_dir = str(tmpdir)
logger = WandbLogger(save_dir=wandb_dir, anonymous=True)
assert logger is not None
def test_neptune_pickle(tmpdir):
"""Verify that pickling trainer with neptune logger works."""
tutils.reset_seed()