Skip to content

Commit 02a7119

Browse files
authored
Merge pull request #6 from kattni/pypi
PyPi setup.
2 parents 4930878 + c205399 commit 02a7119

8 files changed

+97
-25
lines changed

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
1+
*.mpy
2+
.idea
13
__pycache__
24
_build
35
*.pyc
46
.env
57
build*
68
bundles
9+
*.DS_Store
10+
.eggs
11+
dist
12+
**/*.egg-info

.travis.yml

+20-19
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,33 @@
1-
# This is a common .travis.yml for generating library release zip files for
2-
# CircuitPython library releases using circuitpython-build-tools.
3-
# See https://github.com/adafruit/circuitpython-build-tools for detailed setup
4-
# instructions.
5-
61
dist: trusty
72
sudo: false
83
language: python
94
python:
10-
- "3.6"
11-
5+
- '3.6'
126
cache:
13-
pip: true
14-
7+
pip: true
158
deploy:
16-
provider: releases
17-
api_key: $GITHUB_TOKEN
9+
- provider: releases
10+
api_key: "$GITHUB_TOKEN"
1811
file_glob: true
19-
file: $TRAVIS_BUILD_DIR/bundles/*
12+
file: "$TRAVIS_BUILD_DIR/bundles/*"
2013
skip_cleanup: true
2114
overwrite: true
2215
on:
2316
tags: true
24-
17+
- provider: pypi
18+
user: adafruit-travis
19+
on:
20+
tags: true
21+
password:
22+
secure: liFlwauzdAnjem5PGNWCbK0cTU2VACv9t/rTUNRKODp1g5bZPEOL/hBGmkiZaX6hcZ4tU6MkJQXt/HMvHyq/+XL+qaJtYMzlfePbL0h9ulGTcTn0f+smsTRqJ+Xg2ORnDcAQWeOc5q5H+YGJ6vCcpcIaiYDKtiKds8ziRF+zifQSPDVFyYxks59tij84YBKdPi1SbsC5RANwUupdyDdZIdE+DoYL4+Qrnuakt7pPxfhnG+cvDSJMpjqZdGBQsF2d02p1mAmTiyQvb/PVNb089ibNnVGzFMMCouUFLVEwheo2V0CUNmerDpkZQQF9zH6CRjlLyZdCOzS9jJ9w2N/g6jXNtepGPnqYjfzebt0/TmxxJo3sAnxH7gQzmOO2FLzem4JgbECcrEvACLPYQHe4OVpZ3cqlzLuUMvCg+TfBBkg8Qz7O3w71kntaDzMwWLOKiSMHXnb24iIlBbMWoIzSHpmrvfQwWQM5XZc8wm2WWPxn8Adw9dODuliUF1L65L9bBFaWnEFBapnruYQJtTX8TYn5umeAaCrQLwVUcGSW7VBwWqQ86LZ+W8CinzLpRuFYd8LoqRGiw0ToqmN+N+tAbc9+PFafzVD/u3gKnqRnFsMOK9onuEZky5dALIgNL+yAVm4sgPwknNEFQ3yo0uBBeuezH4Xs6Gcsumtv/DKEIL4=
2523
install:
26-
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
27-
24+
- pip install -r requirements.txt
25+
- pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme
26+
- pip install --force-reinstall pylint==1.9.2
2827
script:
29-
- pylint adafruit_stmpe610.py
30-
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
31-
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-stmpe610 --library_location .
32-
- cd docs && sphinx-build -E -W -b html . _build/html
28+
- pylint adafruit_stmpe610.py
29+
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace
30+
examples/*.py)
31+
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-stmpe610 --library_location
32+
.
33+
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

adafruit_stmpe610.py

+3
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,7 @@ def _write_register_byte(self, register, value):
274274
i2c.write(bytes([register & 0xFF, value & 0xFF]))
275275
#print("$%02X <= 0x%02X" % (register, value))
276276

277+
277278
class Adafruit_STMPE610_SPI(Adafruit_STMPE610):
278279
"""
279280
SPI driver for the STMPE610 Resistive Touch sensor.
@@ -294,6 +295,8 @@ def __init__(self, spi, cs, baudrate=1000000):
294295
raise RuntimeError('Failed to find STMPE610! Chip Version 0x%x' % version)
295296
super().__init__()
296297

298+
# pylint: disable=no-member
299+
# Disable should be reconsidered when refactor can be tested.
297300
def _read_register(self, register, length):
298301
"""Low level register reading over SPI, returns a list of values"""
299302
register = (register | 0x80) & 0xFF # Read single, bit 7 high.

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
# Uncomment the below if you use native CircuitPython modules such as
2121
# digitalio, micropython and busio. List the modules you use. Without it, the
2222
# autodoc module docs will fail to generate with a warning.
23-
autodoc_mock_imports = ["micropython"]
23+
# autodoc_mock_imports = ["micropython"]
2424

2525

2626
intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'BusDevice': ('https://circuitpython.readthedocs.io/projects/busdevice/en/latest/', None),'Register': ('https://circuitpython.readthedocs.io/projects/register/en/latest/', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}

examples/stmpe610_paint_demo.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
display.fill(color565(0, 0, 0))
2323

2424
st_cs_pin = digitalio.DigitalInOut(board.D6)
25-
st = adafruit_stmpe610.Adafruit_STMPE610_SPI(spi,st_cs_pin)
25+
st = adafruit_stmpe610.Adafruit_STMPE610_SPI(spi, st_cs_pin)
2626

2727
while True:
2828
if st.touched:

examples/stmpe610_simpletest.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,11 @@
22
import board
33
import digitalio
44
from adafruit_stmpe610 import Adafruit_STMPE610_SPI
5-
spi=busio.SPI(board.SCK,board.MOSI,board.MISO)
5+
6+
spi = busio.SPI(board.SCK, board.MOSI, board.MISO)
67
cs = digitalio.DigitalInOut(board.D6)
7-
st=Adafruit_STMPE610_SPI(spi,cs)
8+
st = Adafruit_STMPE610_SPI(spi, cs)
9+
810
print("Go Ahead - Touch the Screen - Make My Day!")
911
while True:
1012
if not st.buffer_empty:

requirements.txt

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
adafruit-circuitpython-bus-device
2-
adafruit-circuitpython-register
1+
Adafruit-Blinka

setup.py

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
"""A setuptools based setup module.
2+
3+
See:
4+
https://packaging.python.org/en/latest/distributing.html
5+
https://github.com/pypa/sampleproject
6+
"""
7+
8+
# Always prefer setuptools over distutils
9+
from setuptools import setup, find_packages
10+
# To use a consistent encoding
11+
from codecs import open
12+
from os import path
13+
14+
here = path.abspath(path.dirname(__file__))
15+
16+
# Get the long description from the README file
17+
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
18+
long_description = f.read()
19+
20+
setup(
21+
name='adafruit-circuitpython-stmpe610',
22+
23+
use_scm_version=True,
24+
setup_requires=['setuptools_scm'],
25+
26+
description='CircuitPython library for STMPE610 Resistive Touch Screen Controller.',
27+
long_description=long_description,
28+
long_description_content_type='text/x-rst',
29+
30+
# The project's main homepage.
31+
url='https://github.com/adafruit/Adafruit_CircuitPython_STMPE610',
32+
33+
# Author details
34+
author='Adafruit Industries',
35+
author_email='[email protected]',
36+
37+
install_requires=['Adafruit-Blinka'],
38+
39+
# Choose your license
40+
license='MIT',
41+
42+
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers
43+
classifiers=[
44+
'Development Status :: 3 - Alpha',
45+
'Intended Audience :: Developers',
46+
'Topic :: Software Development :: Libraries',
47+
'Topic :: System :: Hardware',
48+
'License :: OSI Approved :: MIT License',
49+
'Programming Language :: Python :: 3',
50+
'Programming Language :: Python :: 3.4',
51+
'Programming Language :: Python :: 3.5',
52+
],
53+
54+
# What does your project relate to?
55+
keywords='adafruit stmpe610 resistive touch screen controller'
56+
'hardware micropython circuitpython',
57+
58+
# You can just specify the packages manually here if your project is
59+
# simple. Or you can use find_packages().
60+
py_modules=['adafruit_stmpe610'],
61+
)

0 commit comments

Comments
 (0)