Skip to content

Commit e029c6d

Browse files
author
Azure Pipelines
committed
Merge remote-tracking branch 'origin/main' into publication
2 parents 31b7de8 + 7b418e8 commit e029c6d

File tree

6 files changed

+39
-105
lines changed

6 files changed

+39
-105
lines changed

.actions/assistant.py

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,31 @@ def get_running_torch_version() -> str:
124124
return ""
125125

126126

127+
def _parse_package_name(pkg: str, keys: str = " !<=>[]@", egg_name: str = "#egg=") -> str:
128+
"""Parsing just the package name.
129+
130+
Args:
131+
pkg: full package info including version coming from `pip freeze
132+
keys: char separators for parsing package name and version or other info
133+
egg_name: eventual passing egg names once isnralled from URL
134+
135+
Examples:
136+
>>> _parse_package_name("torch==2.0.1+cu118")
137+
'torch'
138+
>>> _parse_package_name("torch-cluster==1.6.3+pt20cu118")
139+
'torch-cluster'
140+
>>> _parse_package_name("torch_geometric==2.4.0")
141+
'torch_geometric'
142+
143+
"""
144+
if egg_name in pkg:
145+
pkg = pkg[pkg.index(egg_name) + len(egg_name) :]
146+
if any(c in pkg for c in keys):
147+
ix = min(pkg.index(c) for c in keys if c in pkg)
148+
pkg = pkg[:ix]
149+
return pkg
150+
151+
127152
_TORCH_VERSION = get_running_torch_version()
128153
_CUDA_VERSION = get_running_cuda_version()
129154
_RUNTIME_VERSIONS = dict(
@@ -750,18 +775,17 @@ def update_env_details(folder: str, base_path: str = DIR_NOTEBOOKS) -> str:
750775
req += meta.get("requirements", [])
751776
req = [r.strip() for r in req]
752777

753-
def _parse_package_name(pkg: str, keys: str = " !<=>[]@", egg_name: str = "#egg=") -> str:
754-
"""Parsing just the package name."""
755-
if egg_name in pkg:
756-
pkg = pkg[pkg.index(egg_name) + len(egg_name) :]
757-
if any(c in pkg for c in keys):
758-
ix = min(pkg.index(c) for c in keys if c in pkg)
759-
pkg = pkg[:ix]
760-
return pkg
761-
762778
require = {_parse_package_name(r) for r in req if r}
763-
env = {_parse_package_name(p): p for p in freeze.freeze()}
764-
meta["environment"] = [env[r] for r in require]
779+
# duplicate package name/key for cases with -/_ separator
780+
env = {
781+
**{_parse_package_name(p).replace("-", "_"): p for p in freeze.freeze()},
782+
**{_parse_package_name(p).replace("_", "-"): p for p in freeze.freeze()},
783+
}
784+
# for debugging reasons print the env and requested packages
785+
try:
786+
meta["environment"] = [env[r] for r in require]
787+
except KeyError:
788+
raise KeyError(f"Missing matching requirements: {require}\n within environment: {env}")
765789
meta["published"] = datetime.now().isoformat()
766790

767791
fmeta = os.path.join(base_path, folder) + ".yaml"

course_UvA-DL/06-graph-neural-networks/.meta.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ requirements:
2222
- torch-sparse
2323
- torch-cluster
2424
- torch-spline-conv
25-
- torch-geometric
26-
- lightning>=2.0.0
25+
- "torch-geometric>=2.0.0,<2.5.0"
26+
- "lightning>=2.0.0"
2727
pip__find-link:
2828
# - https://pytorch-geometric.com/whl/torch-1.8.0+cu101.html
2929
- https://pytorch-geometric.com/whl/torch-%(TORCH_MAJOR_DOT_MINOR)s.0+%(DEVICE)s.html

lightning_examples/finetuning-scheduler/.meta.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ description: |
1515
and foundation model weights. The required dependencies are installed via the finetuning-scheduler ``[examples]`` extra.
1616
requirements:
1717
- finetuning-scheduler[examples]>=2.0.0
18+
- datasets<2.18.0 # todo: some compatibility issue, please pass the argument `trust_remote_code=True`
1819
- torch>=1.12.1 # to avoid https://github.com/pytorch/pytorch/issues/80809 with torch 1.12.0
1920
accelerator:
2021
- GPU

lightning_examples/text-transformers/.meta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ description: |
1212
(We just show CoLA and MRPC due to constraint on compute/disk)
1313
requirements:
1414
- transformers
15-
- datasets
15+
- datasets<2.18.0 # todo: some compatibility issue, please pass the argument `trust_remote_code=True`
1616
- scipy
1717
- scikit-learn
1818
- torchtext>=0.9

templates/img-classify/.meta.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

templates/img-classify/classify.py

Lines changed: 0 additions & 70 deletions
This file was deleted.

0 commit comments

Comments
 (0)