Comments (26)
I fixed the script locally on a windows machine with the platform.machine()
fix and it worked. Creating a PR now.
from adafruit_blinka.
maybe switch to platform.system()
?
>>> platform.system()
'Windows'
on WSL ubuntu:
>>> platform.system()
'Linux'
Underneath, platform.system()
uses platform.uname().system
.
from adafruit_blinka.
Sure. I could have a look at PlatformDetect as well.
from adafruit_blinka.
Thanks for letting us know, likely this is caused by #856, and it needs a bit of adjusting. I'll work on a fix right away.
from adafruit_blinka.
I just came accross this too. Researching, I found
Lines 97 to 106 in a1329a8
where
platform_reqs
is defined beforehandLine 26 in a1329a8
and then conditionally altered
Lines 49 to 50 in a1329a8
git blames 903c5ea as the latest relevant change.
I'm not sure what the exact problem is here. Technically, the condition guarding the dependence on sys-ipc
should not be satisfied on Windows
Python 3.12.4 (tags/v3.12.4:8e8a4ba, Jun 6 2024, 19:30:16) [MSC v.1940 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.platform
'win32'
>>> import platform
>>> platform.machine
<function machine at 0x0000023AAE8CB9C0>
>>> platform.machine()
'AMD64'
>>> sys.platform == 'linux' and platform.machine != 'mips'
False
Above you'll observe that platform.machine
is a function object, not a static string. So, platform.machine != 'mips'
is technically true. But, sys.platform == 'linux'
is false.
from adafruit_blinka.
Ah, ok. Yeah, the machine one should probably be updated. However, still strange behavior.
from adafruit_blinka.
Strange indeed. Just for clarity, I came here because pip names this lib as the reason for installing sys-ipc
:
Collecting sysv-ipc>=1.1.0 (from Adafruit-Blinka->circuitpython-nrf24l01==2.1.3.post1.dev16)
from adafruit_blinka.
I just confirmed that your PR works on Windows using
pip install git+https://github.com/makermelissa/Adafruit_Blinka#main
Thanks!
from adafruit_blinka.
Cool. However, pip install adafruit-blinka is still not working on my system, so I'm going to try and continue tracking down the issue.
from adafruit_blinka.
FYI, I used a fresh venv. Not sure if that helps.
from adafruit_blinka.
I might give that a try. I was installing it without a venv.
from adafruit_blinka.
Damn, same here. pip cache purge
didn't help; v8.44.1 still fails to install.
from adafruit_blinka.
I think I have a more understandable flaw. You're using ubuntu-latest in CI to build the bdist. This is understandable since the workflow uses bash's sed
to replace version 0.0.0-auto
placeholders with the actual tagged version. But sys.platform
will always resolve to ``linux'` if your CI runner is a Linux OS.
therefore, us windows users (for v8.44.0 and v8.44.1) have to install without using the bdist:
pip install --no-binary adafruit-blinka adafruit-blinka
Installing collected packages: adafruit-blinka
Successfully installed adafruit-blinka-8.44.1
from adafruit_blinka.
Huh, ok. That kind of makes sense. Well, I may just adjust it to check cpu then. It's only needed for Raspberry Pi and amlogic a311d.
from adafruit_blinka.
My lazy gut instinct thinks: For the meantime, just upload the sdist and rely on piwheels to provide the bdist for RPi OS.
It would be nicer if the bdist could be augmented to include the platform tag instead of presuming a universal tag. Maybe cibuildwheel could do that for you, IDK.
from adafruit_blinka.
all we really need on windows is a Dependency specifier (see grammar)
sys-ipc>=1.1.0;sys_platform=='linux'
from adafruit_blinka.
all we really need on windows is a Dependency specifier (see grammar)
sys-ipc>=1.1.0;sys_platform=='linux'
Yeah, that would have worked too with the exception of it possibly failing on the mips board. However, using the CPUs for the only boards that need it worked as well. :)
from adafruit_blinka.
IHMO, I still think uploading a universal bdist with so many machine-specific constraints is a flawed approach.
from adafruit_blinka.
Fair enough. I'll update it so it's using the same string as in the requirements.txt from before I changed it.
from adafruit_blinka.
Ci just needs to
python -m build -s
instead of using pypa/build's default behavior
from adafruit_blinka.
Ci just needs to
python -m build -s
What effect will this change have?
from adafruit_blinka.
python -m build
does 2 things (by default with no args):
- create a sdist (.tar.gz) from the project's current state
- create a bdist (.whl) from the sdist created in step 1. This is what you want to skip. Note, this does not actually use the project source. Rather this step is akin to
python -m pip wheel -w dist --no-deps dist/adafruit-blinka-<major>.<minor>.<patch>.tar.gz
python -m build -s
will only perform step 1 and skip step 2. More detail https://build.pypa.io/en/stable/ (or in python -m build -h
)
from adafruit_blinka.
Python's build back-ends simply aren't made to support creating a platform-specific bdist from a pure python source. There are hacks out there, but there's no guarantee that some new PEP implementation will not break the build process.
I understand the itch to upload bdists because they install faster, but that's why the piwheels project exists. Piwheels also helps with creating 32-bit bdists for c-extensions because we can't use a docker image to reliably create a 32-bit bdist for armv6l
platforms. For aarch64
, I have to build the bdist (with cibuildwheels) using a qemu VM in CI.
from adafruit_blinka.
It makes sense for Blinka in particular (and possibly PlatformDetect). Want to submit a PR?
from adafruit_blinka.
PlatformDetect doesn't have any install deps (requirements.txt dynamically loaded by build backend from pyproject.toml). Unless I missed something, it looks like all platform-specific code is used at runtime. So, a universal bdist makes sense for that lib.
from adafruit_blinka.
Thanks, makes sense.
from adafruit_blinka.
Related Issues (20)
- libgpiod_pin_1_x.py does not detect internal pulldowns HOT 1
- GT911 touch sensor support for Adafruit Blinka HOT 7
- adafruit-circuitpython-motor fails with "RuntimeError: Cannot determine SOC peripheral base address" on Raspberry Pi 5 HOT 12
- Adafruit-Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 13
- Adafruit-PlatformDetect version 3.69.0 was unable to identify the board HOT 2
- support for NXP i.MX 8M PLUS HOT 3
- It is no longer possible to install from 8.44.0. HOT 4
- Getting error in WCMCU-200 I2c to USB Adapter
- Add New Board adafruit FT232H Breakout for adafruit-blinka HOT 3
- Add Orange Pi AIPro
- Remove dependency to numpy HOT 2
- RPi GPIO is not support for Pi 5 any more, why merge pi5 with pi4 under board? HOT 3
- BananaPI F2P
- Maker Pi RP 2040 not supported. HOT 4
- Raspberry pi zero W board issue HOT 2
- [Suggestion] Find incompatibilities w.r.t. CircuitPython implementation HOT 6
- Disparity with `EventQueue` from 'Keypad`.
- unable to install blinka on Luckfox Pico Mini HOT 16
- Beagle Bone Black: no such file or directory: 0-00500/nvmem, permission denied 0-00500/nvmem
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adafruit_blinka.