Repository navigation
Expand file tree
/
Copy pathsetup.py
More file actions
125 lines (108 loc) · 5.51 KB
/
Copy pathsetup.py
File metadata and controls
125 lines (108 loc) · 5.51 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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# SPDX-FileCopyrightText: 2022 CEA LIST <gael.de-chalendar@cea.fr>
#
# SPDX-License-Identifier: MIT
import os
import sys
from skbuild import setup # This line replaces 'from setuptools import setup'
main_ns = {}
ver_path = os.path.join('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}"
cmake_args = ['-DCMAKE_BUILD_TYPE=RelWithDebInfo', '-DCMAKE_GENERATOR=Ninja']
if sys.platform.startswith("linux"):
# The manylinux build image's Python (elsewhere, CMake finds the Python
# running this script)
cmake_args += [f"-DPython3_INCLUDE_DIR={include_dir}",
f"-DPython3_LIBRARY={library_dir}"]
else:
cmake_args += [f"-DPython3_EXECUTABLE={sys.executable}"]
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",
"Documentation": "https://aymara.github.io/lima/"
},
classifiers=[
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: 3.15",
"License :: OSI Approved :: MIT License",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Operating System :: MacOS",
],
# The same for all the wheels of a version: PyPI keeps one Requires-Python
# per version, the first uploaded wheel's (0.7.0 got >=3.10 from the
# manylinux_2_34 wheel and was hidden from Python 3.9). Each wheel's
# cp3x-abi3 tag already restricts it to its own Pythons
python_requires=">=3.9",
packages=['aymara', 'aymaralima'],
install_requires=[
'pip>=22.0',
'pyconll',
f'shiboken6=={QT_FULL_VERSION}',
'tqdm',
],
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', f'shiboken6=={QT_FULL_VERSION}'],
cmake_args=cmake_args,
scripts=['aymara/lima_models.py', 'aymara/deeplima_models.py', 'aymara/lima.py', ],
extras_require={
'spacy': ['spacy>=3.7,<4'],
},
entry_points={
# spaCy configs find the LIMA tokenizer without importing aymara first
'spacy_tokenizers': [
'aymara.LimaTokenizer.v1 = aymara.lima_spacy:create_tokenizer',
],
'console_scripts': [
'lima = aymara.lima:main',
'lima_models = aymara.lima_models:main',
'deeplima_models = aymara.deeplima_models:main',
]
},
)