Skip to content
This repository was archived by the owner on Nov 12, 2019. It is now read-only.

Commit 30ef6ef

Browse files
author
Brennen Bearnes
committed
Merge branch 'master' of git://github.com/samjetski/Adafruit_Python_DHT into samjetski-master
2 parents a609d7d + 9588744 commit 30ef6ef

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

MANIFEST.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
include README.md
2+
recursive-include source *

setup.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,32 @@
77
pass
88

99
from setuptools import setup, find_packages, Extension
10+
import os
1011
import sys
1112

1213
import Adafruit_DHT.platform_detect as platform_detect
1314

1415

16+
BINARY_COMMANDS = [
17+
'build_ext',
18+
'build_clib',
19+
'bdist',
20+
'bdist_dumb',
21+
'bdist_rpm',
22+
'bdist_wininst',
23+
'bdist_wheel',
24+
'install'
25+
]
26+
27+
28+
def is_binary_install():
29+
do_binary = [command for command in BINARY_COMMANDS if command in sys.argv]
30+
return len(do_binary) > 0
31+
32+
33+
def read(fname):
34+
return open(os.path.join(os.path.dirname(__file__), fname)).read()
35+
1536
# Check if an explicit platform was chosen with a command line parameter.
1637
# Kind of hacky to manipulate the argument list before calling setup, but it's
1738
# the best simple option for adding optional config to the setup.
@@ -37,7 +58,9 @@
3758

3859
# Pick the right extension to compile based on the platform.
3960
extensions = []
40-
if platform == platform_detect.RASPBERRY_PI:
61+
if not is_binary_install():
62+
print('Skipped loading platform-specific extensions for Adafruit_DHT (we are generating a cross-platform source distribution).')
63+
elif platform == platform_detect.RASPBERRY_PI:
4164
# Get the Pi version (1 or 2)
4265
if pi_version is None:
4366
pi_version = platform_detect.pi_version()
@@ -87,6 +110,7 @@
87110
author = 'Tony DiCola',
88111
author_email = 'tdicola@adafruit.com',
89112
description = 'Library to get readings from the DHT11, DHT22, and AM2302 humidity and temperature sensors on a Raspberry Pi or Beaglebone Black.',
113+
long_description = read('README.md'),
90114
license = 'MIT',
91115
classifiers = classifiers,
92116
url = 'https://github.com/adafruit/Adafruit_Python_DHT/',

0 commit comments

Comments
 (0)