-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathsetup.py
63 lines (54 loc) · 2.19 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
from setuptools import setup
import os
import sys
ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
try:
import arcpy
include_package_data = True
except ImportError:
if ON_RTD: # if we're on read-the-docs, then we need to mock out arcpy, otherwise raise the exception
class Mock(object):
def __init__(self, *args, **kwargs):
pass
def __call__(self, *args, **kwargs):
return Mock()
@classmethod
def __getattr__(cls, name):
if name in ('__file__', '__path__'):
return '/dev/null'
elif name[0] == name[0].upper():
mockType = type(name, (), {})
mockType.__module__ = __name__
return mockType
else:
return Mock()
MOCK_MODULES = ['arcpy']
for mod_name in MOCK_MODULES:
sys.modules[mod_name] = Mock()
include_package_data = False
else:
raise
try:
from amaptor.version import __version__, __author__
except RuntimeError: # added so it can be installed with setup.py develop when signed in as an admin that's not signed into Portal in ArcGIS Pro
__version__ = "0.1.2.5"
__author__ = "nickrsan"
setup(name="amaptor",
version=__version__,
description="A compatibility layer (or adaptor) for mapping functions in ArcGIS 10.x (arcpy.mapping/Python 2) and"
" ArcGIS Pro (arcpy.mp/Python 3)",
long_description="""This library is an abstraction layer, with its own classes, to access mapping functions, regardless
of which version of ArcGIS you are using. Think of it as the "six" package, but for arcpy.mapping/arcpy.mp. If you
write your mapping code against this pacakge, it will work no matter which version of ArcGIS your end users are
running. In general, the API adheres closely to the ArcGIS Pro api, since that has a cleaner, object-oriented design,
but it may included differences. Further, methods are lowercased and underscored instead of camelcased, partially to
make it easy to see at a glance that it's not the same code, and partially due to author preference.
Documentation can be found at http://amaptor.readthedocs.io
""",
packages=['amaptor', 'amaptor.classes', ],
requires=["arcpy"],
author=__author__,
author_email="[email protected]",
url='https://github.com/ucd-cws/amaptor',
include_package_data=include_package_data,
)