Skip to content

Commit 98183be

Browse files
authored
Merge pull request #1 from makermelissa/master
Added an initial version of the library
2 parents 5d5ae0a + f48067c commit 98183be

25 files changed

+1695
-2
lines changed

.github/workflows/build.yml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Build CI
6+
7+
on: [pull_request, push]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Dump GitHub context
14+
env:
15+
GITHUB_CONTEXT: ${{ toJson(github) }}
16+
run: echo "$GITHUB_CONTEXT"
17+
- name: Translate Repo Name For Build Tools filename_prefix
18+
id: repo-name
19+
run: |
20+
echo ::set-output name=repo-name::$(
21+
echo ${{ github.repository }} |
22+
awk -F '\/' '{ print tolower($2) }' |
23+
tr '_' '-'
24+
)
25+
- name: Set up Python 3.6
26+
uses: actions/setup-python@v1
27+
with:
28+
python-version: 3.6
29+
- name: Versions
30+
run: |
31+
python3 --version
32+
- name: Checkout Current Repo
33+
uses: actions/checkout@v1
34+
with:
35+
submodules: true
36+
- name: Checkout tools repo
37+
uses: actions/checkout@v2
38+
with:
39+
repository: adafruit/actions-ci-circuitpython-libs
40+
path: actions-ci
41+
- name: Install dependencies
42+
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
43+
run: |
44+
source actions-ci/install.sh
45+
- name: Pip install pylint, Sphinx, pre-commit
46+
run: |
47+
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
48+
- name: Library version
49+
run: git describe --dirty --always --tags
50+
- name: Pre-commit hooks
51+
run: |
52+
pre-commit run --all-files
53+
- name: PyLint
54+
run: |
55+
pylint $( find . -path './adafruit*.py' )
56+
- name: Build docs
57+
working-directory: docs
58+
run: sphinx-build -E -W -b html . _build/html
59+
- name: Check For setup.py
60+
id: need-pypi
61+
run: |
62+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
63+
- name: Build Python package
64+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
65+
run: |
66+
pip install --upgrade setuptools wheel twine readme_renderer testresources
67+
python setup.py sdist
68+
python setup.py bdist_wheel --universal
69+
twine check dist/*

.github/workflows/release.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-pypi:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v1
16+
- name: Check For setup.py
17+
id: need-pypi
18+
run: |
19+
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
20+
- name: Set up Python
21+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: '3.x'
25+
- name: Install dependencies
26+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
27+
run: |
28+
python -m pip install --upgrade pip
29+
pip install setuptools wheel twine
30+
- name: Build and publish
31+
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
32+
env:
33+
TWINE_USERNAME: ${{ secrets.pypi_username }}
34+
TWINE_PASSWORD: ${{ secrets.pypi_password }}
35+
run: |
36+
python setup.py sdist
37+
twine upload dist/*

.gitignore

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
*.mpy
6+
.idea
7+
__pycache__
8+
_build
9+
*.pyc
10+
.env
11+
.python-version
12+
build*/
13+
bundles
14+
*.DS_Store
15+
.eggs
16+
dist
17+
**/*.egg-info
18+
.vscode

.pre-commit-config.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
repos:
6+
- repo: https://github.com/python/black
7+
rev: 19.10b0
8+
hooks:
9+
- id: black
10+
- repo: https://github.com/fsfe/reuse-tool
11+
rev: latest
12+
hooks:
13+
- id: reuse
14+
- repo: https://github.com/pre-commit/pre-commit-hooks
15+
rev: v2.3.0
16+
hooks:
17+
- id: check-yaml
18+
- id: end-of-file-fixer
19+
- id: trailing-whitespace

0 commit comments

Comments
 (0)