#stubs version problem
1 messages · Page 1 of 1 (latest)
starting a thread
do a make clean before running the stubs making
git checkout 10.0.0-alpha.7
...
HEAD is now at c5128a9902 Merge pull request #10430 from dhalbert/update-frozen-modules-2025-06-17
(venv_cp) root@85594a1475ba:/workspace# python -msetuptools_scm
10.0.0a8.dev0+gc5128a9902.d20250618
above is what you had before. That is the correct commit for the 10.0.0-alpha.7 checkout. I wonder if pull --tags was not done properly .... but if so, why is it a8 !?
it looks like the actions substitute a version in to the filename that ends up in S3 here: https://github.com/adafruit/circuitpython/blob/main/.github/workflows/build.yml#L216 but don't seem to do the same thing for twine/pypi https://github.com/adafruit/circuitpython/blob/main/.github/workflows/build.yml#L227
can we run twine in a "dryrun" mode?
I had a change in my Make file (I tested the cut thing that I PR's locally inside this container) I assumed at the time that when I did git checkout 10.0.0-alpha.7 it was going to throw away my local change, but it actually didn't.
I'm guessing the fact that I actually had that change made it view me as in a "dev" version even though I had checked out the alpha7 branch.
if something like that happened in the CI, then the same thing would happen: it looks like a "dirty" build (some change after a commit)
I am not sure about twine dryrun, honestly twine is mostly a mystery to me. I've only ever experienced it get used from the actions tasks like ours. I'm not entirely clear on how to troubleshoot issues with it or do anything "manually" to test things out.
oooh, I have an idea, let me check the date on something
i don't understand it either. it has "just worked" for me. I am looking at its github issues but nothing come up
This fix was may 8th https://github.com/adafruit/circuitpython/pull/10322
there is nothing recent
it makes local changes to some files in order to get them to build successfully in latex. Maybe those changes exist and persist during the stubs build that ultimately tries to upload.
This would change the checked in README.rst: mv README.rst.bak README.rst .... yah, I'll bet that is it.
those changes are in the local repo clone, and they are present before the stubs are created
we could move the latex builds to after the normal stubs build and twine upload
in the actions tasks order
I think you should also undo the changes, or maybe we can figure a different way to accomplish your fix.
you can just do git restore . on the repo at the end of the latex builds
ok, this is the problem. I edited README.rst, and then did make stubs, and I got this:
Successfully built circuitpython_stubs-10.0.0a8.dev0+gc5128a9902.d20250618.tar.gz and circuitpython_stubs-10.0.0a8.dev0+gc5128a9902.d20250618-py3-none-any.whl
good thinking on that latex change!!
what is the problem with the badge image link? why does latex fall over
Ah yeah we could change it back after latex build is complete.
A different solution would be nice, but I could not think of anything better at the time. Our docs include a remotely hosted image (a badge) and the server that hosts it started disallowing non-human traffic. when the latex build runs it tries to download the image but the server returns an error due to automated traffic.
we could copy that badge to our s3 bucket
iirc it then tries to include a response error html page as though it is an image and dies(or maybe it's actually the capcha challenge page I don't recall for sure)
it is the weblate badge which contains the percentage complete, so it's generated dynamically in it's "normal environment"
if we hosted a static one it won't be able to update. But maybe that is fine given the trouble it's causing.
git restore . leaves the README.rst.bak, changing to mv -f would do
if .bak is in .gitignore it might be ok,
or use some other suffix like ~
not sure that is really the problem....
could you try the badge fetch again and see if it fails? Maybe they fixed it.
i'm not sure how you can tell if it fails, maybe a curl fetch?
it should be possible to test by removing the workaround and trying the latex build.
do we have to do a release, or just do a build?
if you submit a PR to revert that merged PR, I guess it will run and we will see!
Submitted PR, it failed the build inside of RTD but seemingly for a different reason https://app.readthedocs.org/projects/circuitpython/builds/28564429/#275292741--220 I don't think I've seen an error like this one before.
Read the Docs is a documentation publishing and hosting platform for technical documentation
it is not clear to me which version of pip it is using. says it will start failing in pip 25.3.
Last updated on April 27, 2025. What's being deprecated? DEPRECATION: Building 'version_pkg' using the legacy setup.py bdist_wheel mechanism, which will be removed in a future version. ...
might not be that, since sysv_ipc succeeds with the same warning ?
is this because we are still using circuitpython-stubs/setup.py instead of a pyproject.toml?
I don't think so, but I am not sure.
doesn't have to do with lgpio, i guess
i don't even know what that is
a blinka-used thing
I think lgpio is something new from a change in blinka today: https://github.com/adafruit/Adafruit_Blinka/pull/972/files#diff-4d7c51b1efe9043e44439a949dfd92e5827321b34082903477fd04876edb7552R11
it may be the case that pip install lgpio fails under python 3.13.5
@tough ocean it does fail:
$ pip3 install lgpio
Collecting lgpio
Downloading lgpio-0.2.2.0.tar.gz (90 kB)
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: lgpio
Building wheel for lgpio (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for lgpio (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
running bdist_wheel
running build
running build_py
running build_ext
building '_lgpio' extension
swigging lgpio.i to lgpio_wrap.c
swig -python -o lgpio_wrap.c lgpio.i
error: command 'swig' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lgpio
Failed to build lgpio
ERROR: Failed to build installable wheels for some pyproject.toml based projects (lgpio)
It installs under 3.12 but not 3.13.5. I installed python3.13. Also had to install python3.13-venv to make a venv
this is not even with pip 25.3, which isn't out yet? 25.1.1 is latest
also lgpio is a linux library apparently, it needs sys_platform == 'linux'
src/lgpio.h:34:10: fatal error: 'linux/gpio.h' file not found
34 | #include <linux/gpio.h>
| ^~~~~~~~~~~~~~
(from what I understand it's used to implement digitalio on Pi)
This did work under 3.12:
$ pip3 install lgpio
Collecting lgpio
Using cached lgpio-0.2.2.0-cp312-cp312-manylinux_2_34_x86_64.whl.metadata (963 bytes)
Using cached lgpio-0.2.2.0-cp312-cp312-manylinux_2_34_x86_64.whl (372 kB)
Installing collected packages: lgpio
Successfully installed lgpio-0.2.2.0
@deep inlet we were not able to pip install lgpio under python 3.13.5. This is used by blinka starting relatively recently?
@tough ocean it's getting late here, I think I will stop for now
same here, dinner time soon
this is only a problem at the next release, so we can fix this more leisurely
unless the rtd problem starts showing up all the time
I filed this issue on blinka: https://github.com/adafruit/Adafruit_Blinka/issues/974
@wanton valve filed this PR on Blinka:
https://github.com/adafruit/Adafruit_Blinka/pull/973
not attempting to install on mac if it won't ever work makes sense to me, though I don't know what consequence that will have if you are trying to build docs or do anything requiring blinka on mac.
for the short term perhaps it's worth changing the docs build containers to use python 3.12.
I was actually somewhat surprised to see that it was on 3.13, when I setup the local container with 24.04 I got 3.12 by default.
When py3.13 starts to become the norm on RPi I assume that lgpio will get an update that fixes it's ability to install under that.
I don't see any way to report issues or check existing issues at https://abyz.me.uk/lg/py_lgpio.html. There isn't any ground truth repo at github or gitlab that I can find.
Yeah, the way that library is distributed is kind of... interesting
I managed to get it to install by following the build instructions on the download page.
I was able to import board digitalio and busio with a MCP2221
and run a script displaying stuff on a SSD1306
originally lgpio was only installed on Pi5 ?
https://github.com/adafruit/Adafruit_Blinka/blob/5ca7fdd9bbfa35b2b8331664f2b1a3235e818759/setup.py#L30-L36
Nice, thank you for testing.
I'm unfamiliar with all of the modifiers in requirements.txt. It might not be possible to limit by specific hardware from it
Does downloading Adafruit-Blinka fully work on Ubuntu with Python 3.12 then? The Build CI I use from adafruit on my library failed, and I assumed it was because of this issue. I'm a bit confused now 😓 .
looks like some target platform_machine I don't know pi5 value for that, but perhaps lgpio just needs a condition like RPi.GPIO and a few others.
Downloading blinka does work on ubuntu under python 3.12. I can't necessarily comment on it's capabilities fully working. The main things that I use it for are building docs in the core and libraries, and displayio but not with traditional hardware much. So I don't frequently use most of it's capabilities.
@elfin jetty I believe your issue about missing swig.exe is tied to this problem ultimately. My understanding is swig is required by lgpio. swig needs to be installed seperately (I think). The fact that it put swig.exe in the error makes me think maybe that exists, but I don't actually know for sure.
In any case lgpio won't really do much for you under windows as I understand it. It was added as a req to Blinka yesterday but we didn't realize the full effects of it at the time.
Ideally we want to get it so that lgpio is not required for installing Blinka on anything except Raspberry pi (or whatever other hardware it supports).
I think that the change Neradoc submitted should fix the issue for you.
once it's merged and released. I just made the release now. After a few moments it should be propogated to pypi and you can try it again.
The windows stuff was some testing I did afterwards (I didn't know the issue was OS related), my main concern is the Build CI I use (https://github.com/EGJ-Moorington/CircuitPython_Button_Handler/issues/31)
A unified build CI for CircuitPython libraries. Contribute to adafruit/workflows-circuitpython-libs development by creating an account on GitHub.
Ahh, I see. Looking at that now.
The Build CI was working just fine yesterday, so it must be something with either 8.59.0 or 8.60.0, right? From the output log, I can see that it seems to download Adafruit-Blinka just fine, but the fact that it fails on importing it when running pytest made me assume something must be going on with the download as well.
Please ping me (either here or on GitHub) if I can help in any way!
I replied on github and will put further communication there. It is likely related to the same change in blinka. But I don't think it's quite the exact same issue or resolution as the stubs thing this thread was for.
I don't know much about setuptools, but I noticed that while the [tool.setuptools] in my library has py-modules = ["button_handler"], Adafruit-Blinka doesn't list adafruit_blinka in py-modules. Maybe it's worth checking out? I might fork the repo to test it myself.
because adafruit_blinka is not a module, blinka provides board, digitalio, etc.
or should it be ?
it wasn't in the py modules before 🤔
somewhat confusingly perhaps adafruit_blinka is a module within Blinka https://github.com/adafruit/Adafruit_Blinka/tree/main/src/adafruit_blinka
Yeah, I looked in the old setup.py that you linked earlier and it's unclear to me how or why it was working back then. But it seems to me that adafruit_blinka package needs to be included. I submitted a PR adding that to the list in pyproject.toml, but I'm not 100% sure if that is proper solution. And no idea why it didn't need to be listed more explicitly in setup.py
seems it might have been implicit in some way ?
I'm also not sure why some of those ones are called out specifically like https://github.com/adafruit/Adafruit_Blinka/blob/5ca7fdd9bbfa35b2b8331664f2b1a3235e818759/setup.py#L89
oh find_packages would be the one doing that on the line above
this? packages=find_packages("src") + ["micropython-stubs"],
but there is [tool.setuptools.packages.find] ?
ok that requires a deep dive into pyproject.toml
yeah, it seems there is some difference in behavior between those
pip install adafruit-blinka==8.59.0 results in having all of adafruit_blinka and it's contents in site-packages.
could the include list not include what would include adafruit_blinka ? Or do the modules need to be added separately from the packages thing ?
8.60.0 results in no adafruit_blinka strangely not even with the microcontroller ones that are specified.
unsure if using src for both where and an entry in include would cause a problem. But if not then perhaps that would work
this makes me think that we need to add some glob to the includes ?
https://setuptools.pypa.io/en/latest/userguide/package_discovery.html#finding-simple-packages
yeah, unclear
does adding "*" to includes do what the previous behavior was ? It seems to do it 🤔
yes, it seems like it to me
This does indeed not work. I tested foamyguy's fix and it also works for me.
@tough ocean would https://github.com/adafruit/Adafruit_Blinka/pull/976 have any effect on the RTD issue? I have not been following this other issue closely.
We discussed Read the Docs a bit on this issue, in case you want to check it out. I don't know if it will be much help, though.
No I don't think so. for the RTD py3.13 issue my understanding is that we have these two choices currently: A) change the action to use 3.12 for now and pip install seems to suceed. or B) change the action to do the "manual" setup of lgpio with the steps on the download page for that project. basically wget a thing and make / make install.
that would fix RTD, but there would still be fundamental problem of trying to use lgpio on any Python 3.13 system, I guess? (e.g. an RPi using 3.13). Seems like something to report to the lgpio folks but I see no way to do that.
Note sure about melissa's comment _This was especially important when the Pi 5 relied on rpi-lgpio (which it no longer does). _ here: https://github.com/adafruit/Adafruit_Blinka/pull/972
maybe she means now it depends on lgpio directly?
i assume she'll take a look soon
As far as I can tell it installs successfully under py3.13 if you do it manually instead of pip. So I think you could do that on a Pi with 3.13 but I haven't tried, nor have I done any actual testing with gpio.
I think it is using a pre-built wheel (?) so maybe that is the problem
yeah, I'm not sure how all of it works honestly but it looks like they have builds for 3.12 and older but not 3.13: https://pypi.org/project/lgpio/#files
which would you choose of 3.12 vs manual build
I think using py 3.12. Honestly the idea of wget from a "random" server and make / make install inside of the container kind of sketches me out a little. Perhaps it's unfounded because I assume the bits distributed by pypi could also be problematic in a worst case scenario.
Partially I find it odd how the code isn't super readily available, you could download from pypi and unpackage it to look. But not having the repo in github or any public version control system makes it harder to know what is going on inside of it. And harder to give feedback / research issues with the project as we are finding.
given the choice though using py 3.12 and installing automatically with pip feels to me slightly less prone to A) breaking randomly because the server is unavailable or URL changes or whatever and B) having the URL expire or change hands and then start hosting something different, possibly malicious.
I assume that at some point py 3.13 will become the norm on RPi and by then this library will get updated to support its install via pip, and at that point we could bump back to 3.13. It is slightly a shame not to be able to just keep using latest, but not the end of the world.
got it, so for now, the easiest change is just to change this to "3.12" ? https://github.com/adafruit/circuitpython/blob/ec2a55afa9237b8d11781850abe9b7326882f311/.readthedocs.yml#L14
yes, and here as well I think: https://github.com/adafruit/circuitpython/blob/ec2a55afa9237b8d11781850abe9b7326882f311/.github/workflows/build.yml#L183 based on my last PR in the core (reverting the latex workaround) it seemed to fail both inside RTD, and inside of github actions for the same reasons.
do you want to make a PR or should I? It's not the first time we've had to hold back Python versions for Reasons.
I can make one.