Skip to content

Commit

Permalink
Fix readme issue with setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
gunthercox committed Jan 30, 2016
1 parent ca8438f commit 78f6bf6
Show file tree
Hide file tree
Showing 4 changed files with 136 additions and 12 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
language: python

python:
- '3.4'
- '2.7'
- 'pypy'

Expand Down
94 changes: 94 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
zorg-gpio
=========

|Package Version| |Requirements Status| |Build Status| |Code Climate|
|Coverage Status|

Zorg (https://zorg.github.io/) is a Python framework for robotics and
physical computing.

This module provides drivers for `General Purpose Input/Output
(GPIO) <https://en.wikipedia.org/wiki/General_Purpose_Input/Output>`__
devices. Typically, this library is registered by an adaptor class such
as ```zorg-edison`` <https://github.com/zorg/zorg-edison>`__ that
supports the needed interfaces for GPIO devices.

Getting Started
---------------

Install the module with: ``pip install zorg zorg-gpio``

`Documentation <http://zorg-gpio.readthedocs.org/>`__
-----------------------------------------------------

Example
-------

.. code:: python
import time
import zorg
def blink_led(my):
while True:
my.led.toggle()
time.sleep(100)
robot = zorg.robot({
"name": "Test",
"connections": {
"edison": {
"adaptor": "zorg_edison.Edison",
},
},
"devices": {
"led": {
"connection": "edison",
"driver": "zorg_gpio.Led",
"pin": 4, # Digital pin 4
},
},
"work": blink_led,
})
robot.start()
Hardware Support
----------------

Zorg has a extensible system for connecting to hardware devices. The
following GPIO devices are currently supported:

- `Temperature sensor <docs/temperature_sensor.md>`__
- `Light sensor <docs/light_sensor.md>`__
- Microphone
- Touch sensor
- Rotary Angle Sensor
- `Button <docs/button.md>`__
- `Analog Sensor <docs/analog_sensor.md>`__
- `Digital Sensor <docs/digital_sensor.md>`__
- `LED <docs/led.md>`__
- `Relay <docs/relay.md>`__
- `Servo <docs/servo.md>`__
- Buzzer

`Open a new issue <https://github.com/zorg/zorg-gpio/issues/new>`__ to
request support for additional components.

License
-------

`Copyright (c) 2015 Team
Zorg <https://github.com/zorg/zorg/blob/master/LICENSE.md>`__

.. |Package Version| image:: https://img.shields.io/pypi/v/zorg-gpio.svg
:target: https://pypi.python.org/pypi/zorg-gpio/
.. |Requirements Status| image:: https://requires.io/github/zorg/zorg-gpio/requirements.svg?branch=master
:target: https://requires.io/github/zorg/zorg-gpio/requirements/?branch=master
.. |Build Status| image:: https://travis-ci.org/zorg/zorg-gpio.svg?branch=master
:target: https://travis-ci.org/zorg/zorg-gpio
.. |Code Climate| image:: https://codeclimate.com/github/zorg/zorg-gpio/badges/gpa.svg
:target: https://codeclimate.com/github/zorg/zorg-gpio
.. |Coverage Status| image:: https://coveralls.io/repos/github/zorg/zorg-gpio/badge.svg?branch=master
:target: https://coveralls.io/github/zorg/zorg-gpio?branch=master
51 changes: 40 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,39 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
from setuptools import setup, find_packages
from setuptools.command.install import install
from distutils.core import Command


class MakeReadme(Command):
description = "Generates a README.rst version of README.md"
user_options = []

def initialize_options(self):
pass

def finalize_options(self):
pass

def run(self):
try:
from pypandoc import convert
rst = convert('README.md', 'rst')
readme = open('README.rst', 'w+')
readme.write(rst)
readme.close()
except ImportError:
raise ImportWarning("Module pypandoc not found, could not convert Markdown to RST")


req = open("requirements.txt")
requirements = req.readlines()
REQUIREMENTS = req.readlines()
req.close()

rm = open("README.rst")
README = rm.readlines()
rm.close()

# Dynamically retrieve the version from the module
version_string = __import__('zorg_gpio').__version__
Expand All @@ -17,14 +43,13 @@
version=version_string,
url="https://github.com/zorg/zorg-gpio",
description="GPIO drivers for Zorg robots.",
setup_requires=['setuptools-markdown'],
long_description_markdown_filename='README.md',
author="Zorg Group",
author_email="gunthercx@gmail.com",
long_description=README,
maintainer="Zorg Group",
maintainer_email="gunthercx@gmail.com",
packages=find_packages(),
package_dir={"zorg_gpio": "zorg_gpio"},
include_package_data=True,
install_requires=requirements,
install_requires=REQUIREMENTS,
license="MIT",
zip_safe=True,
platforms=["any"],
Expand All @@ -42,7 +67,11 @@
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
],
test_suite="tests",
tests_require=[]
tests_require=[],
cmdclass={
'make_readme': MakeReadme,
}
)
2 changes: 1 addition & 1 deletion zorg_gpio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@
'TemperatureSensor',
]

__version__ = '0.0.1'
__version__ = '0.0.2'

0 comments on commit 78f6bf6

Please sign in to comment.