-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
107 lines (93 loc) · 3.35 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
# -*- coding:utf-8 -*-
import os
import sys
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
#: to build a pure .so or .dll file to be used within ctypes
class CTypes(Extension):
pass
class build_ctypes_ext(build_ext):
def get_libraries(self, ext):
self._ctypes = isinstance(ext, CTypes)
return super().get_libraries(ext)
def build_extension(self, ext):
self._ctypes = isinstance(ext, CTypes)
return super().build_extension(ext)
def get_export_symbols(self, ext):
if self._ctypes:
return ext.export_symbols
return super().get_export_symbols(ext)
def get_ext_filename(self, ext_name):
if getattr(self, "_ctypes", False):
return ext_name.replace(".", os.sep) + (
'.dll' if sys.platform.startswith("win") else '.so'
)
return super().get_ext_filename(ext_name)
version = open("./VERSION", "r")
long_description = open("./README.md", "r")
kw = {
"version": version.read().strip(),
"name": "EPSGlide",
"keywords": [
"epsg", "projection", "great", "circle", "geohash", "georef", "GARS",
"maidenhead", "dataset"
],
"author": "Bruno THOORENS",
"author_email": "[email protected]",
"maintainer": "Bruno THOORENS",
"maintainer_email": "[email protected]",
"url": "https://moustikitos.github.io/python-epsg/",
"project_urls": { # Optional
"Bug Reports": "https://github.com/Moustikitos/python-epsg/issues",
"Funding": "https://github.com/Moustikitos/python-epsg?tab=readme-ov-file#support-this-project",
"Source": "https://github.com/Moustikitos/python-epsg/",
},
# "download_url": "TODO",
"description":
"Efficient great circle computation and projection library "
"with access to EPSG dataset public API",
"long_description": long_description.read(),
"long_description_content_type": "text/markdown",
"packages": ["epsglide"],
"include_package_data": True,
"ext_modules": [
CTypes(
'epsglide.geoid',
extra_compile_args=[],
include_dirs=['src/'],
sources=[
"src/geoid.c"
]
),
CTypes(
'epsglide.proj',
extra_compile_args=[],
include_dirs=['src/'],
sources=[
"src/tmerc.c",
"src/miller.c",
"src/eqc.c",
"src/merc.c",
"src/lcc.c"
]
)
],
"cmdclass": {"build_ext": build_ctypes_ext},
"license": "Copyright 2024, THOORENS Bruno, BSD licence",
"classifiers": [
"Development Status :: 3 - Alpha",
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: BSD License',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX :: Linux',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Topic :: Scientific/Engineering :: GIS',
'Topic :: Software Development :: Libraries :: Python Modules',
],
}
long_description.close()
version.close()
setup(**kw)