Tweaks, fixes, linting and docs

This commit is contained in:
Phil Howard
2020-08-27 12:26:08 +01:00
parent de90e2289c
commit 3123e27939
14 changed files with 229 additions and 217 deletions

View File

@@ -1,70 +0,0 @@
Grow
=======
Designed for looking after plants, Grow monitors moisture levels and runs simple pumps to water plants. Learn more -
https://shop.pimoroni.com/products/grow
|Build Status| |Coverage Status| |PyPi Package| |Python Versions|
Installing
==========
The one-line installer enables the correct interfaces,
One-line (Installs from GitHub)
-------------------------------
::
curl -sSL https://get.pimoroni.com/grow | bash
**Note** report issues with one-line installer here:
https://github.com/pimoroni/get
Or... Install and configure dependencies from GitHub:
-----------------------------------------------------
- ``git clone https://github.com/pimoroni/grow-python``
- ``cd grow-python``
- ``sudo ./install.sh``
**Note** Raspbian Lite users may first need to install git:
``sudo apt install git``
Or... Install from PyPi and configure manually:
-----------------------------------------------
- Run ``sudo pip install grow``
**Note** this wont perform any of the required configuration changes on
your Pi, you may additionally need to:
- Enable i2c: ``raspi-config nonint do_i2c 0``
- Enable SPI: ``raspi-config nonint do_spi 0``
And install additional dependencies:
::
sudo apt install python-numpy python-smbus python-pil python-setuptools
Help & Support
--------------
- GPIO Pinout - https://pinout.xyz/pinout/grow
- Support forums - http://forums.pimoroni.com/c/support
- Discord - https://discord.gg/hr93ByC
.. |Build Status| image:: https://travis-ci.com/pimoroni/grow-python.svg?branch=master
:target: https://travis-ci.com/pimoroni/grow-python
.. |Coverage Status| image:: https://coveralls.io/repos/github/pimoroni/grow-python/badge.svg?branch=master
:target: https://coveralls.io/github/pimoroni/grow-python?branch=master
.. |PyPi Package| image:: https://img.shields.io/pypi/v/growhat.svg
:target: https://pypi.python.org/pypi/growhat
.. |Python Versions| image:: https://img.shields.io/pypi/pyversions/growhat.svg
:target: https://pypi.python.org/pypi/growhat
0.0.1
-----
* Initial Release

View File

@@ -5,7 +5,8 @@ version = 0.0.1
author = Philip Howard, Paul Beech
author_email = paul@pimoroni.com
description = Grow HAT Mini. A plant valet add-on for the Raspberry Pi
long_description = file: README.rst
long_description = file: README.md
long_description_content_type = text/markdown
keywords = Raspberry Pi
url = https://www.pimoroni.com
project_urls =
@@ -48,14 +49,14 @@ ignore =
[pimoroni]
py2deps =
python-pip
python-numpy
python-yaml
python-smbus
python-pil
python-spidev
python-rpi.gpio
py3deps =
python3-pip
python3-numpy
python3-yaml
python3-smbus
python3-pil
python3-spidev

View File

@@ -22,12 +22,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
"""
from setuptools import setup, __version__
from pkg_resources import parse_version
from setuptools import setup
minimum_version = parse_version('30.4.0')
if parse_version(__version__) < minimum_version:
raise RuntimeError("Package setuptools must be at least version {}".format(minimum_version))
setup()

View File

@@ -70,12 +70,3 @@ def atexit():
sys.modules['atexit'] = atexit
yield atexit
del sys.modules['atexit']
@pytest.fixture(scope='function', autouse=False)
def numpy():
"""Mock numpy module."""
numpy = mock.MagicMock()
sys.modules['numpy'] = numpy
yield numpy
del sys.modules['numpy']

View File

@@ -9,7 +9,7 @@ def test_moisture_setup(GPIO, smbus):
def test_moisture_read_all(GPIO, smbus):
from grow import moisture
moisture._is_setup = False
result = moisture.read_all()
assert type(result(1)) == float