Require neptune 1.0 (#16888)

Co-authored-by: Carlos Mocholí <carlossmocholi@gmail.com>
This commit is contained in:
Wouter Zwerink 2023-02-28 12:13:42 +01:00 committed by GitHub
parent f697fff5db
commit dfa35dac99
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 14 additions and 11 deletions

View File

@ -68,7 +68,7 @@ To use `Neptune.ai <https://neptune.ai/>`_ first install the neptune package:
.. code-block:: bash
pip install neptune-client
pip install neptune
or with conda:

View File

@ -1,5 +1,5 @@
# all supported loggers. this list is here as a reference, but they are not installed in CI
neptune-client
neptune>=1.0.0
comet-ml
mlflow>=1.0.0
wandb

View File

@ -142,6 +142,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- Merged the `DDPSpawnStrategy` into `DDPStrategy` ([#16809](https://github.com/Lightning-AI/lightning/pull/16809))
- The `NeptuneLogger` now requires `neptune>=1.0.0` ([#16888](https://github.com/Lightning-AI/lightning/pull/16888))
### Deprecated
-

View File

@ -34,10 +34,10 @@ from lightning.pytorch.loggers.logger import Logger, rank_zero_experiment
from lightning.pytorch.utilities.model_summary import ModelSummary
from lightning.pytorch.utilities.rank_zero import rank_zero_only
_NEPTUNE_AVAILABLE = RequirementCache("neptune-client")
_NEPTUNE_AVAILABLE = RequirementCache("neptune>=1.0.0")
if _NEPTUNE_AVAILABLE:
from neptune import new as neptune
from neptune.new.run import Run
import neptune
from neptune.run import Run
else:
# needed for test mocks, and function signatures
neptune, Run = None, None
@ -55,7 +55,7 @@ class NeptuneLogger(Logger):
.. code-block:: bash
pip install neptune-client
pip install neptune
or conda:
@ -86,7 +86,7 @@ class NeptuneLogger(Logger):
.. code-block:: python
from neptune.new.types import File
from neptune.types import File
from lightning.pytorch import LightningModule
@ -302,7 +302,7 @@ class NeptuneLogger(Logger):
) -> None:
# check if user passed the client `Run` object
if run is not None and not isinstance(run, Run):
raise ValueError("Run parameter expected to be of type `neptune.new.Run`.")
raise ValueError("Run parameter expected to be of type `neptune.Run`.")
# check if user passed redundant neptune.init_run arguments when passed run
any_neptune_init_arg_passed = any(arg is not None for arg in [api_key, project, name]) or neptune_run_kwargs
if run is not None and any_neptune_init_arg_passed:

View File

@ -1384,7 +1384,7 @@ def test_comet_logger_init_args():
)
@pytest.mark.skipif(not _NEPTUNE_AVAILABLE, reason="neptune-client is required")
@pytest.mark.skipif(not _NEPTUNE_AVAILABLE, reason="neptune is required")
def test_neptune_logger_init_args():
_test_logger_init_args(
"NeptuneLogger",
@ -1392,7 +1392,7 @@ def test_neptune_logger_init_args():
"name": "neptune", # Resolve from NeptuneLogger.__init__
},
{
"description": "neptune", # Unsupported resolving from neptune.new.internal.init.run.init_run
"description": "neptune", # Unsupported resolving from neptune.internal.init.run.init_run
},
)

View File

@ -93,7 +93,7 @@ def clean_import():
("torch.distributed.is_available", _shortcut_patch(is_available, ()), "lightning.pytorch"),
(
"lightning_utilities.core.imports.RequirementCache.__bool__",
_shortcut_patch(RequirementCache.__bool__, ("neptune-client",), ("requirement",)),
_shortcut_patch(RequirementCache.__bool__, ("neptune",), ("requirement",)),
"lightning.pytorch.loggers.neptune",
),
(