Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

doc-build: fix build on windows by using r string ci: change the way in which latex deps are read format ci.yml

Syrus Darkd8019cda8183
diff --git a/.github/manimdependency.json b/.github/manimdependency.json
index c9db99700..960c1f900 100644
--- a/.github/manimdependency.json
+++ b/.github/manimdependency.json
@@ -1,6 +1,25 @@
{
- "windows": {
- "ffmpeg": "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.3.1-2020-09-21-full_build.zip",
- "pango": "v0.1.0"
- }
+ "windows": {
+ "ffmpeg": "https://www.gyan.dev/ffmpeg/builds/packages/ffmpeg-4.3.1-2020-09-21-full_build.zip",
+ "pango": "v0.1.0",
+ "tinytex": [
+ "standalone",
+ "preview",
+ "doublestroke",
+ "ms",
+ "setspace",
+ "rsfs",
+ "relsize",
+ "ragged2e",
+ "fundus-calligra",
+ "microtype",
+ "wasysym",
+ "physics",
+ "dvisvgm",
+ "jknapltx",
+ "wasy",
+ "cm-super",
+ "babel-english"
+ ]
+ }
}
\ No newline at end of file
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 83f89cdd9..dfed89748 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -1,22 +1,22 @@
name: CI
on:
push:
- branches:
- - master
+ branches:
+ - master
pull_request:
- branches:
- - master
+ branches:
+ - master
jobs:
test:
runs-on: ${{ matrix.os }}
env:
- POETRY_VIRTUALENVS_CREATE: false
+ POETRY_VIRTUALENVS_CREATE: false
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
- python: [3.6,3.7, 3.8]
+ python: [3.6, 3.7, 3.8]
steps:
- name: Checkout the repository
@@ -36,8 +36,8 @@ jobs:
shell: bash
id: pip-cache-and-time
run: |
- echo "::set-output name=dir::$(pip cache dir)"
- echo "::set-output name=date::$(/bin/date -u "+%m%Y")"
+ echo "::set-output name=dir::$(pip cache dir)"
+ echo "::set-output name=date::$(/bin/date -u "+%m%Y")"
- name: pip cache
uses: actions/cache@v2
@@ -73,27 +73,31 @@ jobs:
if: runner.os == 'Windows'
uses: actions/cache@v2
with:
- path: ${{ github.workspace }}\ManimCache
- key: ${{ runner.os }}-dependencies-ffmpeg-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.pip-cache-and-time.outputs.date }}
+ path: ${{ github.workspace }}\ManimCache
+ key: ${{ runner.os }}-dependencies-ffmpeg-tinytex-${{ hashFiles('.github/manimdependency.json') }}-${{ steps.pip-cache-and-time.outputs.date }}
- name: Download system dependencies (Windows)
if: runner.os == 'Windows' && steps.cache-windows.outputs.cache-hit != 'true'
run: |
$ffmpegUrl = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['ffmpeg'])"
$pangoVersion = python -c "import json;print(json.load(open('.github/manimdependency.json'))['windows']['pango'])"
+ $tinyTexPackages = $(python -c "import json;print(' '.join(json.load(open('.github/manimdependency.json'))['windows']['tinytex']))") -Split ' '
$OriPath = $env:PATH
echo "Install Tinytex"
Invoke-WebRequest "https://ci.appveyor.com/api/projects/yihui/tinytex/artifacts/TinyTeX.zip?job=image:%20Visual%20Studio%202019" -O "$($env:TMP)\TinyTex.zip"
Expand-Archive -LiteralPath "$($env:TMP)\TinyTex.zip" -DestinationPath "$($PWD)\ManimCache\LatexWindows"
$env:Path = "$($PWD)\ManimCache\LatexWindows\TinyTeX\bin\win32;$($env:PATH)"
tlmgr update --self
- tlmgr install standalone preview doublestroke ms setspace rsfs relsize ragged2e fundus-calligra microtype wasysym physics dvisvgm jknapltx wasy cm-super babel-english
+ foreach ($c in $tinyTexPackages){
+ $c=$c.Trim()
+ tlmgr install $c
+ }
$env:PATH=$OriPath
echo "Completed Latex"
Invoke-WebRequest "$ffmpegUrl" -O "$($env:TMP)\ffmpeg.zip"
7z x "$($env:TMP)\ffmpeg.zip" -o"$($PWD)\ManimCache"
Move-Item "ManimCache\ffmpeg-*" "ManimCache\FFmpeg"
- Invoke-WebRequest "https://github.com/ManimCommunity/manim-windows/releases/download/$($pangoVersion)/pango-windows-binaires-x64.zip" -O "$($env:TMP)\Pango.zip"
+ Invoke-WebRequest "https://github.com/ManimCommunity/pango-windows-binaries/releases/download/$($pangoVersion)/pango-windows-binaires-x64.zip" -O "$($env:TMP)\Pango.zip"
mkdir "$($PWD)\ManimCache\Pango"
7z x "$($env:TMP)\Pango.zip" -o"$($PWD)\ManimCache\Pango"
diff --git a/docs/source/manim_directive.py b/docs/source/manim_directive.py
index 7e0fb3cdb..16ee8b442 100644
--- a/docs/source/manim_directive.py
+++ b/docs/source/manim_directive.py
@@ -172,14 +172,14 @@ class ManimDirective(Directive):
f'config["frame_rate"] = {frame_rate}',
f'config["pixel_height"] = {pixel_height}',
f'config["pixel_width"] = {pixel_width}',
- f'file_writer_config["media_dir"] = "{media_dir}"',
- f'file_writer_config["images_dir"] = "{images_dir}"',
- f'file_writer_config["tex_dir"] = "{tex_dir}"',
- f'file_writer_config["text_dir"] = "{text_dir}"',
- f'file_writer_config["video_dir"] = "{video_dir}"',
+ f'file_writer_config["media_dir"] = r"{media_dir}"',
+ f'file_writer_config["images_dir"] = r"{images_dir}"',
+ f'file_writer_config["tex_dir"] = r"{tex_dir}"',
+ f'file_writer_config["text_dir"] = r"{text_dir}"',
+ f'file_writer_config["video_dir"] = r"{video_dir}"',
f'file_writer_config["save_last_frame"] = {save_last_frame}',
f'file_writer_config["save_as_gif"] = {save_as_gif}',
- f'file_writer_config["output_file"] = "{output_file}"',
+ f'file_writer_config["output_file"] = r"{output_file}"',
]
user_code = self.content