|
1 | | -""" |
2 | | -Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. |
3 | | -""" |
4 | | - |
5 | 1 | import os |
6 | 2 | import platform |
7 | 3 | from subprocess import check_call, check_output |
8 | | -from setuptools import Extension, find_packages, setup |
| 4 | +from setuptools import Extension, setup |
9 | 5 |
|
10 | 6 | def get_curl_extra_linker_flags(): |
11 | 7 | if platform.system() != "Linux" or os.getenv("BUILD") != "true": |
12 | 8 | return [] |
13 | 9 | check_call(["./scripts/preinstall.sh"]) |
14 | 10 | cmd = ["./deps/artifacts/bin/curl-config", "--static-libs"] |
15 | | - curl_config = check_output(cmd).decode("utf-8").replace("\n", "") |
16 | | - flags = curl_config.split(" ")[1:] |
17 | | - return flags |
| 11 | + curl_config = check_output(cmd).decode("utf-8").strip() |
| 12 | + return curl_config.split(" ")[1:] |
18 | 13 |
|
19 | 14 | def get_runtime_client_extension(): |
20 | 15 | if platform.system() != "Linux" and os.getenv("BUILD") != "true": |
21 | | - print("The native runtime_client only builds on Linux. Skipping its compilation.") |
| 16 | + print("Native extension build skipped on non-Linux.") |
22 | 17 | return [] |
23 | | - runtime_client = Extension( |
| 18 | + return [Extension( |
24 | 19 | "runtime_client", |
25 | 20 | ["awslambdaric/runtime_client.cpp"], |
26 | 21 | extra_compile_args=["--std=c++11"], |
27 | 22 | library_dirs=["deps/artifacts/lib", "deps/artifacts/lib64"], |
28 | 23 | libraries=["aws-lambda-runtime", "curl"], |
29 | 24 | extra_link_args=get_curl_extra_linker_flags(), |
30 | 25 | include_dirs=["deps/artifacts/include"], |
31 | | - ) |
32 | | - return [runtime_client] |
33 | | - |
34 | | -def readme(): |
35 | | - try: |
36 | | - with open("README.md", encoding="utf-8") as f: |
37 | | - return f.read() |
38 | | - except Exception: |
39 | | - return "" |
| 26 | + )] |
40 | 27 |
|
41 | 28 | setup( |
42 | | - name="awslambdaric", |
43 | | - version="3.0.2", |
44 | | - description="AWS Lambda Runtime Interface Client for Python", |
45 | | - long_description=readme(), |
46 | | - long_description_content_type="text/markdown", |
47 | | - author="Amazon Web Services", |
48 | | - url="https://github.com/aws/aws-lambda-python-runtime-interface-client", |
49 | | - packages=find_packages(exclude=("tests", "tests.*", "docs", "examples", "versions")), |
50 | | - python_requires=">=3.9", |
51 | | - install_requires=[ |
52 | | - "simplejson>=3.20.1", |
53 | | - "snapshot-restore-py>=1.0.0", |
54 | | - ], |
55 | | - classifiers=[ |
56 | | - "Development Status :: 5 - Production/Stable", |
57 | | - "Intended Audience :: Developers", |
58 | | - "Natural Language :: English", |
59 | | - "Programming Language :: Python :: 3", |
60 | | - "Programming Language :: Python :: 3.9", |
61 | | - "Programming Language :: Python :: 3.10", |
62 | | - "Programming Language :: Python :: 3.11", |
63 | | - "Programming Language :: Python :: 3.12", |
64 | | - "Programming Language :: Python :: 3.13", |
65 | | - "License :: OSI Approved :: Apache Software License", |
66 | | - "Operating System :: OS Independent", |
67 | | - ], |
68 | 29 | ext_modules=get_runtime_client_extension(), |
69 | | - test_suite="tests", |
70 | 30 | ) |
0 commit comments