From bfa50d043ab6e318d7e2fb6545f18e7236b8100b Mon Sep 17 00:00:00 2001 From: "k.y" Date: Sun, 12 Dec 2021 20:05:19 +0800 Subject: [PATCH] version bump to 0.5.0 --- examples/Geo/bezier.py | 17 ++++++++++++++++- manim_express/__init__.py | 4 +++- setup.py | 36 +----------------------------------- tools.py | 1 - workflow.py | 3 +++ 5 files changed, 23 insertions(+), 38 deletions(-) diff --git a/examples/Geo/bezier.py b/examples/Geo/bezier.py index 0d1d2c4..c55bd77 100644 --- a/examples/Geo/bezier.py +++ b/examples/Geo/bezier.py @@ -1,3 +1,5 @@ +import numpy as np + from examples.example_imports import * from manim_express import * from sparrow import clamp @@ -69,10 +71,23 @@ def clip1(self): self.play(self._value_tracker.increment_value, 1, run_time=5, rate_func=smooth) self.wait(0.5) + def clip2(self): + x = np.linspace(0, 1, 100) + # self.plot(x, [smooth(i) for i in x]) + # self.plot(x, [double_smooth(i) for i in x]) + # self.plot(x, [lingering(i) for i in x]) + self.plot(x, [exponential_decay(i) for i in x]) + self.plot(x, [wiggle(i) for i in x]) + self.show_plot() + self.hold_on() + + + # CONFIG.write_file = True # CONFIG.gif = True # CONFIG.color = WHITE bezier = Bazier() -bezier.render() +# bezier.render() +bezier.clip2() diff --git a/manim_express/__init__.py b/manim_express/__init__.py index 3dbb1d8..071ca05 100644 --- a/manim_express/__init__.py +++ b/manim_express/__init__.py @@ -3,9 +3,11 @@ from .points import * from sparrow.file_ops import yaml_load, ppath from sparrow.color_str import rgb_string +import pkg_resources plan_root_path = __file__ _version_config = yaml_load(ppath("version-config.yaml", __file__)) -__version__= _version_config['version'] +__version__ = pkg_resources.get_distribution(_version_config['name']).version + print(f"{rgb_string(_version_config['name'], color='#34A853')} version: {rgb_string(__version__, color='#C9E8FF')}") diff --git a/setup.py b/setup.py index 30ead0b..2e20868 100644 --- a/setup.py +++ b/setup.py @@ -1,51 +1,17 @@ #!/usr/bin/env python from __future__ import print_function -from setuptools import setup, find_packages -from glob import glob -import os -from sparrow.file_ops import yaml_load +from setuptools import setup pkgname = "manim_express" pkgdir = pkgname -version_config = yaml_load(os.path.join(pkgdir, "version-config.yaml")) -name, version = version_config['name'], version_config['version'] -# -# with open(glob('requirements.txt')[0], encoding='utf-8') as f: -# all_reqs = f.read().split('\n') -# install_requires = [x.strip() for x in all_reqs] -# -# with open("README.md", "r", encoding='utf-8') as fr: -# long_description = fr.read() setup( setup_requires=['pbr>=1.9', 'setuptools>=17.1'], pbr=True, - # name=name, - # version=version, package_data={ pkgdir: [ '*.yaml', '*.yml', ], }, - # description=" Animation engine for explanatory math videos", - # long_description=long_description, - # long_description_content_type="text/markdown", - # author="K.y", - # author_email="beidongjiedeguang@gmail.com", - # url="https://github.com/beidongjiedeguang/manim-express", - # license="MIT", - # install_requires=install_requires, - # classifiers=[ - # 'Operating System :: OS Independent', - # 'Intended Audience :: Developers', - # 'Intended Audience :: Science/Research', - # 'Topic :: Scientific/Engineering :: Artificial Intelligence', - # "Programming Language :: Python :: 3", - # "Programming Language :: Python :: 3.8", - # ], - # keywords=[ - # 'Computer Vision', 'Mathematics', 'Physics', 'Machine Learning', 'Neural Networks', - # ], - # packages=find_packages() ) diff --git a/tools.py b/tools.py index fd6f43c..dc037b3 100644 --- a/tools.py +++ b/tools.py @@ -20,7 +20,6 @@ def update_requirements(): def update_setup_cfg(): verson_config = yaml_load('./manim_express/version-config.yaml') pkg_name = verson_config.get('name') - version_str = verson_config.get('version') with open('setup.cfg', 'r', encoding='utf8') as fio: lines = fio.readlines() break_flag = 2 diff --git a/workflow.py b/workflow.py index d146405..35145ba 100644 --- a/workflow.py +++ b/workflow.py @@ -1,3 +1,5 @@ +import os + from sparrow.version_ops import VersionControl from tools import update_requirements, update_setup_cfg @@ -7,6 +9,7 @@ vc.update_version() update_setup_cfg() +os.system(f"git tag {vc.config['version']}") # To keep manimlib latest. update_requirements() vc.update_readme(readme_path="./README.md", license="MIT")