forked from colbrydi/Lithophane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
45 lines (37 loc) · 1.65 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import setuptools
from pathlib import Path
import importlib.util
def import_from_path(path):
spec = importlib.util.spec_from_file_location("module.name", path)
module = importlib.util.module_from_spec(spec)
spec.loader.exec_module(module)
return module
metadata = import_from_path(
Path(__file__).parent / "src" / "lithophane" / "metadata.py"
)
long_description = Path("README.md").read_text(encoding="utf-8").splitlines()
gif_index = long_description.index("![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/result.gif)")
long_description[gif_index] = "[![Example Lithophane](https://raw.githubusercontent.com/robbyHuelsi/lithophane/main/result.tiff)](https://github.com/robbyHuelsi/lithophane/blob/main/result.gif)"
long_description = "\n".join(long_description)
required_packaged = Path("requirements.txt").read_text().splitlines()
setuptools.setup(
name=metadata.__project_name__,
version=metadata.__version__,
author=metadata.__author__,
maintainer=metadata.__maintainer__,
maintainer_email=metadata.__email__,
url=metadata.__url__,
license=metadata.__license__,
description=metadata.__doc__,
long_description=long_description,
long_description_content_type="text/markdown",
keywords=metadata.__keywords__,
classifiers=metadata.__classifiers__,
download_url=f"{metadata.__url__}/archive/refs/tags/v{metadata.__version__}.tar.gz",
packages=setuptools.find_packages(where="src"),
package_dir={"": "src"},
include_package_data=True,
python_requires=metadata.__python_requires__,
install_requires=required_packaged,
scripts=["bin/lithophane"],
)