-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup.py
41 lines (36 loc) · 1.25 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
import re
import os
import setuptools
import sht20
with open("README.md", "r") as fh:
long_description = fh.read()
def read_file(path):
with open(os.path.join(os.path.dirname(__file__), path)) as fp:
return fp.read()
def _get_version_match(content):
# Search for lines of the form: # __version__ = 'ver'
regex = r"^__version__ = ['\"]([^'\"]*)['\"]"
version_match = re.search(regex, content, re.M)
if version_match:
return version_match.group(1)
raise RuntimeError("Unable to find version string.")
def get_version(path):
return _get_version_match(read_file(path))
setuptools.setup(
name="sht20",
version=get_version(os.path.join('sht20', '__init__.py')),
scripts=['bin/run-sht20'],
author="Feyzi Kesim",
author_email="[email protected]",
description="Python3 I2C Driver & Application for SHT20 Temperature & Humidity Sensor",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/feyzikesim/sht20",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.6',
)