Skip to content

Version 1.10.2 requires Python 3.8 again #39

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

Closed
tombullock-aeromon opened this issue Feb 15, 2024 · 13 comments
Closed

Version 1.10.2 requires Python 3.8 again #39

tombullock-aeromon opened this issue Feb 15, 2024 · 13 comments

Comments

@tombullock-aeromon
Copy link

Following in the footsteps of issue #3, the use of / notation has been reintroduced as of 1.10.2 and in doing so requires the use of Python 3.8. This is not a thing that can be guaranteed, especially when multiple devices are being built in a commercial capacity on limited hardware.

Rather than removing the / notation again, one option would be to restrict 1.10.2 to Python 3.8, and leave the current python requirements for older versions of the module.

@scirelli
Copy link

scirelli commented Mar 1, 2024

I just ran into this error too!

Traceback (most recent call last):
  File "~/file", line 185, in initialize_devices
    device = initialize_device(importlib.import_module(device_package).Device, callback)
  File ".pyenv/versions/3.7.13/lib/python3.7/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "~/ir.py", line 64, in <module>
    import adafruit_ads1x15.ads1015 as ADS
  File ".../.venv/lib/python3.7/site-packages/adafruit_ads1x15/ads1015.py", line 23, in <module>
    from .ads1x15 import ADS1x15, Mode
  File ".../.venv/lib/python3.7/site-packages/adafruit_ads1x15/ads1x15.py", line 19, in <module>
    from adafruit_bus_device.i2c_device import I2CDevice
  File ".../.venv/lib/python3.7/site-packages/adafruit_bus_device/i2c_device.py", line 15, in <module>
    from circuitpython_typing import ReadableBuffer, WriteableBuffer
  File ".../.venv/lib/python3.7/site-packages/circuitpython_typing/__init__.py", line 79
    def read(self, count: Optional[int] = None, /) -> Optional[bytes]:
                                                ^
SyntaxError: invalid syntax

@dhalbert
Copy link
Contributor

dhalbert commented Mar 1, 2024

Yes, this was completely deliberate: #38. What platform are you on that's still using Python 3.7?

So are you asking us to add

[project]
...
requires-python = ">= 3.8"

A PR would be fine.

@scirelli
Copy link

scirelli commented Mar 1, 2024

I'm on a Beaglebone black, it's at 3.7.13.

So are you asking us to add

That would be a solution, at least then it would error out during install. Everything seemed fine until I ran the code.

@dhalbert
Copy link
Contributor

dhalbert commented Mar 1, 2024

If I add that to what would be 1.10.3, then the install would try 1.10.2, and that would fail, I think? So I just have to get rid of 1.10.2 altogether?

@scirelli
Copy link

scirelli commented Mar 1, 2024

I didn't specify a version, just grabbing the latest. So I don't think it will matter to me.

@dhalbert
Copy link
Contributor

dhalbert commented Mar 1, 2024

Debian bullseye is available for BeagleBone Black from https://www.beagleboard.org/distros. That has Python 3.9. Python 3.7 has been EOL since June, 2023. Can you upgrade your Debian version?

@scirelli
Copy link

scirelli commented Mar 1, 2024

I'm working on that now. I will see if I can downgrade the requirement until then.

@dhalbert
Copy link
Contributor

dhalbert commented Mar 1, 2024

just pip3 install adafruit-circuitpython-typing==1.10.1

@scirelli
Copy link

scirelli commented Mar 1, 2024

just pip3 install adafruit-circuitpython-typing==1.10.1

Yup, that's what I did for now.

@tombullock-aeromon
Copy link
Author

Yes, this was completely deliberate: #38. What platform are you on that's still using Python 3.7?

We use a PocketBeagle with Debian Buster; whilst we hope to use the images for Bullseye or Bookworm in the future we cannot guarantee it for all devices, and so any older ones that may be updated for whatever reason are at risk of becoming unusable for our purposes. (Patching to force a particular install version worked on our first affected device, and I did so before writing this ticket.)

If I add that to what would be 1.10.3, then the install would try 1.10.2, and that would fail, I think? So I just have to get rid of 1.10.2 altogether?

Hmm, yeah I can see the issue there.

@dhalbert
Copy link
Contributor

dhalbert commented Mar 8, 2024

I am going to clean this up by making a 1.10.3 that requires 3.8, and removing 1.10.2. Then anyone installing this with 3.7 with get 1.10.1.

@tekktrik
Copy link
Member

I think this is all set now, right @dhalbert? I see the 1.10.2 version yanked on PyPI.

@dhalbert
Copy link
Contributor

Right, I think it is all set. So 1.10.1 is fine for 3.7, and 1.10.3 is the first to require 3.8. I will close this.

Fixed by #40

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

No branches or pull requests

4 participants