-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
105 lines (90 loc) · 4.58 KB
/
setup.py
File metadata and controls
105 lines (90 loc) · 4.58 KB
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
# SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
#
# SPDX-License-Identifier: MIT
import os
import sys
from distutils.util import convert_path
from skbuild import setup # This line replaces 'from setuptools import setup'
main_ns = {}
ver_path = convert_path('aymara/version.py')
with open(ver_path) as ver_file:
exec(ver_file.read(), main_ns)
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
# The environment variable below must be defined. Fail if not
QT_FULL_VERSION = os.environ["QT_FULL_VERSION"]
PYTHON_VERSION = os.environ.get("PYTHON_VERSION", "3.8")
PYTHON_SHORT_VERSION = os.environ.get("PYTHON_SHORT_VERSION", "cp38-cp38")
PYTHON_FULL_VERSION = os.environ.get("PYTHON_FULL_VERSION", "3.8.12")
include_dir = f"/opt/python/{PYTHON_SHORT_VERSION}/include/python{PYTHON_VERSION}"
if PYTHON_VERSION == "3.6" or PYTHON_VERSION == "3.7":
include_dir = f"/opt/python/{PYTHON_SHORT_VERSION}/include/python{PYTHON_VERSION}m"
library_dir = f"/opt/python/{PYTHON_SHORT_VERSION}/lib/python{PYTHON_VERSION}"
def package_files(directory):
paths = []
for (path, directories, filenames) in os.walk(directory):
for filename in filenames:
paths.append(os.path.join(path, filename))
return paths
print(f"PYTHON_VERSION: {PYTHON_VERSION}", file=sys.stderr)
print(f"PYTHON_SHORT_VERSION: {PYTHON_SHORT_VERSION}", file=sys.stderr)
print(f"PYTHON_FULL_VERSION: {PYTHON_FULL_VERSION}", file=sys.stderr)
setup(
name="aymara",
version=main_ns['__version__'],
author="Gaël de Chalendar",
author_email="gael.de-chalendar@cea.fr",
description="Python bindings to the LIMA linguistic analyzer",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/aymara/lima",
project_urls={
"Bug Tracker": "https://github.com/aymara/lima/issues",
"Wiki": "https://github.com/aymara/lima/wiki"
},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
],
python_requires=f">={PYTHON_VERSION}",
packages=['aymara', 'aymaralima'],
install_requires=[
'pip>=22.0',
'pyconll',
'pydantic',
'requests',
f'shiboken6=={QT_FULL_VERSION}',
'tqdm',
'unix_ar',
],
include_package_data=True,
# A dictionary mapping package names to lists of glob patterns. For a complete description and examples, see the setuptools documentation section on Including Data Files. You do not need to use this option if you are using include_package_data, unless you need to add e.g. files that are generated by your setup script and build process. (And are therefore not in source control or are files that you don’t want to include in your source distribution.)
#package_data={'aymaralima': extra_files},
#package_data={},
# Dictionary mapping package names to lists of glob patterns that should be excluded from the package directories. You can use this to trim back any excess files included by include_package_data. For a complete description and examples, see the setuptools documentation section on Including Data Files.
exclude_package_data={},
# Sequence of (directory, files) pairs. Each (directory, files) pair in the sequence specifies the installation directory and the files to install there. More details in the Installing Additional Files section of the setuptools documentation.
#data_files=[('aymaralima', extra_files)],
#data_files=[('aymaralima', ['aymaralima/lima_models.py', 'aymaralima/lima.py'])],
# cmake_install_dir= 'aymara/',
cmake_minimum_required_version='3.15',
setup_requires=['cmake', 'pytest', 'pytest-cov', 'pytest-runner', 'pytest-depends'],
tests_require=['pytest', 'pytest-cov', 'pytest-depends', 'sphinx-test-reports',
'pyconll', 'pydantic', f'shiboken6=={QT_FULL_VERSION}'],
cmake_args=['-DCMAKE_BUILD_TYPE=RelWithDebInfo',
'-DCMAKE_GENERATOR=Ninja',
f"-DPython3_INCLUDE_DIR={include_dir}",
f"-DPython3_LIBRARY={library_dir}"],
scripts=['aymara/lima_models.py', 'aymara/deeplima_models.py', 'aymara/lima.py', ],
entry_points={
'console_scripts': [
'lima = aymara.lima:main',
'lima_models = aymara.lima_models:main',
'deeplima_models = aymara.deeplima_models:main',
]
},
)