Skip to content
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

Bookworm/Pi5 Compatibility: Upgrade to latest boilerplate #9

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

Gadgetoid
Copy link
Member

@Gadgetoid Gadgetoid commented Feb 12, 2024

Testing

If you're a Bookworm / Pi 5 user running into virtual environment issues, you can try this library like so:

git clone https://github.com/pimoroni/apa102-python -b repackage
cd apa102-python
./install.sh --unstable

The ./install.sh script will create a pimoroni virtual environment that's shared between our products. (or use your existing venv if you've already activated one.)

For the reasons behind these changes and other information, see:

@coveralls
Copy link

coveralls commented Feb 12, 2024

Pull Request Test Coverage Report for Build 8896055875

Details

  • 25 of 25 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+1.9%) to 86.667%

Totals Coverage Status
Change from base Build 1439662387: 1.9%
Covered Lines: 65
Relevant Lines: 75

💛 - Coveralls

@Gadgetoid Gadgetoid changed the title Repackage to hatch/pyproject.toml, port to gpiod Bookworm/Pi5 Compatibility: Upgrade to latest boilerplate Feb 13, 2024
@thirdr
Copy link

thirdr commented Mar 18, 2024

⚠ WARNING: Error: Failed to generate documentation.


Warn: Error loading apa102:
Traceback (most recent call last):
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py", line 217, in load_module
    return importlib.import_module(module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/ryan/apa102-python/apa102/__init__.py", line 4, in <module>
    import gpiodevice
ModuleNotFoundError: No module named 'gpiodevice'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py", line 300, in walk_packages2
    module = load_module(mod.name)
             ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py", line 219, in load_module
    raise RuntimeError(f"Error importing {module}") from e
RuntimeError: Error importing apa102
 (/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py:302)
Traceback (most recent call last):
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py", line 217, in load_module
    return importlib.import_module(module)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1206, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1178, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1149, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/home/ryan/apa102-python/apa102/__init__.py", line 4, in <module>
    import gpiodevice
ModuleNotFoundError: No module named 'gpiodevice'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/__main__.py", line 286, in <module>
    cli()
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/__main__.py", line 199, in cli
    pdoc.pdoc(
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/__init__.py", line 510, in pdoc
    all_modules[module_name] = doc.Module.from_name(module_name)
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/doc.py", line 403, in from_name
    return cls(extract.load_module(name))
               ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/contextlib.py", line 81, in inner
    return func(*args, **kwds)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/ryan/.virtualenvs/pimoroni/lib/python3.11/site-packages/pdoc/extract.py", line 219, in load_module
    raise RuntimeError(f"Error importing {module}") from e
RuntimeError: Error importing apa102

Remove pathologically slow time.sleep(0), 16 LEDs from 65ms to 4ms.
Batch a couple of set_value calls, 16 LEDs from 4ms to 3ms.
* install.sh: drop symlink warning for /boot/config.txt.
* install.sh: drop quotes around apt packages.
* Makefile: fail make tag if dev tools not installed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants