Skip to content

Commit

Permalink
Merge pull request #9 from pimoroni/actions
Browse files Browse the repository at this point in the history
Add GitHub actions workflow
  • Loading branch information
Gadgetoid authored Jan 31, 2022
2 parents 55c74d4 + 95bbc26 commit 7722d44
Show file tree
Hide file tree
Showing 12 changed files with 242 additions and 221 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Python Tests

on:
pull_request:
push:
branches:
- master

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python: [2.7, 3.6, 3.7, 3.9]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Install Dependencies
run: |
python -m pip install --upgrade setuptools tox
- name: Run Tests
working-directory: library
run: |
tox -e py
- name: Coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
working-directory: library
run: |
python -m pip install coveralls
coveralls --service=github
if: ${{ matrix.python == '3.9' }}

24 changes: 0 additions & 24 deletions .travis.yml

This file was deleted.

70 changes: 70 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
LIBRARY_VERSION=$(shell grep version library/setup.cfg | awk -F" = " '{print $$2}')
LIBRARY_NAME=$(shell grep name library/setup.cfg | awk -F" = " '{print $$2}')

.PHONY: usage install uninstall
usage:
@echo "Library: ${LIBRARY_NAME}"
@echo "Version: ${LIBRARY_VERSION}\n"
@echo "Usage: make <target>, where target is one of:\n"
@echo "install: install the library locally from source"
@echo "uninstall: uninstall the local library"
@echo "check: peform basic integrity checks on the codebase"
@echo "python-readme: generate library/README.md from README.md + library/CHANGELOG.txt"
@echo "python-wheels: build python .whl files for distribution"
@echo "python-sdist: build python source distribution"
@echo "python-clean: clean python build and dist directories"
@echo "python-dist: build all python distribution files"
@echo "python-testdeploy: build all and deploy to test PyPi"
@echo "tag: tag the repository with the current version"

install:
./install.sh

uninstall:
./uninstall.sh

check:
@echo "Checking for trailing whitespace"
@! grep -IUrn --color "[[:blank:]]$$" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=PKG-INFO
@echo "Checking for DOS line-endings"
@! grep -lIUrn --color "" --exclude-dir=sphinx --exclude-dir=.tox --exclude-dir=.git --exclude=Makefile
@echo "Checking library/CHANGELOG.txt"
@cat library/CHANGELOG.txt | grep ^${LIBRARY_VERSION}
@echo "Checking library/${LIBRARY_NAME}/__init__.py"
@cat library/${LIBRARY_NAME}/__init__.py | grep "^__version__ = '${LIBRARY_VERSION}'"

tag:
git tag -a "v${LIBRARY_VERSION}" -m "Version ${LIBRARY_VERSION}"

python-readme: library/README.md

python-license: library/LICENSE.txt

library/README.md: README.md library/CHANGELOG.txt
cp README.md library/README.md
printf "\n# Changelog\n" >> library/README.md
cat library/CHANGELOG.txt >> library/README.md

library/LICENSE.txt: LICENSE
cp LICENSE library/LICENSE.txt

python-wheels: python-readme python-license
cd library; python3 setup.py bdist_wheel
cd library; python setup.py bdist_wheel

python-sdist: python-readme python-license
cd library; python setup.py sdist

python-clean:
-rm -r library/dist
-rm -r library/build
-rm -r library/*.egg-info

python-dist: python-clean python-wheels python-sdist
ls library/dist

python-testdeploy: python-dist
twine upload --repository-url https://test.pypi.org/legacy/ library/dist/*

python-deploy: check python-dist
twine upload library/dist/*
Expand Down
38 changes: 2 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,19 @@ In the new terminal window type the command exactly as it appears below (check f
curl https://get.pimoroni.com/ledshim | bash
```

Alternatively, on Raspbian, you can download the `pimoroni-dashboard` and install your product by browsing to the relevant entry:

```bash
sudo apt-get install pimoroni
```
(you will find the Dashboard under 'Accessories' too, in the Pi menu - or just run `pimoroni-dashboard` at the command line)

If you choose to download examples you'll find them in `/home/pi/Pimoroni/ledshim/`.

### Manual install:

#### Library install for Python 3:

on Raspbian:

```bash
sudo apt-get install python3-ledshim
```

other environments:

```bash
sudo pip3 install ledshim
```

#### Library install for Python 2:

on Raspbian:

```bash
sudo apt-get install python-ledshim
```

other environments:

```bash
sudo pip2 install ledshim
python3 -m pip install ledshim
```

### Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you should clone this repository, `cd` to the library directory, and run:

```bash
sudo python3 setup.py install
python3 setup.py install
```
(or `sudo python setup.py install` whichever your primary Python environment may be)

In all cases you will have to enable the i2c bus.

Expand Down
7 changes: 7 additions & 0 deletions library/CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
0.0.2
-----

* Add `set_multiple_pixels`
* Updated packaging
* Linting & minor improvements to docstrings

0.0.1
-----

Expand Down
2 changes: 1 addition & 1 deletion library/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
include CHANGELOG.txt
include LICENSE.txt
include README.rst
include README.md
include setup.py
recursive-include ledshim *.py
63 changes: 63 additions & 0 deletions library/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# LED SHIM

[![Build Status](https://travis-ci.com/pimoroni/led-shim.svg?branch=master)](https://travis-ci.com/pimoroni/led-shim)
[![Coverage Status](https://coveralls.io/repos/github/pimoroni/led-shim/badge.svg?branch=master)](https://coveralls.io/github/pimoroni/led-shim?branch=master)
[![PyPi Package](https://img.shields.io/pypi/v/ledshim.svg)](https://pypi.python.org/pypi/ledshim)
[![Python Versions](https://img.shields.io/pypi/pyversions/ledshim.svg)](https://pypi.python.org/pypi/ledshim)

https://shop.pimoroni.com/products/led-shim

28 tiny RGB LED pixels in a single row that just slip right onto your Pi's pins, no soldering required! LED SHIM is ideal for status updates, notifications, a VU meter, or as a bar graph for sensor readings.

## Installing

### Full install (recommended):

We've created an easy installation script that will install all pre-requisites and get your LED SHIM
up and running with minimal efforts. To run it, fire up Terminal which you'll find in Menu -> Accessories -> Terminal
on your Raspberry Pi desktop, as illustrated below:

![Finding the terminal](http://get.pimoroni.com/resources/github-repo-terminal.png)

In the new terminal window type the command exactly as it appears below (check for typos) and follow the on-screen instructions:

```bash
curl https://get.pimoroni.com/ledshim | bash
```

### Manual install:

```bash
python3 -m pip install ledshim
```

### Development:

If you want to contribute, or like living on the edge of your seat by having the latest code, you should clone this repository, `cd` to the library directory, and run:

```bash
python3 setup.py install
```

In all cases you will have to enable the i2c bus.

## Documentation & Support

* Guides and tutorials - https://learn.pimoroni.com/led-shim
* Function reference - http://docs.pimoroni.com/ledshim/
* GPIO Pinout - https://pinout.xyz/pinout/led_shim
* Get help - http://forums.pimoroni.com/c/support

# Changelog
0.0.2
-----

* Add `set_multiple_pixels`
* Updated packaging
* Linting & minor improvements to docstrings

0.0.1
-----

* Initial release

113 changes: 0 additions & 113 deletions library/README.rst

This file was deleted.

2 changes: 1 addition & 1 deletion library/ledshim/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""LED SHIM 28-pixel RGB LED display."""
from . import is31fl3731

__version__ = '0.0.1'
__version__ = '0.0.2'

display = is31fl3731.LEDSHIM(None, address=0x75, gamma_table=is31fl3731.LED_GAMMA)

Expand Down
Loading

0 comments on commit 7722d44

Please sign in to comment.