/ patches / 0001-Added-pre-commit-and-SPDX-copyright.patch
0001-Added-pre-commit-and-SPDX-copyright.patch
 1  From 13bca4df73f59b91f7d043d4a18a05718cc0e458 Mon Sep 17 00:00:00 2001
 2  From: dherrada <dylan.herrada@adafruit.com>
 3  Date: Mon, 11 Jan 2021 15:06:44 -0500
 4  Subject: [PATCH] Added pre-commit and SPDX copyright
 5  
 6  ---
 7   .github/workflows/build.yml   | 28 ++++++++++++++++++++++++----
 8   .github/workflows/release.yml |  4 ++++
 9   2 files changed, 28 insertions(+), 4 deletions(-)
10  
11  diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
12  index b6977a9..59baa53 100644
13  --- a/.github/workflows/build.yml
14  +++ b/.github/workflows/build.yml
15  @@ -1,3 +1,7 @@
16  +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
17  +#
18  +# SPDX-License-Identifier: MIT
19  +
20   name: Build CI
21   
22   on: [pull_request, push]
23  @@ -38,20 +42,36 @@ jobs:
24         # (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
25         run: |
26           source actions-ci/install.sh
27  -    - name: Pip install pylint, black, & Sphinx
28  +    - name: Pip install pylint, Sphinx, pre-commit
29         run: |
30  -        pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme
31  +        pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
32       - name: Library version
33         run: git describe --dirty --always --tags
34  -    - name: Check formatting
35  +    - name: Pre-commit hooks
36         run: |
37  -        black --check --target-version=py35 .
38  +        pre-commit run --all-files
39       - name: PyLint
40         run: |
41           pylint $( find . -path './adafruit*.py' )
42           ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace $( find . -path "./examples/*.py" ))
43       - name: Build assets
44         run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
45  +    - name: Archive bundles
46  +      uses: actions/upload-artifact@v2
47  +      with:
48  +        name: bundles
49  +        path: ${{ github.workspace }}/bundles/
50       - name: Build docs
51         working-directory: docs
52         run: sphinx-build -E -W -b html . _build/html
53  +    - name: Check For setup.py
54  +      id: need-pypi
55  +      run: |
56  +        echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
57  +    - name: Build Python package
58  +      if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
59  +      run: |
60  +        pip install --upgrade setuptools wheel twine readme_renderer testresources
61  +        python setup.py sdist
62  +        python setup.py bdist_wheel --universal
63  +        twine check dist/*
64  diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
65  index 18efb9c..6d0015a 100644
66  --- a/.github/workflows/release.yml
67  +++ b/.github/workflows/release.yml
68  @@ -1,3 +1,7 @@
69  +# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
70  +#
71  +# SPDX-License-Identifier: MIT
72  +
73   name: Release Actions
74   
75   on:
76  -- 
77  2.25.1
78