-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup.py
62 lines (51 loc) · 1.9 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
from setuptools import setup
from setuptools.extension import Extension
from Cython.Build import cythonize
import sys
with open('pytempsense/__init__.py', 'r') as f:
for line in f:
if line.find("__version__") >= 0:
version = line.split("=")[1].strip()
version = version.strip('"')
version = version.strip("'")
break
ext_modules = cythonize([Extension('pytempsense.bme280api',
['pytempsense/bme280driver/bme280.c',
'pytempsense/bme280driver/bme280_helper.c',
'pytempsense/bme280api.pyx'],
extra_compile_args=['-std=gnu11']
)
])
open_kwds = {}
if sys.version_info > (3,):
open_kwds['encoding'] = 'utf-8'
with open('VERSION.txt', 'w', **open_kwds) as f:
f.write(version)
with open('README.md', **open_kwds) as f:
readme = f.read()
setup_args = dict(
metadata_version='1.2',
name='pytempsense',
version=version,
requires_python='>=2.7',
description="pytempsense allows to access BME280 sensors over I2C on Raspberry Pi's",
license='MIT',
keywords='BME280 raspberry pi',
author='Rene Buffat',
author_email='buffat@gmail.com',
maintainer='Rene Buffat',
maintainer_email='buffat@gmail.com',
url='https://github.com/rbuffat/pytempsense',
long_description=readme + "\n",
package_dir={'': '.'},
packages=['pytempsense'],
ext_modules=ext_modules,
classifiers=[
'Development Status :: 3 - Alpha',
'Intended Audience :: Developers',
'Intended Audience :: Education',
'License :: OSI Approved :: MIT License',
'Operating System :: POSIX :: Linux',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 3'])
setup(**setup_args)