Skip to content

new infrastructure files #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 25, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# SPDX-FileCopyrightText: 2021 Adafruit Industries
#
# SPDX-License-Identifier: MIT

Thank you for contributing! Before you submit a pull request, please read the following.

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

If your changes are to documentation, please verify that the documentation builds locally by following the steps found here: https://adafru.it/build-docs

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

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.
73 changes: 2 additions & 71 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -10,74 +10,5 @@ jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Dump GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- name: Translate Repo Name For Build Tools filename_prefix
id: repo-name
run: |
echo ::set-output name=repo-name::$(
echo ${{ github.repository }} |
awk -F '\/' '{ print tolower($2) }' |
tr '_' '-'
)
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Versions
run: |
python3 --version
- name: Checkout Current Repo
uses: actions/checkout@v1
with:
submodules: true
- name: Checkout tools repo
uses: actions/checkout@v2
with:
repository: adafruit/actions-ci-circuitpython-libs
path: actions-ci
- name: Install dependencies
# (e.g. - apt-get: gettext, etc; pip: circuitpython-build-tools, requirements.txt; etc.)
run: |
source actions-ci/install.sh
- name: Pip install pylint, Sphinx, pre-commit
run: |
pip install --force-reinstall pylint Sphinx sphinx-rtd-theme pre-commit
- name: Load graphviz
run: |
sudo apt install graphviz
- name: Library version
run: git describe --dirty --always --tags
- name: Setup problem matchers
uses: adafruit/circuitpython-action-library-ci-problem-matchers@v1
- name: Pre-commit hooks
run: |
pre-commit run --all-files
- name: Build assets
run: circuitpython-build-bundles --filename_prefix ${{ steps.repo-name.outputs.repo-name }} --library_location .
- name: Archive bundles
uses: actions/upload-artifact@v2
with:
name: bundles
path: ${{ github.workspace }}/bundles/
- name: Check For docs folder
id: need-docs
run: |
echo ::set-output name=docs::$( find . -wholename './docs' )
- name: Build docs
if: contains(steps.need-docs.outputs.docs, 'docs')
working-directory: docs
run: sphinx-build -E -W -b html . _build/html
- name: Check For setup.py
id: need-pypi
run: |
echo ::set-output name=setup-py::$( find . -wholename './setup.py' )
- name: Build Python package
if: contains(steps.need-pypi.outputs.setup-py, 'setup.py')
run: |
pip install --upgrade setuptools wheel twine readme_renderer testresources
python setup.py sdist
python setup.py bdist_wheel --universal
twine check dist/*
- name: Run Build CI workflow
uses: adafruit/workflows-circuitpython-libs/build@main
23 changes: 23 additions & 0 deletions .github/workflows/release_gh.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

name: GitHub Release Actions

on:
release:
types: [published]

jobs:
upload-release-assets:
runs-on: ubuntu-latest
steps:
- name: Run GitHub Release CI workflow
uses: adafruit/workflows-circuitpython-libs/release-gh@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
upload-url: ${{ github.event.release.upload_url }}
# TODO: If you're creating a package (library is a folder), add this
# argument along with the prefix (or full name) of the package folder
# so the MPY bundles are built correctly:s
# package-prefix: displayio_cartesian
19 changes: 19 additions & 0 deletions .github/workflows/release_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

name: PyPI Release Actions

on:
release:
types: [published]

jobs:
upload-release-assets:
runs-on: ubuntu-latest
steps:
- name: Run PyPI Release CI workflow
uses: adafruit/workflows-circuitpython-libs/release-pypi@main
with:
pypi-username: ${{ secrets.pypi_username }}
pypi-password: ${{ secrets.pypi_password }}
50 changes: 40 additions & 10 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,18 +1,48 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: 2022 Kattni Rembor, written for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
# SPDX-License-Identifier: MIT

# Do not include files and directories created by your personal work environment, such as the IDE
# you use, except for those already listed here. Pull requests including changes to this file will
# not be accepted.

# This .gitignore file contains rules for files generated by working with CircuitPython libraries,
# including building Sphinx, testing with pip, and creating a virual environment, as well as the
# MacOS and IDE-specific files generated by using MacOS in general, or the PyCharm or VSCode IDEs.

# If you find that there are files being generated on your machine that should not be included in
# your git commit, you should create a .gitignore_global file on your computer to include the
# files created by your personal setup. To do so, follow the two steps below.

# First, create a file called .gitignore_global somewhere convenient for you, and add rules for
# the files you want to exclude from git commits.

# Second, configure Git to use the exclude file for all Git repositories by running the
# following via commandline, replacing "path/to/your/" with the actual path to your newly created
# .gitignore_global file:
# git config --global core.excludesfile path/to/your/.gitignore_global

# CircuitPython-specific files
*.mpy
.idea

# Python-specific files
__pycache__
_build
*.pyc

# Sphinx build-specific files
_build

# This file results from running `pip -e install .` in a local repository
*.egg-info

# Virtual environment-specific files
.env
.python-version
build*/
bundles
.venv

# MacOS-specific files
*.DS_Store
.eggs
dist
**/*.egg-info

# IDE-specific files
.idea
.vscode
*~
47 changes: 14 additions & 33 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,21 @@
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
# SPDX-FileCopyrightText: 2024 Justin Myers for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

repos:
- repo: https://github.com/python/black
rev: 20.8b1
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
hooks:
- id: black
- repo: https://github.com/fsfe/reuse-tool
rev: v0.12.1
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
hooks:
- id: reuse
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.3.0
- id: ruff-format
- id: ruff
args: ["--fix"]
- repo: https://github.com/fsfe/reuse-tool
rev: v3.0.1
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/pycqa/pylint
rev: pylint-2.7.1
hooks:
- id: pylint
name: pylint (library code)
types: [python]
exclude: "^(docs/|examples/|tests/|setup.py$)"
- repo: local
hooks:
- id: pylint_examples
name: pylint (examples code)
description: Run pylint rules on "examples/*.py" files
entry: /usr/bin/env bash -c
args: ['([[ ! -d "examples" ]] || for example in $(find . -path "./examples/*.py"); do pylint --disable=missing-docstring,invalid-name $example; done)']
language: system
- id: pylint_tests
name: pylint (tests code)
description: Run pylint rules on "tests/*.py" files
entry: /usr/bin/env bash -c
args: ['([[ ! -d "tests" ]] || for test in $(find . -path "./tests/*.py"); do pylint --disable=missing-docstring $test; done)']
language: system
- id: reuse
436 changes: 0 additions & 436 deletions .pylintrc

This file was deleted.

22 changes: 22 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# SPDX-FileCopyrightText: 2021 Melissa LeBlanc-Williams for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

sphinx:
configuration: docs/conf.py

build:
os: ubuntu-lts-latest
tools:
python: "3"

python:
install:
- requirements: docs/requirements.txt
- requirements: requirements.txt
7 changes: 0 additions & 7 deletions .readthedocs.yml

This file was deleted.

94 changes: 56 additions & 38 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<!--
SPDX-FileCopyrightText: 2014 Coraline Ada Ehmke
SPDX-FileCopyrightText: 2019 Kattni Rembor for Adafruit Industries
SPDX-FileCopyrightText: 2019-2021 Kattni Rembor
SPDX-License-Identifier: CC-BY-4.0
-->
# Adafruit Community Code of Conduct
# CircuitPython Community Code of Conduct

## Our Pledge

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

Examples of behavior that contributes to creating a positive environment
Examples of behavior that contributes to creating and maintaining a positive environment
include:

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

Examples of unacceptable behavior by participants include:
Examples of unacceptable behavior by community members include:

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

The CircuitPython Community welcomes everyone and strives to create a safe space for all. It is built
around sharing and contributing to technology. We encourage discussing your thoughts, experiences,
and feelings within the scope of the community. However, there are topics that can sometimes stray
from that scope, and can lead to hurting others and create an unwelcoming, uninclusive environment.

Examples of discussion topics that have been known to stray outside the scope of the CircuitPython
Community include, but are not limited to:

* Discussions regarding religion and related topics
* Discussions regarding politics and related topics

The goal of the standards and moderation guidelines outlined here is to build
and maintain a respectful community. We ask that you don’t just aim to be
"technically unimpeachable", but rather try to be your best self.
@@ -70,51 +89,51 @@ inappropriate, threatening, offensive, or harmful.

## Moderation

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

You may report in the following ways:

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

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

Email and direct message reports will be kept confidential.

In situations on Discord where the issue is particularly egregious, possibly
illegal, requires immediate action, or violates the Discord terms of service,
you should also report the message directly to Discord.
In situations on GitHub where the issue is particularly offensive, possibly
illegal, requires immediate action, or violates the GitHub terms of service,
you should also report the message directly to GitHub via the comment, or via
[GitHub Support](https://support.github.com/contact/report-abuse?category=report-abuse&report=other&report_type=unspecified).

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

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

## Scope

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

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

## Attribution

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

For other projects adopting the Adafruit Community Code of
For other projects adopting the CircuitPython Community Code of
Conduct, please contact the maintainers of those projects for enforcement.
If you wish to use this code of conduct for your own project, consider
explicitly mentioning your moderation policy or making a copy with your
own moderation policy so as to avoid confusion.

[Contributor Covenant]: https://www.contributor-covenant.org
50 changes: 36 additions & 14 deletions README.rst
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@ Introduction
============


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


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


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

A cartesian plane widget for displaying graphical information.
A Cartesian plane widget for displaying graphical information.


Dependencies
@@ -40,7 +40,7 @@ Installing from PyPI
=====================

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

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

Make sure that you have ``circup`` installed in your Python environment.
Install it with the following command if necessary:

.. code-block:: shell
pip3 install circup
With ``circup`` installed and your CircuitPython device connected use the
following command to install:

.. code-block:: shell
circup install displayio_cartesian
Or the following command to update an existing version:

.. code-block:: shell
circup update
Usage Example
=============

See scripts in the examples directory of this repository.

Documentation
=============
API documentation for this library can be found on `Read the Docs <https://circuitpython-displayio-cartesian.readthedocs.io/>`_.

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.

Contributing
============

Contributions are welcome! Please read our `Code of Conduct
<https://github.com/circuitpython/CircuitPython_Org_DisplayIO_Cartesian/blob/HEAD/CODE_OF_CONDUCT.md>`_
before contributing to help this project stay welcoming.

Documentation
=============

For information on building library documentation, please check out
`this guide <https://learn.adafruit.com/creating-and-sharing-a-circuitpython-library/sharing-our-docs-on-readthedocs#sphinx-5-1>`_.
2 changes: 1 addition & 1 deletion README.rst.license
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
SPDX-License-Identifier: MIT
267 changes: 75 additions & 192 deletions displayio_cartesian.py

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions docs/api.rst
Original file line number Diff line number Diff line change
@@ -4,9 +4,10 @@
.. If your library file(s) are nested in a directory (e.g. /adafruit_foo/foo.py)
.. use this format as the module name: "adafruit_foo.foo"
API Reference
#############

.. automodule:: displayio_cartesian
:members:
:member-order: bysource
:inherited-members:

.. inheritance-diagram:: displayio_cartesian
45 changes: 20 additions & 25 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# -*- coding: utf-8 -*-

# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
#
# SPDX-License-Identifier: MIT

import datetime
import os
import sys

@@ -16,21 +15,22 @@
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinxcontrib.jquery",
"sphinx.ext.intersphinx",
"sphinx.ext.napoleon",
"sphinx.ext.todo",
"sphinx.ext.inheritance_diagram",
]

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

autodoc_preserve_defaults = True

intersphinx_mapping = {
"python": ("https://docs.python.org/3.4", None),
"CircuitPython": ("https://circuitpython.readthedocs.io/en/latest/", None),
"python": ("https://docs.python.org/3", None),
"CircuitPython": ("https://docs.circuitpython.org/en/latest/", None),
}

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

# General information about the project.
project = " CircuitPython DisplayIO_Cartesian Library"
copyright = "2021 Jose David M."
project = "CircuitPython DisplayIO_Cartesian Library"
creation_year = "2025"
current_year = str(datetime.datetime.now().year)
year_duration = (
current_year if current_year == creation_year else creation_year + " - " + current_year
)
copyright = year_duration + " Jose David M."
author = "Jose David M."

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
@@ -101,19 +106,9 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
on_rtd = os.environ.get("READTHEDOCS", None) == "True"

if not on_rtd: # only import and set the theme if we're building docs locally
try:
import sphinx_rtd_theme
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path(), "."]
except:
html_theme = "default"
html_theme_path = ["."]
else:
html_theme_path = ["."]
html_theme = "sphinx_rtd_theme"

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

# Output file base name for HTML help builder.
htmlhelp_basename = "CircuitPython_Displayio_cartesianLibrarydoc"
htmlhelp_basename = "CircuitPython_Displayio_cartesian_Librarydoc"

# -- Options for LaTeX output ---------------------------------------------

@@ -148,7 +143,7 @@
latex_documents = [
(
master_doc,
"CircuitPython_DisplayIO_CartesianLibrary.tex",
"CircuitPython_DisplayIO_Cartesian_Library.tex",
"CircuitPython DisplayIO_Cartesian Library Documentation",
author,
"manual",
@@ -162,7 +157,7 @@
man_pages = [
(
master_doc,
"CircuitPython_DisplayIO_CartesianLibrary",
"CircuitPython_DisplayIO_Cartesian_Library",
"CircuitPython DisplayIO_Cartesian Library Documentation",
[author],
1,
@@ -177,10 +172,10 @@
texinfo_documents = [
(
master_doc,
"CircuitPython_DisplayIO_CartesianLibrary",
"CircuitPython_DisplayIO_Cartesian_Library",
"CircuitPython DisplayIO_Cartesian Library Documentation",
author,
"CircuitPython_DisplayIO_CartesianLibrary",
"CircuitPython_DisplayIO_Cartesian_Library",
"One line description of project.",
"Miscellaneous",
),
2 changes: 1 addition & 1 deletion docs/examples.rst.license
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython

SPDX-License-Identifier: MIT
5 changes: 3 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -30,8 +30,9 @@ Table of Contents
.. toctree::
:caption: Other Links

Download <https://github.com/circuitpython/CircuitPython_DisplayIO_Cartesian/releases/latest>
CircuitPython Reference Documentation <https://circuitpython.readthedocs.io>
Download from GitHub <https://github.com/circuitpython/CircuitPython_Org_DisplayIO_Cartesian/releases/latest>
Download Library Bundle <https://circuitpython.org/libraries>
CircuitPython Reference Documentation <https://docs.circuitpython.org>
CircuitPython Support Forum <https://forums.adafruit.com/viewforum.php?f=60>
Discord Chat <https://adafru.it/discord>
Adafruit Learning System <https://learn.adafruit.com>
2 changes: 1 addition & 1 deletion docs/index.rst.license
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython

SPDX-License-Identifier: MIT
7 changes: 7 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense

sphinx
sphinxcontrib-jquery
sphinx-rtd-theme
1 change: 1 addition & 0 deletions examples/displayio_cartesian_advanced_test.py
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
import board
import displayio
import terminalio

from displayio_cartesian import Cartesian

# Fonts used for the Dial tick labels
2 changes: 2 additions & 0 deletions examples/displayio_cartesian_lineplot.py
Original file line number Diff line number Diff line change
@@ -7,8 +7,10 @@
"""

import time

import board
import displayio

from displayio_cartesian import Cartesian

# create the display on the PyPortal or Clue or PyBadge(for example)
50 changes: 3 additions & 47 deletions examples/displayio_cartesian_simpletest.py
Original file line number Diff line number Diff line change
@@ -1,48 +1,4 @@
# SPDX-FileCopyrightText: 2021 Jose David M.
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
#
# SPDX-License-Identifier: MIT
#############################
"""
This is a basic demonstration of a Cartesian widget.
"""

import time
import board
import displayio
import terminalio
from displayio_cartesian import Cartesian

# Fonts used for the Dial tick labels
tick_font = terminalio.FONT

display = board.DISPLAY # create the display on the PyPortal or Clue (for example)
# otherwise change this to setup the display
# for display chip driver and pinout you have (e.g. ILI9341)


# Create a Cartesian widget
my_plane = Cartesian(
x=150, # x position for the plane
y=100, # y plane position
width=100, # display width
height=100, # display height
axes_color=0xFFFFFF, # axes line color
axes_stroke=2, # axes lines width in pixels
tick_color=0xFFFFFF, # ticks color
major_tick_stroke=1, # ticks width in pixels
major_tick_length=5, # ticks length in pixels
tick_label_font=tick_font, # the font used for the tick labels
font_color=0xFFFFFF, # ticks line color
)

my_group = displayio.Group()
my_group.append(my_plane)
display.show(my_group) # add high level Group to the display

posx = 0
posy = 0

while True:
for i in range(0, 90, 2):
my_plane.update_pointer(i, i)
time.sleep(0.5)
# SPDX-License-Identifier: Unlicense
4 changes: 3 additions & 1 deletion examples/displayio_cartesion_fillarea.py
Original file line number Diff line number Diff line change
@@ -6,10 +6,12 @@
This is a basic demonstration of a Cartesian widget for line-ploting
"""

import random
import time

import board
import displayio
import random

from displayio_cartesian import Cartesian

# create the display on the PyPortal or Clue or PyBadge(for example)
3 changes: 3 additions & 0 deletions optional_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# SPDX-FileCopyrightText: 2022 Alec Delaney, for Adafruit Industries
#
# SPDX-License-Identifier: Unlicense
56 changes: 52 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,54 @@
# SPDX-FileCopyrightText: 2020 Diego Elio Pettenò
# SPDX-FileCopyrightText: 2022 Alec Delaney, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
#
# SPDX-License-Identifier: Unlicense
# SPDX-License-Identifier: MIT

[tool.black]
target-version = ['py35']
[build-system]
requires = [
"setuptools",
"wheel",
"setuptools-scm",
]

[project]
name = "circuitpython-displayio-cartesian"
description = "A Cartesian plane widget for displaying graphical information."
version = "0.0.0+auto.0"
readme = "README.rst"
authors = [
{name = "Jose David M."}
]
urls = {Homepage = "https://github.com/circuitpython/CircuitPython_DisplayIO_Cartesian"}
keywords = [
"adafruit",
"blinka",
"circuitpython",
"micropython",
"displayio_cartesian",
"displayio",
"widget",
"graphics",
"gui",
"graph",
"chart",
"graphic",
]
license = {text = "MIT"}
classifiers = [
"Intended Audience :: Developers",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Embedded Systems",
"Topic :: System :: Hardware",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
]
dynamic = ["dependencies", "optional-dependencies"]

[tool.setuptools]
# TODO: IF LIBRARY FILES ARE A PACKAGE FOLDER,
# CHANGE `py_modules = ['...']` TO `packages = ['...']`
py-modules = ["displayio_cartesian"]

[tool.setuptools.dynamic]
dependencies = {file = ["requirements.txt"]}
optional-dependencies = {optional = {file = ["optional_requirements.txt"]}}
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
# SPDX-FileCopyrightText: Copyright (c) 2025 Jose David M. for circuitpython
#
# SPDX-License-Identifier: MIT

102 changes: 102 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
# SPDX-FileCopyrightText: 2024 Tim Cocks for Adafruit Industries
#
# SPDX-License-Identifier: MIT

target-version = "py38"
line-length = 100

[lint]
preview = true
select = ["I", "PL", "UP"]

extend-select = [
"D419", # empty-docstring
"E501", # line-too-long
"W291", # trailing-whitespace
"PLC0414", # useless-import-alias
"PLC2401", # non-ascii-name
"PLC2801", # unnecessary-dunder-call
"PLC3002", # unnecessary-direct-lambda-call
"E999", # syntax-error
"PLE0101", # return-in-init
"F706", # return-outside-function
"F704", # yield-outside-function
"PLE0116", # continue-in-finally
"PLE0117", # nonlocal-without-binding
"PLE0241", # duplicate-bases
"PLE0302", # unexpected-special-method-signature
"PLE0604", # invalid-all-object
"PLE0605", # invalid-all-format
"PLE0643", # potential-index-error
"PLE0704", # misplaced-bare-raise
"PLE1141", # dict-iter-missing-items
"PLE1142", # await-outside-async
"PLE1205", # logging-too-many-args
"PLE1206", # logging-too-few-args
"PLE1307", # bad-string-format-type
"PLE1310", # bad-str-strip-call
"PLE1507", # invalid-envvar-value
"PLE2502", # bidirectional-unicode
"PLE2510", # invalid-character-backspace
"PLE2512", # invalid-character-sub
"PLE2513", # invalid-character-esc
"PLE2514", # invalid-character-nul
"PLE2515", # invalid-character-zero-width-space
"PLR0124", # comparison-with-itself
"PLR0202", # no-classmethod-decorator
"PLR0203", # no-staticmethod-decorator
"UP004", # useless-object-inheritance
"PLR0206", # property-with-parameters
"PLR0904", # too-many-public-methods
"PLR0911", # too-many-return-statements
"PLR0912", # too-many-branches
"PLR0913", # too-many-arguments
"PLR0914", # too-many-locals
"PLR0915", # too-many-statements
"PLR0916", # too-many-boolean-expressions
"PLR1702", # too-many-nested-blocks
"PLR1704", # redefined-argument-from-local
"PLR1711", # useless-return
"C416", # unnecessary-comprehension
"PLR1733", # unnecessary-dict-index-lookup
"PLR1736", # unnecessary-list-index-lookup

# ruff reports this rule is unstable
#"PLR6301", # no-self-use

"PLW0108", # unnecessary-lambda
"PLW0120", # useless-else-on-loop
"PLW0127", # self-assigning-variable
"PLW0129", # assert-on-string-literal
"B033", # duplicate-value
"PLW0131", # named-expr-without-context
"PLW0245", # super-without-brackets
"PLW0406", # import-self
"PLW0602", # global-variable-not-assigned
"PLW0603", # global-statement
"PLW0604", # global-at-module-level

# fails on the try: import typing used by libraries
#"F401", # unused-import

"F841", # unused-variable
"E722", # bare-except
"PLW0711", # binary-op-exception
"PLW1501", # bad-open-mode
"PLW1508", # invalid-envvar-default
"PLW1509", # subprocess-popen-preexec-fn
"PLW2101", # useless-with-lock
"PLW3301", # nested-min-max
]

ignore = [
"PLR2004", # magic-value-comparison
"UP030", # format literals
"PLW1514", # unspecified-encoding
"PLR0913", # too many arguments
"PLR0917", # too many positional arguments
"PLR0915", # too many statements
]

[format]
line-ending = "lf"
64 changes: 0 additions & 64 deletions setup.py

This file was deleted.