from typing import List from setuptools import setup, find_packages import os import glob import shutil import versioneer # there were issues with other builds carrying over their cache for d in glob.glob("*.egg-info"): shutil.rmtree(d) def load_requirements(path: str) -> List[str]: requirements = [] with open(path) as f: for line in f.readlines(): line = line.strip() if line.startswith("git+") or line.startswith("https:"): continue elif line.startswith("-r "): requirements += load_requirements(line[3:]) else: requirements.append(line) return requirements required_packages = load_requirements("./requirements.txt") package_data = [ os.path.relpath(path, "amulet_map_editor") for path in set( glob.glob(os.path.join("amulet_map_editor", "**", "*.*"), recursive=True) ) - set( glob.glob(os.path.join("amulet_map_editor", "**", "*.py[cod]"), recursive=True) ) ] setup( name="amulet-map-editor", version=versioneer.get_version(), description="A new Minecraft world editor and converter that supports all versions since Java 1.12 and Bedrock 1.7.", author="James Clare, Ben Gothard et al.", author_email="amuleteditor@gmail.com", install_requires=required_packages, packages=find_packages(), package_data={"amulet_map_editor": package_data}, cmdclass=versioneer.get_cmdclass(), setup_requires=required_packages, dependency_links=[ "https://github.com/Amulet-Team/Amulet-Core", "https://github.com/gentlegiantJGC/Minecraft-Model-Reader", "https://github.com/gentlegiantJGC/PyMCTranslate", "https://github.com/Amulet-Team/Amulet-NBT", ], classifiers=[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", ], python_requires=">=3.6", )