File: setup.py

package info (click to toggle)
lerc 4.0.0%2Bds-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,000 kB
  • sloc: cpp: 9,022; python: 656; makefile: 33
file content (49 lines) | stat: -rw-r--r-- 1,701 bytes parent folder | download | duplicates (2)
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
46
47
48
49
import setuptools
import os

from glob import glob
from os.path import basename, exists, join, getmtime
from shutil import copyfile

dir_path = os.path.dirname(os.path.realpath(__file__))
readme_path = os.path.join(dir_path, "..", "..", "README.md")

try:
    with open(readme_path, "r") as fh:
        long_description = fh.read()
except Exception:
    long_description = "Limited Error Raster Compression"

# Using MANIFEST.in doesn't respect relative paths above the package root.
# Instead, inspect the location and copy in the binaries if newer.
BINARY_TYPES = ["*.dll", "*.lib", "*.so*", "*.dylib"]
PLATFORMS = ["Linux", "MacOS", "windows"]
for platform in PLATFORMS:
    platform_dir = join("..", "..", "bin", platform)
    for ext in BINARY_TYPES:
        input_binaries = glob(join(platform_dir, ext))
        for input_binary in input_binaries:
            output_binary = join("lerc", basename(input_binary))
            if not exists(output_binary) or getmtime(input_binary) > getmtime(output_binary):
                copyfile(input_binary, output_binary)

setuptools.setup(
    name="lerc",
    version="4.0",
    author="esri",
    author_email="python@esri.com",
    description="Limited Error Raster Compression",
    # long_description=long_description,
    # long_description_content_type="text/markdown",
    license="Apache 2",
    url="https://github.com/Esri/lerc",
    packages=setuptools.find_packages(),
    classifiers=[
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: Apache Software License",
        "Operating System :: OS Independent",
    ],
    package_data={"lerc": BINARY_TYPES},
    python_requires=">=3.6",
    zip_safe=False,
)