-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from puddly/rc
0.9.1 Release
- Loading branch information
Showing
6 changed files
with
126 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,80 +1,29 @@ | ||
"""Setup module for zigpy-zigate""" | ||
import os | ||
|
||
import pathlib | ||
|
||
from setuptools import find_packages, setup | ||
from zigpy_zigate import __version__ | ||
|
||
|
||
# extracted from https://raspberrypi.stackexchange.com/questions/5100/detect-that-a-python-program-is-running-on-the-pi | ||
def is_raspberry_pi(raise_on_errors=False): | ||
"""Checks if Raspberry PI. | ||
:return: | ||
""" | ||
try: | ||
with open('/proc/cpuinfo', 'r') as cpuinfo: | ||
found = False | ||
for line in cpuinfo: | ||
if line.startswith('Hardware'): | ||
found = True | ||
label, value = line.strip().split(':', 1) | ||
value = value.strip() | ||
if value not in ( | ||
'BCM2708', | ||
'BCM2709', | ||
'BCM2835', | ||
'BCM2836' | ||
): | ||
if raise_on_errors: | ||
raise ValueError( | ||
'This system does not appear to be a ' | ||
'Raspberry Pi.' | ||
) | ||
else: | ||
return False | ||
if not found: | ||
if raise_on_errors: | ||
raise ValueError( | ||
'Unable to determine if this system is a Raspberry Pi.' | ||
) | ||
else: | ||
return False | ||
except IOError: | ||
if raise_on_errors: | ||
raise ValueError('Unable to open `/proc/cpuinfo`.') | ||
else: | ||
return False | ||
|
||
return True | ||
|
||
|
||
requires = [ | ||
'pyserial>=3.5', | ||
'pyserial-asyncio>=0.5; platform_system!="Windows"', | ||
'pyserial-asyncio!=0.5; platform_system=="Windows"', # 0.5 broke writesv | ||
'pyusb>=1.1.0', | ||
'zigpy>=0.47.0', | ||
] | ||
|
||
if is_raspberry_pi(): | ||
requires.append('RPi.GPIO') | ||
|
||
this_directory = os.path.join(os.path.abspath(os.path.dirname(__file__))) | ||
with open(os.path.join(this_directory, "README.md"), encoding="utf-8") as f: | ||
long_description = f.read() | ||
|
||
setup( | ||
name="zigpy-zigate", | ||
version=__version__, | ||
description="A library which communicates with ZiGate radios for zigpy", | ||
long_description=long_description, | ||
long_description=(pathlib.Path(__file__).parent / "README.md").read_text(), | ||
long_description_content_type="text/markdown", | ||
url="http://github.com/zigpy/zigpy-zigate", | ||
author="Sébastien RAMAGE", | ||
author_email="[email protected]", | ||
license="GPL-3.0", | ||
packages=find_packages(exclude=['tests']), | ||
install_requires=requires, | ||
install_requires=[ | ||
'pyserial>=3.5', | ||
'pyserial-asyncio>=0.5; platform_system!="Windows"', | ||
'pyserial-asyncio!=0.5; platform_system=="Windows"', # 0.5 broke writes | ||
'pyusb>=1.1.0', | ||
'zigpy>=0.47.0', | ||
'gpiozero', | ||
], | ||
tests_require=[ | ||
'pytest', | ||
'pytest-asyncio', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
MAJOR_VERSION = 0 | ||
MINOR_VERSION = 9 | ||
PATCH_VERSION = '0' | ||
PATCH_VERSION = '1' | ||
__short_version__ = '{}.{}'.format(MAJOR_VERSION, MINOR_VERSION) | ||
__version__ = '{}.{}'.format(__short_version__, PATCH_VERSION) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.