Skip to content

Commit 8623143

Browse files
awaelchlilexierule
authored andcommitted
release 2.1.4
1 parent 80c02ff commit 8623143

File tree

19 files changed

+76
-19
lines changed

19 files changed

+76
-19
lines changed

.actions/assistant.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ def _download_frontend(pkg_path: str, version: str = "v0.0.0"):
234234
response = urllib.request.urlopen(frontend_release_url)
235235

236236
file = tarfile.open(fileobj=response, mode="r|gz")
237-
file.extractall(path=download_dir)
237+
file.extractall(path=download_dir) # noqa: S202
238238

239239
shutil.move(download_dir, frontend_dir)
240240
print("The Lightning UI has successfully been downloaded!")
@@ -457,7 +457,7 @@ def pull_docs_files(
457457
raise RuntimeError(f"Requesting file '{zip_url}' does not exist or it is just unavailable.")
458458

459459
with zipfile.ZipFile(zip_file, "r") as zip_ref:
460-
zip_ref.extractall(tmp)
460+
zip_ref.extractall(tmp) # noqa: S202
461461

462462
zip_dirs = [d for d in glob.glob(os.path.join(tmp, "*")) if os.path.isdir(d)]
463463
# check that the extracted archive has only repo folder

docs/source-pytorch/extensions/strategy.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ The below table lists all relevant strategies available in Lightning with their
7777
- Strategy for multi-process single-device training on one or multiple nodes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel>`
7878
* - ddp_spawn
7979
- :class:`~lightning.pytorch.strategies.DDPStrategy`
80-
- Same as "ddp" but launches processes using :func:`torch.multiprocessing.spawn` method and joins processes after training finishes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel Spawn>`
80+
- Same as "ddp" but launches processes using ``torch.multiprocessing.spawn`` method and joins processes after training finishes. :ref:`Learn more. <accelerators/gpu_intermediate:Distributed Data Parallel Spawn>`
8181
* - deepspeed
8282
- :class:`~lightning.pytorch.strategies.DeepSpeedStrategy`
8383
- Provides capabilities to run training using the DeepSpeed library, with training optimizations for large billion parameter models. :doc:`Learn more. <../advanced/model_parallel/deepspeed>`

examples/app/hpo/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def extract_tarfile(file_path: str, extract_path: str, mode: str):
4848
if ".zip" in local_filename:
4949
if os.path.exists(local_filename):
5050
with zipfile.ZipFile(local_filename, "r") as zip_ref:
51-
zip_ref.extractall(path)
51+
zip_ref.extractall(path) # noqa: S202
5252
elif local_filename.endswith(".tar.gz") or local_filename.endswith(".tgz"):
5353
extract_tarfile(local_filename, path, "r:gz")
5454
elif local_filename.endswith(".tar.bz2") or local_filename.endswith(".tbz"):

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ ignore-init-module-imports = true
7979
".actions/*" = ["S101", "S310"]
8080
"setup.py" = ["S101"]
8181
"examples/**" = [
82+
"F841", # Local variable is assigned to but never used
8283
"S101", # Use of `assert` detected
8384
"S113", # todo: Probable use of requests call without
8485
"S104", # Possible binding to all interface
@@ -88,6 +89,7 @@ ignore-init-module-imports = true
8889
"S108", # Probable insecure usage of temporary file or directory: "/tmp/data/MNIST"
8990
]
9091
"src/**" = [
92+
"F841", # Local variable is assigned to but never used
9193
"S101", # todo: Use of `assert` detected
9294
"S105", "S106", "S107", # todo: Possible hardcoded password: ...
9395
"S113", # todo: Probable use of requests call without timeout
@@ -103,12 +105,14 @@ ignore-init-module-imports = true
103105
"RET503",
104106
]
105107
"tests/**" = [
108+
"F841", # Local variable is assigned to but never used
106109
"S101", # Use of `assert` detected
107110
"S105", "S106", # todo: Possible hardcoded password: ...
108111
"S301", # `pickle` and modules that wrap it can be unsafe when used to deserialize untrusted data, possible security issue
109112
"S113", # todo: Probable use of requests call without timeout
110113
"S311", # todo: Standard pseudo-random generators are not suitable for cryptographic purposes
111114
"S108", # todo: Probable insecure usage of temporary file or directory: "/tmp/sys-customizations-sync"
115+
"S202", # Uses of `tarfile.extractall()`
112116
"S403", # `pickle`, `cPickle`, `dill`, and `shelve` modules are possibly insecure
113117
"S404", # `subprocess` module is possibly insecure
114118
"S602", # todo: `subprocess` call with `shell=True` identified, security issue

src/lightning/app/CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
66

77

8+
## [2.1.4] - 2024-01-31
9+
10+
### Changed
11+
12+
- Remove torch distributed for the Dataset Optimizer ([#19182](https://github.com/Lightning-AI/lightning/pull/19182))
13+
14+
815
## [2.1.3] - 2023-12-21
916

1017
### Changed

src/lightning/app/cli/cmd_pl_init.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def download_frontend(destination: Path) -> None:
121121
with TemporaryDirectory() as download_dir:
122122
response = urllib.request.urlopen(url) # noqa: S310
123123
file = tarfile.open(fileobj=response, mode="r|gz")
124-
file.extractall(path=download_dir)
124+
file.extractall(path=download_dir) # noqa: S202
125125
shutil.move(str(Path(download_dir, build_dir_name)), destination)
126126

127127

src/lightning/app/plugin/plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def _run_plugin(run: _Run) -> Dict[str, Any]:
154154
logger.info("Extracting plugin source.")
155155

156156
with tarfile.open(download_path, "r:gz") as tf:
157-
tf.extractall(source_path)
157+
tf.extractall(source_path) # noqa: S202
158158
except Exception as ex:
159159
raise HTTPException(
160160
status_code=status.HTTP_500_INTERNAL_SERVER_ERROR,

src/lightning/app/storage/drive.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ def __str__(self) -> str:
334334

335335

336336
def _maybe_create_drive(component_name: str, state: Dict) -> Union[Dict, Drive]:
337-
if state.get("type", None) == Drive.__IDENTIFIER__:
337+
if state.get("type") == Drive.__IDENTIFIER__:
338338
drive = Drive.from_dict(state)
339339
drive.component_name = component_name
340340
return drive

src/lightning/app/utilities/packaging/cloud_compute.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ def from_dict(cls, d: dict) -> "CloudCompute":
156156
f"mounts argument must be one of [None, Mount, List[Mount]], "
157157
f"received {mounts} of type {type(mounts)}"
158158
)
159-
_verify_mount_root_dirs_are_unique(d.get("mounts", None))
159+
_verify_mount_root_dirs_are_unique(d.get("mounts"))
160160
return cls(**d)
161161

162162
@property
@@ -183,6 +183,6 @@ def _verify_mount_root_dirs_are_unique(mounts: Union[None, Mount, List[Mount], T
183183

184184

185185
def _maybe_create_cloud_compute(state: Dict) -> Union[CloudCompute, Dict]:
186-
if state and state.get("type", None) == __CLOUD_COMPUTE_IDENTIFIER__:
186+
if state and state.get("type") == __CLOUD_COMPUTE_IDENTIFIER__:
187187
return CloudCompute.from_dict(state)
188188
return state

src/lightning/app/utilities/packaging/lightning_utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def download_frontend(root: str = _PROJECT_ROOT):
5252
response = urllib.request.urlopen(LIGHTNING_FRONTEND_RELEASE_URL) # noqa: S310
5353

5454
file = tarfile.open(fileobj=response, mode="r|gz")
55-
file.extractall(path=download_dir)
55+
file.extractall(path=download_dir) # noqa: S202
5656

5757
shutil.move(os.path.join(download_dir, build_dir), frontend_dir)
5858
print("The Lightning UI has successfully been downloaded!")

0 commit comments

Comments
 (0)