Skip to content

Commit

Permalink
CPython: Fix HTTP telemetry
Browse files Browse the repository at this point in the history
  • Loading branch information
amotl committed Jul 28, 2021
1 parent c02123d commit 21745da
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,14 @@ Terkin Datalogger CHANGES

in progress
===========


2021-07-28 0.12.0
=================
- Documentation: Fix build and update to Sphinx 4
- CPython: Don't enable modeserver in example configuration blueprints
- Sensors: Implement temperature compensation for HX711 sensors. Thanks, @WSt89!
- CPython: Fix HTTP telemetry


2021-07-26 0.11.4
Expand Down
9 changes: 6 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,15 @@
# 3rd-party libraries
'terkin-micropython-libraries==0.11.4',

# Runtime
# Mocks some HAL modules not available on CPython.
'mock==4.0.2',
'esp32-machine-emulator==1.1.3',

# Sensors
'psutil<=5.8.0,<6',

# Mocks some HAL modules not available on CPython.
'esp32-machine-emulator==1.1.3',
# Telemetry
'requests',

# Command line interface
'click==7.1.2',
Expand Down
13 changes: 2 additions & 11 deletions setup_libraries.py
Original file line number Diff line number Diff line change
@@ -1,15 +1,6 @@
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages

requires = [
'pycopy-cpython-micropython==1.0',
'pycopy-cpython-usocket==0.1',
'pycopy-cpython-uio==0.3',
]

extras = {
}

setup(name='terkin-micropython-libraries',
version='0.11.4',
description='Terkin MicroPython runtime libraries',
Expand Down Expand Up @@ -71,8 +62,8 @@
},
zip_safe=False,
test_suite='test',
install_requires=requires,
extras_require=extras,
install_requires=[],
extras_require={},
#tests_require=extras['test'],
dependency_links=[
],
Expand Down
13 changes: 11 additions & 2 deletions src/lib/terkin_cpython/compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,23 @@ def ticks_diff(ticks1, ticks2):
time.ticks_diff = ticks_diff
sys.modules['utime'] = time

sys.modules['micropython'] = Mock()
sys.modules['micropython'].const = int

import io
sys.modules['uio'] = io

import os
sys.modules['uos'] = os

sys.modules['micropython'] = Mock()
sys.modules['micropython'].const = int
import ssl
sys.modules['ussl'] = ssl

import socket
sys.modules['usocket'] = socket

import requests
sys.modules['urequests'] = requests

import gc
import psutil
Expand Down

0 comments on commit 21745da

Please sign in to comment.