Skip to content
This repository was archived by the owner on Jun 7, 2021. It is now read-only.

Commit 5ec7394

Browse files
author
Joel Collins
committed
Removed Python 2 support
1 parent f151293 commit 5ec7394

4 files changed

Lines changed: 25 additions & 40 deletions

File tree

.github/workflows/build.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ jobs:
1414
strategy:
1515
matrix:
1616
python-version: [
17-
2.7,
1817
3.5,
1918
3.6,
2019
3.7,

README.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ webthing
88
.. image:: https://img.shields.io/badge/license-MPL--2.0-blue.svg
99
:target: https://github.com/mozilla-iot/webthing-python/blob/master/LICENSE.txt
1010

11-
Implementation of an HTTP `Web Thing <https://iot.mozilla.org/wot/>`_. This library is compatible with Python 2.7 and 3.5+.
11+
Implementation of an HTTP `Web Thing <https://iot.mozilla.org/wot/>`_. This library is compatible with Python 3.5+.
1212

1313
Installation
1414
============
@@ -138,23 +138,23 @@ Then we create and add the appropriate property.
138138

139139
Contrary to the light, the value cannot be set via an API call, as it wouldn't make much sense, to SET what a sensor is reading. Therefore, we are creating a **readOnly** property.
140140

141-
.. code:: python
142-
143-
sensor.add_property(
144-
Property(
145-
sensor,
146-
'level',
147-
readproperty=self.read_from_gpio,
148-
metadata={
149-
'@type': 'LevelProperty',
150-
'title': 'Humidity',
151-
'type': 'number',
152-
'description': 'The current humidity in %',
153-
'minimum': 0,
154-
'maximum': 100,
155-
'unit': 'percent',
156-
'readOnly': True,
157-
}))
141+
.. code:: python
142+
143+
sensor.add_property(
144+
Property(
145+
sensor,
146+
'level',
147+
readproperty=self.read_from_gpio,
148+
metadata={
149+
'@type': 'LevelProperty',
150+
'title': 'Humidity',
151+
'type': 'number',
152+
'description': 'The current humidity in %',
153+
'minimum': 0,
154+
'maximum': 100,
155+
'unit': 'percent',
156+
'readOnly': True,
157+
}))
158158
159159
In this example, we pass a `readproperty` method that will read and return the sensor value every time it is requested.
160160

requirements.txt

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
ifaddr>=0.1.0
2-
jsonschema==2.6.*; python_version == '2.7'
3-
jsonschema>=3.2.0; python_version >= '3.5'
2+
jsonschema>=3.2.0
43
pyee>=7.0.0
5-
tornado==5.1.*; python_version == '2.7'
6-
tornado>=6.0.0; python_version >= '3.5'
7-
zeroconf==0.19.*; python_version == '2.7'
8-
zeroconf>=0.27.0; python_version >= '3.5'
4+
tornado>=6.0.0
5+
zeroconf>=0.27.0

setup.py

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,11 @@
1515
requirements = [
1616
'ifaddr>=0.1.0',
1717
'pyee>=7.0.0',
18+
'jsonschema>=3.2.0',
19+
'tornado>=6.0.0',
20+
'zeroconf>=0.27.0',
1821
]
1922

20-
if sys.version_info.major == 2:
21-
requirements.extend([
22-
'jsonschema==2.6.*',
23-
'tornado==5.1.*',
24-
'zeroconf==0.19.*',
25-
])
26-
elif sys.version_info.major == 3:
27-
requirements.extend([
28-
'jsonschema>=3.2.0',
29-
'tornado>=6.0.0',
30-
'zeroconf>=0.27.0',
31-
])
32-
3323
setup(
3424
name='webthing',
3525
version='0.13.2',
@@ -45,7 +35,6 @@
4535
'Development Status :: 4 - Beta',
4636
'Intended Audience :: Developers',
4737
'License :: OSI Approved :: Mozilla Public License 2.0 (MPL 2.0)',
48-
'Programming Language :: Python :: 2.7',
4938
'Programming Language :: Python :: 3.5',
5039
'Programming Language :: Python :: 3.6',
5140
'Programming Language :: Python :: 3.7',
@@ -56,5 +45,5 @@
5645
'Source': 'https://github.com/mozilla-iot/webthing-python',
5746
'Tracker': 'https://github.com/mozilla-iot/webthing-python/issues',
5847
},
59-
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
48+
python_requires='!=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
6049
)

0 commit comments

Comments
 (0)