62 lines
1.9 KiB
Python
Raw Permalink Normal View History

2020-11-14 15:16:13 +00:00
from typing import List
2020-11-14 14:35:01 +00:00
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)
2020-11-14 15:16:13 +00:00
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
2020-11-14 14:35:01 +00:00
2020-11-14 15:16:13 +00:00
required_packages = load_requirements("./requirements.txt")
2020-11-14 14:35:01 +00:00
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)
2020-11-14 14:35:01 +00:00
)
]
setup(
name="amulet-map-editor",
version=versioneer.get_version(),
2020-11-14 15:16:13 +00:00
description="A new Minecraft world editor and converter that supports all versions since Java 1.12 and Bedrock 1.7.",
2020-11-14 14:35:01 +00:00
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",
2020-11-14 14:35:01 +00:00
)