From c448ad591b59c99f79a4acb9753de965ff916818 Mon Sep 17 00:00:00 2001 From: rubenjacob Date: Thu, 8 Dec 2022 22:06:02 +0100 Subject: [PATCH] fix package data to include all xml and stl files --- setup.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 20e4f3e..2c1233b 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,6 @@ import itertools +from pathlib import Path +from typing import List from setuptools import setup, find_packages @@ -15,6 +17,16 @@ extras = { all_groups = set(extras.keys()) extras["all"] = list(set(itertools.chain.from_iterable(map(lambda group: extras[group], all_groups)))) + +def find_package_data(extensions_to_include: List[str]) -> List[str]: + envs_dir = Path("fancy_gym/envs/mujoco") + package_data_paths = [] + for extension in extensions_to_include: + package_data_paths.extend([str(path)[10:] for path in envs_dir.rglob(extension)]) + + return package_data_paths + + setup( author='Fabian Otto, Onur Celik', name='fancy_gym', @@ -39,9 +51,7 @@ setup( ], packages=[package for package in find_packages() if package.startswith("fancy_gym")], package_data={ - "fancy_gym": [ - "envs/mujoco/*/assets/*.xml", - ] + "fancy_gym": find_package_data(extensions_to_include=["*.stl", "*.xml"]) }, python_requires=">=3.7", url='https://github.com/ALRhub/fancy_gym/',