Skip to content

Commit fe7a6de

Browse files
authoredApr 25, 2025··
Merge pull request #7 from circuitpython/new_infrastructure_files
new infrastructure files
2 parents d43df71 + ac80b86 commit fe7a6de

28 files changed

+503
-950
lines changed
 
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# SPDX-FileCopyrightText: 2021 Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
Thank you for contributing! Before you submit a pull request, please read the following.
6+
7+
Make sure any changes you're submitting are in line with the CircuitPython Design Guide, available here: https://docs.circuitpython.org/en/latest/docs/design_guide.html
8+
9+
If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs
10+
11+
Before submitting the pull request, make sure you've run Pylint and Black locally on your code. You can do this manually or using pre-commit. Instructions are available here: https://adafru.it/check-your-code
12+
13+
Please remove all of this text before submitting. Include an explanation or list of changes included in your PR, as well as, if applicable, a link to any related issues.

‎.github/workflows/build.yml

Lines changed: 2 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -10,74 +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.7
26-
uses: actions/setup-python@v1
27-
with:
28-
python-version: 3.7
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: Load graphviz
49-
run: |
50-
sudo apt install graphviz
51-
- name: Library version
52-
run: git describe --dirty --always --tags
53-
- name: Setup problem matchers
54-
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
55-
- name: Pre-commit hooks
56-
run: |
57-
pre-commit run --all-files
58-
- name: Build assets
59-
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
60-
- name: Archive bundles
61-
uses: actions/upload-artifact@v2
62-
with:
63-
name: bundles
64-
path: ${{ github.workspace }}/bundles/
65-
- name: Check For docs folder
66-
id: need-docs
67-
run: |
68-
echo ::set-output name=docs::$( find . -wholename './docs' )
69-
- name: Build docs
70-
if: contains(steps.need-docs.outputs.docs, 'docs')
71-
working-directory: docs
72-
run: sphinx-build -E -W -b html . _build/html
73-
- name: Check For setup.py
74-
id: need-pypi
75-
run: |
76-
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
77-
- name: Build Python package
78-
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
79-
run: |
80-
pip install --upgrade setuptools wheel twine readme_renderer testresources
81-
python setup.py sdist
82-
python setup.py bdist_wheel --universal
83-
twine check dist/*
13+
- name: Run Build CI workflow
14+
uses: adafruit/workflows-circuitpython-libs/build@main

‎.github/workflows/release_gh.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 }}
19+
upload-url: ${{ github.event.release.upload_url }}
20+
# TODO: If you're creating a package (library is a folder), add this
21+
# argument along with the prefix (or full name) of the package folder
22+
# so the MPY bundles are built correctly:s
23+
# package-prefix: displayio_cartesian

‎.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 }}

‎.gitignore

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,48 @@
1-
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
1+
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
22
#
3-
# SPDX-License-Identifier: Unlicense
3+
# SPDX-License-Identifier: MIT
44

5+
# Do not include files and directories created by your personal work environment, such as the IDE
6+
# you use, except for those already listed here. Pull requests including changes to this file will
7+
# not be accepted.
8+
9+
# This .gitignore file contains rules for files generated by working with CircuitPython libraries,
10+
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
11+
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.
12+
13+
# If you find that there are files being generated on your machine that should not be included in
14+
# your git commit, you should create a .gitignore_global file on your computer to include the
15+
# files created by your personal setup. To do so, follow the two steps below.
16+
17+
# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
18+
# the files you want to exclude from git commits.
19+
20+
# Second, configure Git to use the exclude file for all Git repositories by running the
21+
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
22+
# .gitignore_global file:
23+
# git config --global core.excludesfile path/to/your/.gitignore_global
24+
25+
# CircuitPython-specific files
526
*.mpy
6-
.idea
27+
28+
# Python-specific files
729
__pycache__
8-
_build
930
*.pyc
31+
32+
# Sphinx build-specific files
33+
_build
34+
35+
# This file results from running `pip -e install .` in a local repository
36+
*.egg-info
37+
38+
# Virtual environment-specific files
1039
.env
11-
.python-version
12-
build*/
13-
bundles
40+
.venv
41+
42+
# MacOS-specific files
1443
*.DS_Store
15-
.eggs
16-
dist
17-
**/*.egg-info
44+
45+
# IDE-specific files
46+
.idea
1847
.vscode
48+
*~

‎.pre-commit-config.yaml

Lines changed: 14 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,21 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
22
#
33
# SPDX-License-Identifier: Unlicense
44

55
repos:
6-
- repo: https://github.com/python/black
7-
rev: 20.8b1
6+
- repo: https://github.com/pre-commit/pre-commit-hooks
7+
rev: v4.5.0
88
hooks:
9-
- id: black
10-
- repo: https://github.com/fsfe/reuse-tool
11-
rev: v0.12.1
9+
- id: check-yaml
10+
- id: end-of-file-fixer
11+
- id: trailing-whitespace
12+
- repo: https://github.com/astral-sh/ruff-pre-commit
13+
rev: v0.3.4
1214
hooks:
13-
- id: reuse
14-
- repo: https://github.com/pre-commit/pre-commit-hooks
15-
rev: v2.3.0
15+
- id: ruff-format
16+
- id: ruff
17+
args: ["--fix"]
18+
- repo: https://github.com/fsfe/reuse-tool
19+
rev: v3.0.1
1620
hooks:
17-
- id: check-yaml
18-
- id: end-of-file-fixer
19-
- id: trailing-whitespace
20-
- repo: https://github.com/pycqa/pylint
21-
rev: pylint-2.7.1
22-
hooks:
23-
- id: pylint
24-
name: pylint (library code)
25-
types: [python]
26-
exclude: "^(docs/|examples/|tests/|setup.py$)"
27-
- repo: local
28-
hooks:
29-
- id: pylint_examples
30-
name: pylint (examples code)
31-
description: Run pylint rules on "examples/*.py" files
32-
entry: /usr/bin/env bash -c
33-
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
34-
language: system
35-
- id: pylint_tests
36-
name: pylint (tests code)
37-
description: Run pylint rules on "tests/*.py" files
38-
entry: /usr/bin/env bash -c
39-
args: ['([[ ! -d "tests" ]] || for test in $(find . -path "./tests/*.py"); do pylint --disable=missing-docstring $test; done)']
40-
language: system
21+
- id: reuse

‎.pylintrc

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

‎.readthedocs.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
# Read the Docs configuration file
6+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
7+
8+
# Required
9+
version: 2
10+
11+
sphinx:
12+
configuration: docs/conf.py
13+
14+
build:
15+
os: ubuntu-lts-latest
16+
tools:
17+
python: "3"
18+
19+
python:
20+
install:
21+
- requirements: docs/requirements.txt
22+
- requirements: requirements.txt

‎.readthedocs.yml

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

‎CODE_OF_CONDUCT.md

Lines changed: 56 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!--
22
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
3-
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
3+
SPDX-FileCopyrightText: 2019-2021 Kattni Rembor
44
55
SPDX-License-Identifier: CC-BY-4.0
66
-->
7-
# Adafruit Community Code of Conduct
7+
# CircuitPython Community Code of Conduct
88

99
## Our Pledge
1010

@@ -20,33 +20,52 @@ race, religion, or sexual identity and orientation.
2020
We are committed to providing a friendly, safe and welcoming environment for
2121
all.
2222

23-
Examples of behavior that contributes to creating a positive environment
23+
Examples of behavior that contributes to creating and maintaining a positive environment
2424
include:
2525

2626
* Be kind and courteous to others
2727
* Using welcoming and inclusive language
28+
* Respecting the identity of every community member, including asking for their
29+
pronouns if uncertain
2830
* Being respectful of differing viewpoints and experiences
2931
* Collaborating with other community members
32+
* Providing desired assistance and knowledge to other community members
33+
* Being open to new information and ideas
3034
* Gracefully accepting constructive criticism
3135
* Focusing on what is best for the community
3236
* Showing empathy towards other community members
3337

34-
Examples of unacceptable behavior by participants include:
38+
Examples of unacceptable behavior by community members include:
3539

3640
* The use of sexualized language or imagery and sexual attention or advances
3741
* The use of inappropriate images, including in a community member's avatar
38-
* The use of inappropriate language, including in a community member's nickname
42+
* The use of inappropriate language or profanity, including in a community member's nickname
3943
* Any spamming, flaming, baiting or other attention-stealing behavior
4044
* Excessive or unwelcome helping; answering outside the scope of the question
4145
asked
42-
* Trolling, insulting/derogatory comments, and personal or political attacks
46+
* Discussion or promotion of activities or projects that intend or pose a risk of
47+
significant harm
48+
* Trolling, insulting/derogatory comments, and attacks of any nature (including,
49+
but not limited to, personal or political attacks)
4350
* Promoting or spreading disinformation, lies, or conspiracy theories against
4451
a person, group, organisation, project, or community
4552
* Public or private harassment
4653
* Publishing others' private information, such as a physical or electronic
4754
address, without explicit permission
55+
* Engaging in behavior that creates an unwelcoming or uninclusive environment
4856
* Other conduct which could reasonably be considered inappropriate
4957

58+
The CircuitPython Community welcomes everyone and strives to create a safe space for all. It is built
59+
around sharing and contributing to technology. We encourage discussing your thoughts, experiences,
60+
and feelings within the scope of the community. However, there are topics that can sometimes stray
61+
from that scope, and can lead to hurting others and create an unwelcoming, uninclusive environment.
62+
63+
Examples of discussion topics that have been known to stray outside the scope of the CircuitPython
64+
Community include, but are not limited to:
65+
66+
* Discussions regarding religion and related topics
67+
* Discussions regarding politics and related topics
68+
5069
The goal of the standards and moderation guidelines outlined here is to build
5170
and maintain a respectful community. We ask that you don’t just aim to be
5271
"technically unimpeachable", but rather try to be your best self.
@@ -70,51 +89,51 @@ inappropriate, threatening, offensive, or harmful.
7089

7190
## Moderation
7291

73-
Instances of behaviors that violate the Adafruit Community Code of Conduct
92+
Instances of behaviors that violate the CircuitPython Community Code of Conduct
7493
may be reported by any member of the community. Community members are
7594
encouraged to report these situations, including situations they witness
7695
involving other community members.
7796

7897
You may report in the following ways:
7998

80-
In any situation, you may send an email to <support@adafruit.com>.
99+
In any situation, you may email the project maintainer.
81100

82-
On the Adafruit Discord, you may send an open message from any channel
83-
to all Community Moderators by tagging @community moderators. You may
84-
also send an open message from any channel, or a direct message to
85-
@kattni#1507, @tannewt#4653, @danh#1614, @cater#2442,
86-
@sommersoft#0222, @Mr. Certainly#0472 or @Andon#8175.
101+
The source of email and direct message reports will be kept confidential.
87102

88-
Email and direct message reports will be kept confidential.
89-
90-
In situations on Discord where the issue is particularly egregious, possibly
91-
illegal, requires immediate action, or violates the Discord terms of service,
92-
you should also report the message directly to Discord.
103+
In situations on GitHub where the issue is particularly offensive, possibly
104+
illegal, requires immediate action, or violates the GitHub terms of service,
105+
you should also report the message directly to GitHub via the comment, or via
106+
[GitHub Support](https://support.github.com/contact/report-abuse?category=report-abuse&report=other&report_type=unspecified).
93107

94108
These are the steps for upholding our community’s standards of conduct.
95109

96110
1. Any member of the community may report any situation that violates the
97-
Adafruit Community Code of Conduct. All reports will be reviewed and
98-
investigated.
99-
2. If the behavior is an egregious violation, the community member who
100-
committed the violation may be banned immediately, without warning.
111+
CircuitPython Community Code of Conduct. All reports will be reviewed and
112+
investigated.
113+
2. If the behavior is a severe violation, the community member who
114+
committed the violation may be banned immediately, without warning.
101115
3. Otherwise, moderators will first respond to such behavior with a warning.
102116
4. Moderators follow a soft "three strikes" policy - the community member may
103-
be given another chance, if they are receptive to the warning and change their
104-
behavior.
117+
be given another chance, if they are receptive to the warning and change their
118+
behavior.
105119
5. If the community member is unreceptive or unreasonable when warned by a
106-
moderator, or the warning goes unheeded, they may be banned for a first or
107-
second offense. Repeated offenses will result in the community member being
108-
banned.
120+
moderator, or the warning goes unheeded, they may be banned for a first or
121+
second offense. Repeated offenses will result in the community member being
122+
banned.
123+
6. Disciplinary actions (warnings, bans, etc) for Code of Conduct violations apply
124+
to the platform where the violation occurred. However, depending on the severity
125+
of the violation, the disciplinary action may be applied across CircuitPython's
126+
other community platforms. For example, a severe violation in one Community forum
127+
may result in a ban on not only the CircuitPython GitHub organisation,
128+
but also on the CircuitPython Twitter, live stream text chats, etc.
109129

110130
## Scope
111131

112132
This Code of Conduct and the enforcement policies listed above apply to all
113-
Adafruit Community venues. This includes but is not limited to any community
114-
spaces (both public and private), the entire Adafruit Discord server, and
115-
Adafruit GitHub repositories. Examples of Adafruit Community spaces include
116-
but are not limited to meet-ups, audio chats on the Adafruit Discord, or
117-
interaction at a conference.
133+
CircuitPython Community venues. This includes but is not limited to any community
134+
spaces (both public and private), and CircuitPython GitHub repositories. Examples of
135+
CircuitPython Community spaces include but are not limited to meet-ups, issue
136+
threads on GitHub, text chats during a live stream, or interaction at a conference.
118137

119138
This Code of Conduct applies both within project spaces and in public spaces
120139
when an individual is representing the project or its community. As a community
@@ -123,15 +142,14 @@ accordingly.
123142

124143
## Attribution
125144

126-
This Code of Conduct is adapted from the [Contributor Covenant],
127-
version 1.4, available at
128-
<https://www.contributor-covenant.org/version/1/4/code-of-conduct.html>,
145+
This Code of Conduct is adapted from the
146+
[Adafruit Community Code of Conduct](https://github.com/adafruit/Adafruit_Community_Code_of_Conduct),
147+
which is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/),
148+
version 1.4, available on [contributor-covenant.org](https://www.contributor-covenant.org/version/1/4/code-of-conduct.html),
129149
and the [Rust Code of Conduct](https://www.rust-lang.org/en-US/conduct.html).
130150

131-
For other projects adopting the Adafruit Community Code of
151+
For other projects adopting the CircuitPython Community Code of
132152
Conduct, please contact the maintainers of those projects for enforcement.
133153
If you wish to use this code of conduct for your own project, consider
134154
explicitly mentioning your moderation policy or making a copy with your
135155
own moderation policy so as to avoid confusion.
136-
137-
[Contributor Covenant]: https://www.contributor-covenant.org

‎README.rst

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ Introduction
22
============
33

44

5-
.. image:: https://readthedocs.org/projects/circuitpython-displayio_cartesian/badge/?version=latest
6-
:target: https://circuitpython-displayio_cartesian.readthedocs.io/
5+
.. image:: https://readthedocs.org/projects/circuitpython-displayio-cartesian/badge/?version=latest
6+
:target: https://circuitpython-displayio-cartesian.readthedocs.io/
77
:alt: Documentation Status
88

99

@@ -17,11 +17,11 @@ Introduction
1717
:alt: Build Status
1818

1919

20-
.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
21-
:target: https://github.com/psf/black
22-
:alt: Code Style: Black
20+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
21+
:target: https://github.com/astral-sh/ruff
22+
:alt: Code Style: Ruff
2323

24-
A cartesian plane widget for displaying graphical information.
24+
A Cartesian plane widget for displaying graphical information.
2525

2626

2727
Dependencies
@@ -40,7 +40,7 @@ Installing from PyPI
4040
=====================
4141

4242
On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally `from
43-
PyPI <https://pypi.org/project/circuitpython-displayio_cartesian/>`_.
43+
PyPI <https://pypi.org/project/circuitpython-displayio-cartesian/>`_.
4444
To install for current user:
4545

4646
.. code-block:: shell
@@ -58,26 +58,48 @@ To install in a virtual environment in your current project:
5858
.. code-block:: shell
5959
6060
mkdir project-name && cd project-name
61-
python3 -m venv .env
61+
python3 -m venv .venv
6262
source .env/bin/activate
6363
pip3 install circuitpython-displayio-cartesian
6464
65+
Installing to a Connected CircuitPython Device with Circup
66+
==========================================================
6567

68+
Make sure that you have ``circup`` installed in your Python environment.
69+
Install it with the following command if necessary:
70+
71+
.. code-block:: shell
72+
73+
pip3 install circup
74+
75+
With ``circup`` installed and your CircuitPython device connected use the
76+
following command to install:
77+
78+
.. code-block:: shell
79+
80+
circup install displayio_cartesian
81+
82+
Or the following command to update an existing version:
83+
84+
.. code-block:: shell
85+
86+
circup update
6687
6788
Usage Example
6889
=============
6990

7091
See scripts in the examples directory of this repository.
7192

93+
Documentation
94+
=============
95+
API documentation for this library can be found on `Read the Docs <https://circuitpython-displayio-cartesian.readthedocs.io/>`_.
96+
97+
For information on building library documentation, please check out
98+
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
99+
72100
Contributing
73101
============
74102

75103
Contributions are welcome! Please read our `Code of Conduct
76104
<https://github.com/circuitpython/CircuitPython_Org_DisplayIO_Cartesian/blob/HEAD/CODE_OF_CONDUCT.md>`_
77105
before contributing to help this project stay welcoming.
78-
79-
Documentation
80-
=============
81-
82-
For information on building library documentation, please check out
83-
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

‎README.rst.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
2+
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
33
SPDX-License-Identifier: MIT

‎displayio_cartesian.py

Lines changed: 75 additions & 192 deletions
Large diffs are not rendered by default.

‎docs/api.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
55
.. use this format as the module name: "adafruit_foo.foo"
66
7+
API Reference
8+
#############
9+
710
.. automodule:: displayio_cartesian
811
:members:
912
:member-order: bysource
1013
:inherited-members:
11-
12-
.. inheritance-diagram:: displayio_cartesian

‎docs/conf.py

Lines changed: 20 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
# -*- coding: utf-8 -*-
2-
31
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
42
#
53
# SPDX-License-Identifier: MIT
64

5+
import datetime
76
import os
87
import sys
98

@@ -16,21 +15,22 @@
1615
# ones.
1716
extensions = [
1817
"sphinx.ext.autodoc",
18+
"sphinxcontrib.jquery",
1919
"sphinx.ext.intersphinx",
2020
"sphinx.ext.napoleon",
2121
"sphinx.ext.todo",
22-
"sphinx.ext.inheritance_diagram",
2322
]
2423

2524
# Uncomment the below if you use native CircuitPython modules such as
2625
# digitalio, micropython and busio. List the modules you use. Without it, the
2726
# autodoc module docs will fail to generate with a warning.
2827
autodoc_mock_imports = ["vectorio", "bitmaptools"]
2928

29+
autodoc_preserve_defaults = True
3030

3131
intersphinx_mapping = {
32-
"python": ("https://docs.python.org/3.4", None),
33-
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
32+
"python": ("https://docs.python.org/3", None),
33+
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
3434
}
3535

3636
# Show the docstring from both the class and its __init__() method.
@@ -45,8 +45,13 @@
4545
master_doc = "index"
4646

4747
# General information about the project.
48-
project = " CircuitPython DisplayIO_Cartesian Library"
49-
copyright = "2021 Jose David M."
48+
project = "CircuitPython DisplayIO_Cartesian Library"
49+
creation_year = "2025"
50+
current_year = str(datetime.datetime.now().year)
51+
year_duration = (
52+
current_year if current_year == creation_year else creation_year + " - " + current_year
53+
)
54+
copyright = year_duration + " Jose David M."
5055
author = "Jose David M."
5156

5257
# The version info for the project you're documenting, acts as replacement for
@@ -63,7 +68,7 @@
6368
#
6469
# This is also used if you do content translation via gettext catalogs.
6570
# Usually you set "language" from the command line for these cases.
66-
language = None
71+
language = "en"
6772

6873
# List of patterns, relative to source directory, that match files and
6974
# directories to ignore when looking for source files.
@@ -101,19 +106,9 @@
101106
# The theme to use for HTML and HTML Help pages. See the documentation for
102107
# a list of builtin themes.
103108
#
104-
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
105-
106-
if not on_rtd: # only import and set the theme if we're building docs locally
107-
try:
108-
import sphinx_rtd_theme
109+
import sphinx_rtd_theme
109110

110-
html_theme = "sphinx_rtd_theme"
111-
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
112-
except:
113-
html_theme = "default"
114-
html_theme_path = ["."]
115-
else:
116-
html_theme_path = ["."]
111+
html_theme = "sphinx_rtd_theme"
117112

118113
# Add any paths that contain custom static files (such as style sheets) here,
119114
# relative to this directory. They are copied after the builtin static files,
@@ -127,7 +122,7 @@
127122
html_favicon = "_static/favicon.ico"
128123

129124
# Output file base name for HTML help builder.
130-
htmlhelp_basename = "CircuitPython_Displayio_cartesianLibrarydoc"
125+
htmlhelp_basename = "CircuitPython_Displayio_cartesian_Librarydoc"
131126

132127
# -- Options for LaTeX output ---------------------------------------------
133128

@@ -148,7 +143,7 @@
148143
latex_documents = [
149144
(
150145
master_doc,
151-
"CircuitPython_DisplayIO_CartesianLibrary.tex",
146+
"CircuitPython_DisplayIO_Cartesian_Library.tex",
152147
"CircuitPython DisplayIO_Cartesian Library Documentation",
153148
author,
154149
"manual",
@@ -162,7 +157,7 @@
162157
man_pages = [
163158
(
164159
master_doc,
165-
"CircuitPython_DisplayIO_CartesianLibrary",
160+
"CircuitPython_DisplayIO_Cartesian_Library",
166161
"CircuitPython DisplayIO_Cartesian Library Documentation",
167162
[author],
168163
1,
@@ -177,10 +172,10 @@
177172
texinfo_documents = [
178173
(
179174
master_doc,
180-
"CircuitPython_DisplayIO_CartesianLibrary",
175+
"CircuitPython_DisplayIO_Cartesian_Library",
181176
"CircuitPython DisplayIO_Cartesian Library Documentation",
182177
author,
183-
"CircuitPython_DisplayIO_CartesianLibrary",
178+
"CircuitPython_DisplayIO_Cartesian_Library",
184179
"One line description of project.",
185180
"Miscellaneous",
186181
),

‎docs/examples.rst.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
2+
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
33

44
SPDX-License-Identifier: MIT

‎docs/index.rst

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ Table of Contents
3030
.. toctree::
3131
:caption: Other Links
3232

33-
Download <https://github.com/circuitpython/CircuitPython_DisplayIO_Cartesian/releases/latest>
34-
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
33+
Download from GitHub <https://github.com/circuitpython/CircuitPython_Org_DisplayIO_Cartesian/releases/latest>
34+
Download Library Bundle <https://circuitpython.org/libraries>
35+
CircuitPython Reference Documentation <https://docs.circuitpython.org>
3536
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
3637
Discord Chat <https://adafru.it/discord>
3738
Adafruit Learning System <https://learn.adafruit.com>

‎docs/index.rst.license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
2+
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
33

44
SPDX-License-Identifier: MIT

‎docs/requirements.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense
4+
5+
sphinx
6+
sphinxcontrib-jquery
7+
sphinx-rtd-theme

‎examples/displayio_cartesian_advanced_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import board
1111
import displayio
1212
import terminalio
13+
1314
from displayio_cartesian import Cartesian
1415

1516
# Fonts used for the Dial tick labels

‎examples/displayio_cartesian_lineplot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,10 @@
77
"""
88

99
import time
10+
1011
import board
1112
import displayio
13+
1214
from displayio_cartesian import Cartesian
1315

1416
# create the display on the PyPortal or Clue or PyBadge(for example)
Lines changed: 3 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,4 @@
1-
# SPDX-FileCopyrightText: 2021 Jose David M.
1+
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
23
#
3-
# SPDX-License-Identifier: MIT
4-
#############################
5-
"""
6-
This is a basic demonstration of a Cartesian widget.
7-
"""
8-
9-
import time
10-
import board
11-
import displayio
12-
import terminalio
13-
from displayio_cartesian import Cartesian
14-
15-
# Fonts used for the Dial tick labels
16-
tick_font = terminalio.FONT
17-
18-
display = board.DISPLAY # create the display on the PyPortal or Clue (for example)
19-
# otherwise change this to setup the display
20-
# for display chip driver and pinout you have (e.g. ILI9341)
21-
22-
23-
# Create a Cartesian widget
24-
my_plane = Cartesian(
25-
x=150, # x position for the plane
26-
y=100, # y plane position
27-
width=100, # display width
28-
height=100, # display height
29-
axes_color=0xFFFFFF, # axes line color
30-
axes_stroke=2, # axes lines width in pixels
31-
tick_color=0xFFFFFF, # ticks color
32-
major_tick_stroke=1, # ticks width in pixels
33-
major_tick_length=5, # ticks length in pixels
34-
tick_label_font=tick_font, # the font used for the tick labels
35-
font_color=0xFFFFFF, # ticks line color
36-
)
37-
38-
my_group = displayio.Group()
39-
my_group.append(my_plane)
40-
display.show(my_group) # add high level Group to the display
41-
42-
posx = 0
43-
posy = 0
44-
45-
while True:
46-
for i in range(0, 90, 2):
47-
my_plane.update_pointer(i, i)
48-
time.sleep(0.5)
4+
# SPDX-License-Identifier: Unlicense

‎examples/displayio_cartesion_fillarea.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,12 @@
66
This is a basic demonstration of a Cartesian widget for line-ploting
77
"""
88

9+
import random
910
import time
11+
1012
import board
1113
import displayio
12-
import random
14+
1315
from displayio_cartesian import Cartesian
1416

1517
# create the display on the PyPortal or Clue or PyBadge(for example)

‎optional_requirements.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: Unlicense

‎pyproject.toml

Lines changed: 52 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,54 @@
1-
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
1+
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
2+
# SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
23
#
3-
# SPDX-License-Identifier: Unlicense
4+
# SPDX-License-Identifier: MIT
45

5-
[tool.black]
6-
target-version = ['py35']
6+
[build-system]
7+
requires = [
8+
"setuptools",
9+
"wheel",
10+
"setuptools-scm",
11+
]
12+
13+
[project]
14+
name = "circuitpython-displayio-cartesian"
15+
description = "A Cartesian plane widget for displaying graphical information."
16+
version = "0.0.0+auto.0"
17+
readme = "README.rst"
18+
authors = [
19+
{name = "Jose David M."}
20+
]
21+
urls = {Homepage = "https://github.com/circuitpython/CircuitPython_DisplayIO_Cartesian"}
22+
keywords = [
23+
"adafruit",
24+
"blinka",
25+
"circuitpython",
26+
"micropython",
27+
"displayio_cartesian",
28+
"displayio",
29+
"widget",
30+
"graphics",
31+
"gui",
32+
"graph",
33+
"chart",
34+
"graphic",
35+
]
36+
license = {text = "MIT"}
37+
classifiers = [
38+
"Intended Audience :: Developers",
39+
"Topic :: Software Development :: Libraries",
40+
"Topic :: Software Development :: Embedded Systems",
41+
"Topic :: System :: Hardware",
42+
"License :: OSI Approved :: MIT License",
43+
"Programming Language :: Python :: 3",
44+
]
45+
dynamic = ["dependencies", "optional-dependencies"]
46+
47+
[tool.setuptools]
48+
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
49+
# CHANGE `py_modules = ['...']` TO `packages = ['...']`
50+
py-modules = ["displayio_cartesian"]
51+
52+
[tool.setuptools.dynamic]
53+
dependencies = {file = ["requirements.txt"]}
54+
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}

‎requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2-
# SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
2+
# SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
33
#
44
# SPDX-License-Identifier: MIT
55

‎ruff.toml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries
2+
#
3+
# SPDX-License-Identifier: MIT
4+
5+
target-version = "py38"
6+
line-length = 100
7+
8+
[lint]
9+
preview = true
10+
select = ["I", "PL", "UP"]
11+
12+
extend-select = [
13+
"D419", # empty-docstring
14+
"E501", # line-too-long
15+
"W291", # trailing-whitespace
16+
"PLC0414", # useless-import-alias
17+
"PLC2401", # non-ascii-name
18+
"PLC2801", # unnecessary-dunder-call
19+
"PLC3002", # unnecessary-direct-lambda-call
20+
"E999", # syntax-error
21+
"PLE0101", # return-in-init
22+
"F706", # return-outside-function
23+
"F704", # yield-outside-function
24+
"PLE0116", # continue-in-finally
25+
"PLE0117", # nonlocal-without-binding
26+
"PLE0241", # duplicate-bases
27+
"PLE0302", # unexpected-special-method-signature
28+
"PLE0604", # invalid-all-object
29+
"PLE0605", # invalid-all-format
30+
"PLE0643", # potential-index-error
31+
"PLE0704", # misplaced-bare-raise
32+
"PLE1141", # dict-iter-missing-items
33+
"PLE1142", # await-outside-async
34+
"PLE1205", # logging-too-many-args
35+
"PLE1206", # logging-too-few-args
36+
"PLE1307", # bad-string-format-type
37+
"PLE1310", # bad-str-strip-call
38+
"PLE1507", # invalid-envvar-value
39+
"PLE2502", # bidirectional-unicode
40+
"PLE2510", # invalid-character-backspace
41+
"PLE2512", # invalid-character-sub
42+
"PLE2513", # invalid-character-esc
43+
"PLE2514", # invalid-character-nul
44+
"PLE2515", # invalid-character-zero-width-space
45+
"PLR0124", # comparison-with-itself
46+
"PLR0202", # no-classmethod-decorator
47+
"PLR0203", # no-staticmethod-decorator
48+
"UP004", # useless-object-inheritance
49+
"PLR0206", # property-with-parameters
50+
"PLR0904", # too-many-public-methods
51+
"PLR0911", # too-many-return-statements
52+
"PLR0912", # too-many-branches
53+
"PLR0913", # too-many-arguments
54+
"PLR0914", # too-many-locals
55+
"PLR0915", # too-many-statements
56+
"PLR0916", # too-many-boolean-expressions
57+
"PLR1702", # too-many-nested-blocks
58+
"PLR1704", # redefined-argument-from-local
59+
"PLR1711", # useless-return
60+
"C416", # unnecessary-comprehension
61+
"PLR1733", # unnecessary-dict-index-lookup
62+
"PLR1736", # unnecessary-list-index-lookup
63+
64+
# ruff reports this rule is unstable
65+
#"PLR6301", # no-self-use
66+
67+
"PLW0108", # unnecessary-lambda
68+
"PLW0120", # useless-else-on-loop
69+
"PLW0127", # self-assigning-variable
70+
"PLW0129", # assert-on-string-literal
71+
"B033", # duplicate-value
72+
"PLW0131", # named-expr-without-context
73+
"PLW0245", # super-without-brackets
74+
"PLW0406", # import-self
75+
"PLW0602", # global-variable-not-assigned
76+
"PLW0603", # global-statement
77+
"PLW0604", # global-at-module-level
78+
79+
# fails on the try: import typing used by libraries
80+
#"F401", # unused-import
81+
82+
"F841", # unused-variable
83+
"E722", # bare-except
84+
"PLW0711", # binary-op-exception
85+
"PLW1501", # bad-open-mode
86+
"PLW1508", # invalid-envvar-default
87+
"PLW1509", # subprocess-popen-preexec-fn
88+
"PLW2101", # useless-with-lock
89+
"PLW3301", # nested-min-max
90+
]
91+
92+
ignore = [
93+
"PLR2004", # magic-value-comparison
94+
"UP030", # format literals
95+
"PLW1514", # unspecified-encoding
96+
"PLR0913", # too many arguments
97+
"PLR0917", # too many positional arguments
98+
"PLR0915", # too many statements
99+
]
100+
101+
[format]
102+
line-ending = "lf"

‎setup.py

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

0 commit comments

Comments
 (0)
Please sign in to comment.