Merge pull request #1336 from TonyCrane/publish

Package manimlib and automatically publish to pypi
This commit is contained in:
Grant Sanderson 2021-02-05 16:17:32 -08:00 committed by GitHub
commit f87b82a9e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 98 additions and 4 deletions

30
.github/workflows/publish.yml vendored Normal file
View file

@ -0,0 +1,30 @@
name: Upload Python Package
on:
release:
types: [created]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Build and publish
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*

View file

@ -1,4 +1,8 @@
![logo](logo/cropped.png)
<p align="center">
<a href="https://github.com/3b1b/manim">
<img src="https://raw.githubusercontent.com/3b1b/manim/master/logo/cropped.png">
</a>
</p>
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat)](http://choosealicense.com/licenses/mit/)
[![Manim Subreddit](https://img.shields.io/reddit/subreddit-subscribers/manim.svg?color=ff4301&label=reddit)](https://www.reddit.com/r/manim/)

View file

@ -134,7 +134,9 @@ def parse_cli():
def get_manim_dir():
return os.path.dirname(inspect.getabsfile(importlib.import_module("manim")))
manimlib_module = importlib.import_module("manimlib")
manimlib_dir = os.path.dirname(inspect.getabsfile(manimlib_module))
return os.path.abspath(os.path.join(manimlib_dir, ".."))
def get_module(file_name):
@ -150,7 +152,7 @@ def get_module(file_name):
def get_custom_defaults():
filename = "custom_defaults.yml"
manim_defaults_file = os.path.join(get_manim_dir(), filename)
manim_defaults_file = os.path.join(get_manim_dir(), "manimlib", "defaults.yml")
with open(manim_defaults_file, "r") as file:
custom_defaults = yaml.safe_load(file)

56
manimlib/defaults.yml Normal file
View file

@ -0,0 +1,56 @@
directories:
# Set this to true if you want the path to video files
# to match the directory structure of the path to the
# sourcecode generating that video
mirror_module_path: False
# Where should manim output video and image files?
output: ""
# If you want to use images, manim will look to these folders to find them
raster_images: ""
vector_images: ""
# If you want to use sounds, manim will look here to find it.
sounds: ""
# Manim often generates tex_files or other kinds of serialized data
# to keep from having to generate the same thing too many times. By
# default, these will be stored at tempfile.gettempdir(), e.g. this might
# return whatever is at to the TMPDIR environment variable. If you want to
# specify them elsewhere,
temporary_storage: ""
tex:
executable: "latex"
template_file: "tex_template.tex"
intermediate_filetype: "dvi"
text_to_replace: "[tex_expression]"
# # For ctex, use the following configuration
# executable: "xelatex -no-pdf"
# template_file: "ctex_template.tex"
# intermediate_filetype: "xdv"
universal_import_line: "from manimlib.imports import *"
style:
font: "Consolas"
background_color: "#333333"
# Set the position of preview window, you can use directions, e.g. UL/DR/OL/OO/...
# also, you can also specify the position(pixel) of the upper left corner of
# the window on the monitor, e.g. "960,540"
window_position: UR
# If break_into_partial_movies is set to True, then many small
# files will be written corresponding to each Scene.play and
# Scene.wait call, and these files will then be combined
# to form the full scene. Sometimes video-editing is made
# easier when working with the broken up scene, which
# effectively has cuts at all the places you might want.
break_into_partial_movies: False
camera_qualities:
low:
resolution: "854x480"
frame_rate: 15
medium:
resolution: "1280x720"
frame_rate: 30
high:
resolution: "1920x1080"
frame_rate: 30
ultra_high:
resolution: "3840x2160"
frame_rate: 60
default_quality: "high"

View file

@ -1,5 +1,6 @@
[metadata]
name = manimlib
version = 1.0.0
author = Grant Sanderson
author-email= grant@3blue1brown.com
summary = Animation engine for explanatory math videos
@ -8,12 +9,13 @@ description-content-type = text/markdown; charset=UTF-8
home-page = https://github.com/3b1b/manim
project_urls =
Bug Tracker = https://github.com/3b1b/manim/issues
Documentation = https://eulertour.com/learn/manim
Documentation = https://3b1b.github.io/manim/
Source Code = https://github.com/3b1b/manim
license = MIT
[files]
packages = manimlib
extra_files = requirements.txt
[entry_points]
console_scripts =