Skip to content

Commit 8aff64d

Browse files
authored
Merge branch 'adafruit:main' into dev/fix-pylint-errors
2 parents 2d43758 + 04048b5 commit 8aff64d

File tree

7 files changed

+60
-216
lines changed

7 files changed

+60
-216
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -10,68 +10,5 @@ jobs:
1010
test:
1111
runs-on: ubuntu-latest
1212
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.x
26-
uses: actions/setup-python@v2
27-
with:
28-
python-version: "3.x"
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 Sphinx, pre-commit
46-
run: |
47-
pip install --force-reinstall Sphinx sphinx-rtd-theme pre-commit
48-
- name: Library version
49-
run: git describe --dirty --always --tags
50-
- name: Setup problem matchers
51-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
52-
- name: Pre-commit hooks
53-
run: |
54-
pre-commit run --all-files
55-
- name: Build assets
56-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
57-
- name: Archive bundles
58-
uses: actions/upload-artifact@v2
59-
with:
60-
name: bundles
61-
path: ${{ github.workspace }}/bundles/
62-
- name: Build docs
63-
working-directory: docs
64-
run: sphinx-build -E -W -b html . _build/html
65-
- name: Check For pyproject.toml
66-
id: need-pypi
67-
run: |
68-
echo ::set-output name=pyproject-toml::$( find . -wholename './pyproject.toml' )
69-
- name: Build Python package
70-
if: contains(steps.need-pypi.outputs.pyproject-toml, 'pyproject.toml')
71-
run: |
72-
pip install --upgrade build twine
73-
for file in $(find -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) ); do
74-
sed -i -e "s/0.0.0+auto.0/1.2.3/" $file;
75-
done;
76-
python -m build
77-
twine check dist/*
13+
- name: Run Build CI workflow
14+
uses: adafruit/workflows-circuitpython-libs/build@main

.github/workflows/release.yml

Lines changed: 0 additions & 88 deletions
This file was deleted.

.github/workflows/release_gh.yml

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: MIT
4+
5+
name: GitHub Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run GitHub Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-gh@main
17+
with:
18+
github-token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release_pypi.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
name: PyPI Release Actions
6+
7+
on:
8+
release:
9+
types: [published]
10+
11+
jobs:
12+
upload-release-assets:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Run PyPI Release CI workflow
16+
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
17+
with:
18+
pypi-username: ${{ secrets.pypi_username }}
19+
pypi-password: ${{ secrets.pypi_password }}

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ repos:
1818
- id: end-of-file-fixer
1919
- id: trailing-whitespace
2020
- repo: https://github.com/pycqa/pylint
21-
rev: v2.11.1
21+
rev: v2.15.5
2222
hooks:
2323
- id: pylint
2424
name: pylint (library code)

.pylintrc

Lines changed: 4 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
2-
#
3-
# SPDX-License-Identifier: Unlicense
4-
5-
# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
62
#
73
# SPDX-License-Identifier: Unlicense
84

@@ -30,7 +26,7 @@ jobs=1
3026

3127
# List of plugins (as comma separated values of python modules names) to load,
3228
# usually to register additional checkers.
33-
load-plugins=
29+
load-plugins=pylint.extensions.no_self_use
3430

3531
# Pickle collected data for later comparisons.
3632
persistent=yes
@@ -58,8 +54,8 @@ confidence=
5854
# --enable=similarities". If you want to run only the classes checker, but have
5955
# no Warning level messages displayed, use"--disable=all --enable=classes
6056
# --disable=W"
61-
# disable=import-error,print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call
62-
disable=print-statement,parameter-unpacking,unpacking-in-except,old-raise-syntax,backtick,long-suffix,old-ne-operator,old-octal-literal,import-star-module-level,raw-checker-failed,bad-inline-option,locally-disabled,locally-enabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,apply-builtin,basestring-builtin,buffer-builtin,cmp-builtin,coerce-builtin,execfile-builtin,file-builtin,long-builtin,raw_input-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,no-absolute-import,old-division,dict-iter-method,dict-view-method,next-method-called,metaclass-assignment,indexing-exception,raising-string,reload-builtin,oct-method,hex-method,nonzero-method,cmp-method,input-builtin,round-builtin,intern-builtin,unichr-builtin,map-builtin-not-iterating,zip-builtin-not-iterating,range-builtin-not-iterating,filter-builtin-not-iterating,using-cmp-argument,eq-without-hash,div-method,idiv-method,rdiv-method,exception-message-attribute,invalid-str-codec,sys-max-int,bad-python3-import,deprecated-string-function,deprecated-str-translate-call,import-error,bad-continuation,unspecified-encoding
57+
# disable=import-error,raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,deprecated-str-translate-call
58+
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding
6359

6460
# Enable the message, report, category or checker with the given id(s). You can
6561
# either give multiple identifier separated by comma (,) or put this option
@@ -229,12 +225,6 @@ max-line-length=100
229225
# Maximum number of lines in a module
230226
max-module-lines=1000
231227

232-
# List of optional constructs for which whitespace checking is disabled. `dict-
233-
# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}.
234-
# `trailing-comma` allows a space between comma and closing bracket: (a, ).
235-
# `empty-line` allows space-only lines.
236-
no-space-check=trailing-comma,dict-separator
237-
238228
# Allow the body of a class to be on the same line as the declaration if body
239229
# contains single statement.
240230
single-line-class-stmt=no
@@ -261,48 +251,29 @@ min-similarity-lines=12
261251

262252
[BASIC]
263253

264-
# Naming hint for argument names
265-
argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
266-
267254
# Regular expression matching correct argument names
268255
argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
269256

270-
# Naming hint for attribute names
271-
attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
272-
273257
# Regular expression matching correct attribute names
274258
attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
275259

276260
# Bad variable names which should always be refused, separated by a comma
277261
bad-names=foo,bar,baz,toto,tutu,tata
278262

279-
# Naming hint for class attribute names
280-
class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
281-
282263
# Regular expression matching correct class attribute names
283264
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
284265

285-
# Naming hint for class names
286-
# class-name-hint=[A-Z_][a-zA-Z0-9]+$
287-
class-name-hint=[A-Z_][a-zA-Z0-9_]+$
288-
289266
# Regular expression matching correct class names
290267
# class-rgx=[A-Z_][a-zA-Z0-9]+$
291268
class-rgx=[A-Z_][a-zA-Z0-9_]+$
292269

293-
# Naming hint for constant names
294-
const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$
295-
296270
# Regular expression matching correct constant names
297271
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
298272

299273
# Minimum line length for functions/classes that require docstrings, shorter
300274
# ones are exempt.
301275
docstring-min-length=-1
302276

303-
# Naming hint for function names
304-
function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
305-
306277
# Regular expression matching correct function names
307278
function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
308279

@@ -313,21 +284,12 @@ good-names=r,g,b,w,i,j,k,n,x,y,z,ex,ok,Run,_
313284
# Include a hint for the correct naming format with invalid-name
314285
include-naming-hint=no
315286

316-
# Naming hint for inline iteration names
317-
inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$
318-
319287
# Regular expression matching correct inline iteration names
320288
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
321289

322-
# Naming hint for method names
323-
method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
324-
325290
# Regular expression matching correct method names
326291
method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
327292

328-
# Naming hint for module names
329-
module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
330-
331293
# Regular expression matching correct module names
332294
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
333295

@@ -343,9 +305,6 @@ no-docstring-rgx=^_
343305
# to this list to register other decorators that produce valid properties.
344306
property-classes=abc.abstractproperty
345307

346-
# Naming hint for variable names
347-
variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
348-
349308
# Regular expression matching correct variable names
350309
variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$
351310

0 commit comments

Comments
 (0)