adafruit / adafruit/circuitpython-build-tools

malformed external_dependencies (edge-case)

Open
#80 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
35
Forks
18
PR merge metrics
No merged PRs in 30d

Description

I have a CirPy lib that uses `spidev` on Linux (yields much better performance than pureio). I have listed spidev in the lib's requirements.txt like so
```txt
adafruit-circuitpython-busdevice
spidev; sys_platform == 'linux'
```
The `; sys_platform == 'linux'` is advice taken from pip's docs, but this makes the bundle's JSON external_dependencies look like so:
```json
"external_dependencies": [
"adafruit-circuitpython-busdevice",
"spidev; sys_platform "
]
```

I'm mandating the spidev module on Linux only because linting the lib when developing requires that the development changes be installed (spidev can't be installed on Windows). Granted, I still have to ignore warnings about `import spidev` in my lib's examples, but that's what hardware testing is for.

Feel free to close this issue if there are no foreseen consequences with circuitpython.org.

Contributor guide

No contributing guide indexed for this repository

Research direction

Trace the requirements.txt parsing that produces the external_dependencies JSON, using the issue's spidev entry with its sys_platform marker as the reproduction case. Confirm what the generated dependency should retain, then verify the corrected output against the bundle-generation behavior; the payload names no source file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
build-system
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.