Skip to content

Commit c7127c8

Browse files
authored
Merge branch 'master' into ioannis@18861-CSVLogger-fails-on-remote-fs
2 parents 17c3d0b + c235f20 commit c7127c8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+388
-102
lines changed

.actions/assistant.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,17 +359,19 @@ def copy_replace_imports(
359359

360360

361361
def create_mirror_package(source_dir: str, package_mapping: Dict[str, str]) -> None:
362+
"""Create a mirror package with adjusted imports."""
362363
# replace imports and copy the code
363364
mapping = package_mapping.copy()
364365
mapping.pop("lightning", None) # pop this key to avoid replacing `lightning` to `lightning.lightning`
365366

366367
mapping = {f"lightning.{sp}": sl for sp, sl in mapping.items()}
367368
for pkg_from, pkg_to in mapping.items():
369+
source_imports, target_imports = zip(*mapping.items())
368370
copy_replace_imports(
369371
source_dir=os.path.join(source_dir, pkg_from.replace(".", os.sep)),
370372
# pytorch_lightning uses lightning_fabric, so we need to replace all imports for all directories
371-
source_imports=mapping.keys(),
372-
target_imports=mapping.values(),
373+
source_imports=source_imports,
374+
target_imports=target_imports,
373375
target_dir=os.path.join(source_dir, pkg_to.replace(".", os.sep)),
374376
lightning_by=pkg_from,
375377
)

.github/workflows/call-clear-cache.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ on:
1212
jobs:
1313
cron-clear:
1414
if: github.event_name == 'schedule'
15-
uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@v0.10.1
15+
uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@v0.11.2
1616
with:
1717
pattern: "latest|docs"
1818

1919
direct-clear:
2020
if: github.event_name == 'workflow_dispatch'
21-
uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@v0.10.1
21+
uses: Lightning-AI/utilities/.github/workflows/clear-cache.yml@v0.11.2
2222
with:
2323
pattern: ${{ inputs.pattern }}

.github/workflows/ci-check-md-links.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414

1515
jobs:
1616
check-md-links:
17-
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.10.1
17+
uses: Lightning-AI/utilities/.github/workflows/check-md-links.yml@v0.11.2
1818
with:
1919
config-file: ".github/markdown-links-config.json"
2020
base-branch: "master"

.github/workflows/ci-schema.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88

99
jobs:
1010
check:
11-
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.10.1
11+
uses: Lightning-AI/utilities/.github/workflows/check-schema.yml@v0.11.2
1212
with:
1313
# skip azure due to the wrong schema file by MSFT
1414
# https://github.com/Lightning-AI/lightning-flash/pull/1455#issuecomment-1244793607

.github/workflows/docs-build.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ jobs:
6262
target: ["html", "doctest", "linkcheck"]
6363
env:
6464
DOCS_COPY_NOTEBOOKS: 1
65+
PIN_RELEASE_VERSIONS: 1
6566
ARTIFACT_DAYS: 0
6667
steps:
6768
- uses: actions/checkout@v4
@@ -90,7 +91,7 @@ jobs:
9091
timeout-minutes: 5
9192
run: |
9293
sudo apt-get update --fix-missing
93-
sudo apt-get install -y pandoc texlive-latex-extra dvipng texlive-pictures
94+
sudo apt-get install -y pandoc
9495
- name: Install package & dependencies
9596
timeout-minutes: 20
9697
run: |

.github/workflows/release-nightly.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ defaults:
1717
run:
1818
shell: bash
1919

20-
env:
21-
FREEZE_REQUIREMENTS: 1
22-
TORCH_URL: "https://download.pytorch.org/whl/cpu/torch_stable.html"
23-
PYTHON_VER: "3.8"
24-
2520
jobs:
2621
build-packages:
2722
runs-on: ubuntu-22.04

.pre-commit-config.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ repos:
7070
- id: sphinx-lint
7171

7272
- repo: https://github.com/astral-sh/ruff-pre-commit
73-
rev: v0.3.2
73+
rev: v0.3.5
7474
hooks:
7575
# try to fix what is possible
7676
- id: ruff
@@ -101,4 +101,5 @@ repos:
101101
hooks:
102102
- id: prettier
103103
# https://prettier.io/docs/en/options.html#print-width
104+
files: \.(json|yml|yaml|toml)
104105
args: ["--print-width=120"]

.prettierignore

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

docs/source-app/conf.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474
"sphinx.ext.linkcode",
7575
"sphinx.ext.autosummary",
7676
"sphinx.ext.napoleon",
77-
"sphinx.ext.imgmath",
7877
# 'sphinxcontrib.mockautodoc', # raises error: directive 'automodule' is already registered ...
7978
# 'sphinxcontrib.fulltoc', # breaks pytorch-theme with unexpected kw argument 'titles_only'
8079
"sphinxcontrib.video",
@@ -87,6 +86,7 @@
8786
"sphinx_togglebutton",
8887
"sphinx.ext.githubpages",
8988
"lai_sphinx_theme.extensions.lightning",
89+
'sphinx.ext.mathjax',
9090
]
9191

9292
# Add any paths that contain templates here, relative to this directory.
@@ -206,6 +206,13 @@
206206
(master_doc, project + ".tex", project + " Documentation", author, "manual"),
207207
]
208208

209+
# MathJax configuration
210+
mathjax3_config = {
211+
'tex': {
212+
'packages': {'[+]': ['ams', 'newcommand', 'configMacros']}
213+
},
214+
}
215+
209216
# -- Options for manual page output ------------------------------------------
210217

211218
# One entry per manual page. List of tuples

docs/source-fabric/conf.py

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import sys
1616

1717
import lai_sphinx_theme
18-
from lightning_utilities.docs import fetch_external_assets
1918

2019
import lightning
2120

@@ -26,6 +25,7 @@
2625
_SPHINX_MOCK_REQUIREMENTS = int(os.environ.get("SPHINX_MOCK_REQUIREMENTS", True))
2726
_FAST_DOCS_DEV = int(os.environ.get("FAST_DOCS_DEV", True))
2827
_FETCH_S3_ASSETS = int(os.getenv("DOCS_FETCH_ASSETS", not _FAST_DOCS_DEV))
28+
_PIN_RELEASE_VERSIONS = int(os.getenv("PIN_RELEASE_VERSIONS", not _FAST_DOCS_DEV))
2929

3030
# -- Project information -----------------------------------------------------
3131

@@ -47,12 +47,21 @@
4747
# -- Project documents -------------------------------------------------------
4848

4949
if _FETCH_S3_ASSETS:
50+
from lightning_utilities.docs import fetch_external_assets
51+
5052
fetch_external_assets(
5153
docs_folder=_PATH_HERE,
5254
assets_folder="_static/fetched-s3-assets",
5355
retrieve_pattern=r"https?://[-a-zA-Z0-9_]+\.s3\.[-a-zA-Z0-9()_\\+.\\/=]+",
5456
)
5557

58+
if _PIN_RELEASE_VERSIONS:
59+
from lightning_utilities.docs import adjust_linked_external_docs
60+
61+
adjust_linked_external_docs(
62+
"https://pytorch.org/docs/stable/", "https://pytorch.org/docs/{torch.__version__}/", _PATH_ROOT
63+
)
64+
5665
# -- General configuration ---------------------------------------------------
5766

5867
# If your documentation needs a minimal Sphinx version, state it here.
@@ -72,7 +81,6 @@
7281
"sphinx.ext.viewcode",
7382
"sphinx.ext.autosummary",
7483
"sphinx.ext.napoleon",
75-
"sphinx.ext.imgmath",
7684
"sphinx.ext.autosectionlabel",
7785
# 'sphinxcontrib.mockautodoc', # raises error: directive 'automodule' is already registered ...
7886
# 'sphinxcontrib.fulltoc', # breaks pytorch-theme with unexpected kw argument 'titles_only'
@@ -83,6 +91,7 @@
8391
"sphinx_paramlinks",
8492
"sphinx_togglebutton",
8593
"lai_sphinx_theme.extensions.lightning",
94+
'sphinx.ext.mathjax',
8695
]
8796

8897
# Add any paths that contain templates here, relative to this directory.
@@ -203,6 +212,13 @@
203212
(master_doc, project + ".tex", project + " Documentation", author, "manual"),
204213
]
205214

215+
# MathJax configuration
216+
mathjax3_config = {
217+
'tex': {
218+
'packages': {'[+]': ['ams', 'newcommand', 'configMacros']}
219+
},
220+
}
221+
206222
# -- Options for manual page output ------------------------------------------
207223

208224
# One entry per manual page. List of tuples

0 commit comments

Comments
 (0)