2019-02-27 02:24:14 +03:00
|
|
|
# -------------------------------------------------------------------------
|
2018-10-18 22:20:50 +03:00
|
|
|
# Copyright (c) Microsoft Corporation. All rights reserved.
|
2019-02-27 02:24:14 +03:00
|
|
|
# Licensed under the MIT License. See License.txt in the project root for
|
|
|
|
# license information.
|
|
|
|
# --------------------------------------------------------------------------
|
2018-10-18 22:20:50 +03:00
|
|
|
|
2022-08-04 22:58:57 +03:00
|
|
|
from setuptools import setup, find_namespace_packages
|
2020-03-12 00:58:18 +03:00
|
|
|
import re
|
2018-10-18 22:20:50 +03:00
|
|
|
|
2019-04-23 01:15:39 +03:00
|
|
|
# azure v0.x is not compatible with this package
|
|
|
|
# azure v0.x used to have a __version__ attribute (newer versions don't)
|
|
|
|
try:
|
|
|
|
import azure
|
|
|
|
|
|
|
|
try:
|
|
|
|
ver = azure.__version__
|
|
|
|
raise Exception(
|
|
|
|
"This package is incompatible with azure=={}. ".format(ver)
|
|
|
|
+ 'Uninstall it with "pip uninstall azure".'
|
|
|
|
)
|
|
|
|
except AttributeError:
|
|
|
|
pass
|
|
|
|
except ImportError:
|
|
|
|
pass
|
|
|
|
|
|
|
|
|
2019-02-27 22:40:03 +03:00
|
|
|
with open("README.md", "r") as fh:
|
2018-10-18 22:20:50 +03:00
|
|
|
_long_description = fh.read()
|
|
|
|
|
2020-03-12 00:58:18 +03:00
|
|
|
|
2022-08-04 22:58:57 +03:00
|
|
|
filename = "azure-iot-device/azure/iot/device/constant.py"
|
2020-03-12 00:58:18 +03:00
|
|
|
version = None
|
|
|
|
|
|
|
|
with open(filename, "r") as fh:
|
|
|
|
if not re.search("\n+VERSION", fh.read()):
|
|
|
|
raise ValueError("VERSION is not defined in constants.")
|
|
|
|
|
|
|
|
with open(filename, "r") as fh:
|
|
|
|
for line in fh:
|
|
|
|
if re.search("^VERSION", line):
|
|
|
|
constant, value = line.strip().split("=")
|
|
|
|
if not value:
|
|
|
|
raise ValueError("Value for VERSION not defined in constants.")
|
|
|
|
else:
|
2020-04-02 02:53:05 +03:00
|
|
|
# Strip whitespace and quotation marks
|
|
|
|
# Need to str convert for python 2 unicode
|
|
|
|
version = str(value.strip(' "'))
|
2020-03-12 00:58:18 +03:00
|
|
|
break
|
2019-04-23 01:15:39 +03:00
|
|
|
|
2018-10-18 22:20:50 +03:00
|
|
|
setup(
|
2019-04-16 23:12:21 +03:00
|
|
|
name="azure-iot-device",
|
2020-03-12 00:58:18 +03:00
|
|
|
version=version,
|
2019-04-16 23:12:21 +03:00
|
|
|
description="Microsoft Azure IoT Device Library",
|
2018-10-18 22:20:50 +03:00
|
|
|
license="MIT License",
|
2021-12-10 23:36:35 +03:00
|
|
|
license_files=("LICENSE",),
|
2022-11-19 03:34:55 +03:00
|
|
|
url="https://github.com/Azure/azure-iot-sdk-python/tree/v3",
|
2018-10-18 22:20:50 +03:00
|
|
|
author="Microsoft Corporation",
|
2018-11-15 00:34:26 +03:00
|
|
|
author_email="opensource@microsoft.com",
|
2018-10-18 22:20:50 +03:00
|
|
|
long_description=_long_description,
|
|
|
|
long_description_content_type="text/markdown",
|
|
|
|
classifiers=[
|
2022-11-19 03:34:55 +03:00
|
|
|
"Development Status :: 4 - Beta",
|
2018-10-18 22:20:50 +03:00
|
|
|
"Intended Audience :: Developers",
|
2018-11-15 00:34:26 +03:00
|
|
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
2019-04-17 00:05:56 +03:00
|
|
|
"License :: OSI Approved :: MIT License",
|
2019-02-27 22:40:03 +03:00
|
|
|
"Programming Language :: Python",
|
|
|
|
"Programming Language :: Python :: 3",
|
2018-10-18 22:20:50 +03:00
|
|
|
"Programming Language :: Python :: 3.7",
|
2019-11-09 02:29:05 +03:00
|
|
|
"Programming Language :: Python :: 3.8",
|
2021-12-13 22:24:43 +03:00
|
|
|
"Programming Language :: Python :: 3.9",
|
|
|
|
"Programming Language :: Python :: 3.10",
|
2022-12-04 14:10:24 +03:00
|
|
|
"Programming Language :: Python :: 3.11",
|
2018-10-18 22:20:50 +03:00
|
|
|
],
|
|
|
|
install_requires=[
|
2019-04-23 01:15:39 +03:00
|
|
|
# Define sub-dependencies due to pip dependency resolution bug
|
|
|
|
# https://github.com/pypa/pip/issues/988
|
2019-09-11 02:50:21 +03:00
|
|
|
# ---requests dependencies---
|
2019-09-11 02:53:15 +03:00
|
|
|
# requests 2.22+ does not support urllib3 1.25.0 or 1.25.1 (https://github.com/psf/requests/pull/5092)
|
2021-06-03 23:54:08 +03:00
|
|
|
# Security issue below 1.26.5
|
|
|
|
"urllib3>=1.26.5,<1.27",
|
2019-04-23 01:15:39 +03:00
|
|
|
# Actual project dependencies
|
2022-03-30 23:36:39 +03:00
|
|
|
"paho-mqtt>=1.6.1,<2.0.0",
|
2019-02-27 22:40:03 +03:00
|
|
|
"requests>=2.20.0,<3.0.0",
|
|
|
|
"requests-unixsocket>=0.1.5,<1.0.0",
|
2023-02-02 02:06:26 +03:00
|
|
|
"typing-extensions>=4.4.0,<5.0",
|
2022-02-23 02:56:57 +03:00
|
|
|
"janus",
|
2020-02-27 23:03:02 +03:00
|
|
|
"PySocks",
|
2018-10-18 22:20:50 +03:00
|
|
|
],
|
2022-12-04 14:10:24 +03:00
|
|
|
python_requires=">=3.7, <4",
|
2022-08-04 22:58:57 +03:00
|
|
|
packages=find_namespace_packages(where="azure-iot-device"),
|
|
|
|
package_dir={"": "azure-iot-device"},
|
2019-04-23 01:15:39 +03:00
|
|
|
zip_safe=False,
|
2018-10-18 22:20:50 +03:00
|
|
|
)
|