Skip to content

Commit bb22656

Browse files
Merge pull request #16 from jposada202020/bump_to_circiutpython9
compatibility_cp9
2 parents e39e092 + b8b431a commit bb22656

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+234
-73
lines changed

.github/workflows/build.yml

Lines changed: 81 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,89 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
22
#
3-
# SPDX-License-Identifier: MIT
3+
# SPDX-License-Identifier: Unlicense
44

55
name: Build CI
66

7-
on: [pull_request, push]
7+
on:
8+
pull_request:
9+
types: [opened, reopened]
10+
push:
811

912
jobs:
10-
test:
13+
build-wheel:
1114
runs-on: ubuntu-latest
1215
steps:
13-
- name: Run Build CI workflow
14-
uses: jposada202020/workflows-circuitpython-libs/build@main
16+
- uses: actions/setup-python@v4
17+
with:
18+
python-version: "3.x"
19+
20+
- uses: actions/checkout@v3
21+
22+
- name: Build wheel
23+
run: pip wheel -w dist --no-deps .
24+
25+
- name: check dist
26+
run: pipx run twine check dist/*
27+
28+
- name: Archive wheel
29+
uses: actions/upload-artifact@v3
30+
with:
31+
name: wheel
32+
path: ${{ github.workspace }}/dist/
33+
34+
linters:
35+
runs-on: ubuntu-latest
36+
steps:
37+
38+
- uses: actions/setup-python@v4
39+
with:
40+
python-version: "3.x"
41+
42+
- uses: actions/checkout@v3
43+
44+
- name: Install pre-commit and deps
45+
run: pip install pre-commit -r requirements.txt
46+
47+
- name: Setup problem matchers
48+
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
49+
50+
- name: Pre-commit hooks
51+
run: pre-commit run --all-files
52+
53+
build-bundles:
54+
runs-on: ubuntu-latest
55+
steps:
56+
- name: Translate Repo Name For Build Tools filename_prefix
57+
id: repo-name
58+
run: |
59+
echo repo-name=$(
60+
echo ${{ github.repository }} |
61+
awk -F '\/' '{ print tolower($2) }' |
62+
tr '_' '-'
63+
) >> $GITHUB_OUTPUT
64+
65+
- uses: actions/checkout@v3
66+
67+
- name: Set up Python 3.x
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: "3.x"
71+
72+
- name: Checkout tools repo
73+
uses: actions/checkout@v3
74+
with:
75+
repository: adafruit/actions-ci-circuitpython-libs
76+
path: actions-ci
77+
78+
- name: Install deps
79+
run: |
80+
source actions-ci/install.sh
81+
82+
- name: Build assets
83+
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
84+
85+
- name: Archive bundles
86+
uses: actions/upload-artifact@v3
87+
with:
88+
name: bundles
89+
path: ${{ github.workspace }}/bundles/

.github/workflows/release_pypi.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2025 Jose D. Montoya
22
#
33
# SPDX-License-Identifier: MIT
44

@@ -9,11 +9,28 @@ on:
99
types: [published]
1010

1111
jobs:
12-
upload-release-assets:
12+
pypi-publish:
13+
name: Publish release to PyPI
1314
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/circuitpython-uplot
18+
permissions:
19+
id-token: write
1420
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 }}
21+
- uses: actions/checkout@v4
22+
- name: Set up Python
23+
uses: actions/setup-python@v4
24+
with:
25+
python-version: "3.x"
26+
- name: Install dependencies
27+
shell: bash
28+
run: |
29+
python -m pip install --upgrade pip
30+
pip install --upgrade build
31+
- name: Build package
32+
run: |
33+
find -type f -not -path "./.*" -not -path "./docs*" \( -name "*.py" -o -name "*.toml" \) -exec sed -i -e "s/0.0.0+auto.0/${{github.event.release.tag_name}}/" {} +
34+
python -m build
35+
- name: Publish package distributions to PyPI
36+
uses: pypa/gh-action-pypi-publish@release/v1

.pre-commit-config.yaml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,41 @@
1-
# SPDX-FileCopyrightText: 2023 Jose D. Montoya
1+
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
22
#
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
66
- repo: https://github.com/python/black
7-
rev: 23.3.0
7+
rev: 24.10.0
88
hooks:
99
- id: black
1010
- repo: https://github.com/pre-commit/pre-commit-hooks
11-
rev: v4.4.0
11+
rev: v5.0.0
1212
hooks:
1313
- id: check-yaml
1414
- id: end-of-file-fixer
1515
- id: trailing-whitespace
16+
- id: mixed-line-ending
17+
args:
18+
- --fix=lf
1619
- repo: https://github.com/pycqa/pylint
17-
rev: v2.17.4
20+
rev: v3.3.1
1821
hooks:
1922
- id: pylint
2023
name: pylint (library code)
2124
types: [python]
2225
args:
2326
- --disable=consider-using-f-string
24-
exclude: "^(docs/|examples/|tests/)"
27+
exclude: "^(docs/|examples/|tests/|setup.py$)"
2528
- id: pylint
2629
name: pylint (example code)
2730
description: Run pylint rules on "examples/*.py" files
2831
types: [python]
2932
files: "^examples/"
3033
args:
3134
- --disable=missing-docstring,invalid-name,consider-using-f-string,duplicate-code
35+
- id: pylint
36+
name: pylint (test code)
37+
description: Run pylint rules on "tests/*.py" files
38+
types: [python]
39+
files: "^tests/"
40+
args:
41+
- --disable=missing-docstring,consider-using-f-string,duplicate-code

.pylintrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ unsafe-load-any-extension=no
1414

1515
[MESSAGES CONTROL]
1616
confidence=
17-
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding,protected-access,unnecessary-list-index-lookup,duplicate-code,import-outside-toplevel,attribute-defined-outside-init
17+
disable=raw-checker-failed,bad-inline-option,locally-disabled,file-ignored,suppressed-message,useless-suppression,deprecated-pragma,import-error,pointless-string-statement,unspecified-encoding,protected-access,unnecessary-list-index-lookup,duplicate-code,import-outside-toplevel,attribute-defined-outside-init, too-many-positional-arguments
1818
enable=
1919

2020
[REPORTS]

examples/bar_3Dbars.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,16 @@
1818
b = [3, 5, 1, 9, 7]
1919

2020
# Creating a 3D bar
21-
Bar(plot, a, b, color=0xFF1000, fill=True, bar_space=30, xstart=70, projection=True)
21+
Bar(
22+
plot,
23+
a,
24+
b,
25+
color=0xFF1000,
26+
fill=True,
27+
bar_space=30,
28+
xstart=70,
29+
projection=True,
30+
)
2231

2332
# Plotting and showing the plot
24-
display.show(plot)
33+
display.root_group = plot

examples/bar_color_changing.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
a = ["a", "b", "c", "d", "e", "f"]
3333

3434
# Showing the plot
35-
display.show(plot)
35+
display.root_group = plot
3636

3737
# Creating the bar
3838
my_bar = Bar(
@@ -47,7 +47,14 @@
4747
time.sleep(2)
4848
# Changing all the bars to Yellow
4949
my_bar.update_colors(
50-
[color.YELLOW, color.YELLOW, color.YELLOW, color.YELLOW, color.YELLOW, color.YELLOW]
50+
[
51+
color.YELLOW,
52+
color.YELLOW,
53+
color.YELLOW,
54+
color.YELLOW,
55+
color.YELLOW,
56+
color.YELLOW,
57+
]
5158
)
5259

5360
time.sleep(2)

examples/bar_colorpalette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,4 +39,4 @@
3939
)
4040

4141
# Showing the plot
42-
display.show(plot)
42+
display.root_group = plot

examples/bar_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
Bar(plot, a, b, 0xFF1000, True)
2020

2121
# Plotting and showing the plot
22-
display.show(plot)
22+
display.root_group = plot

examples/bar_scale_example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
group.append(plot_scale1)
3030
group.append(plot_scale2)
3131

32-
display.show(group)
32+
display.root_group = group

examples/bar_updating_values.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
add = 1
3333
# Showing the plot
34-
display.show(plot)
34+
display.root_group = plot
3535

3636
# Creating the bar
3737
my_bar = Bar(

0 commit comments

Comments
 (0)