diff --git a/matcha/utils/rich_utils.py b/matcha/utils/rich_utils.py index f602f6e..1f1d6fe 100644 --- a/matcha/utils/rich_utils.py +++ b/matcha/utils/rich_utils.py @@ -72,7 +72,7 @@ def print_config_tree( # save config tree to file if save_to_file: - with open(Path(cfg.paths.output_dir, "config_tree.log"), "w") as file: + with open(Path(cfg.paths.output_dir, "config_tree.log"), "w", encoding="utf-8") as file: rich.print(tree, file=file) @@ -97,5 +97,5 @@ def enforce_tags(cfg: DictConfig, save_to_file: bool = False) -> None: log.info(f"Tags: {cfg.tags}") if save_to_file: - with open(Path(cfg.paths.output_dir, "tags.log"), "w") as file: + with open(Path(cfg.paths.output_dir, "tags.log"), "w", encoding="utf-8") as file: rich.print(cfg.tags, file=file) diff --git a/setup.py b/setup.py index a49c2cc..f9fd37e 100644 --- a/setup.py +++ b/setup.py @@ -16,9 +16,14 @@ with open("README.md", encoding="utf-8") as readme_file: README = readme_file.read() cwd = os.path.dirname(os.path.abspath(__file__)) -with open(os.path.join(cwd, "matcha", "VERSION")) as fin: +with open(os.path.join(cwd, "matcha", "VERSION"), encoding="utf-8") as fin: version = fin.read().strip() +def get_requires(): + requirements = os.path.join(os.path.dirname(__file__), "requirements.txt") + with open(requirements, encoding="utf-8") as reqfile: + return [str(r).strip() for r in reqfile] + setup( name="matcha-tts", version=version, @@ -28,7 +33,7 @@ setup( author="Shivam Mehta", author_email="shivam.mehta25@gmail.com", url="https://shivammehta25.github.io/Matcha-TTS", - install_requires=[str(r) for r in open(os.path.join(os.path.dirname(__file__), "requirements.txt"))], + install_requires=get_requires(), include_dirs=[numpy.get_include()], include_package_data=True, packages=find_packages(exclude=["tests", "tests/*", "examples", "examples/*"]),