Merge pull request #948 from makermelissa/main

Update Check Features to check Blinka boards too
This commit is contained in:
Melissa LeBlanc-Williams 2022-05-10 15:11:49 -06:00 committed by GitHub
commit 7957a441f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 10 deletions

View file

@ -9,7 +9,6 @@ board_image: "adafruit_feather_rp2040.jpg"
download_instructions: "https://learn.adafruit.com/circuitpython-libraries-on-any-computer-with-raspberry-pi-pico"
date_added: 2021-12-6
features:
- USB-C
- Feather-Compatible
- STEMMA QT/QWIIC
---

View file

@ -10,7 +10,6 @@ download_instructions: "https://learn.adafruit.com/circuitpython-libraries-on-an
date_added: 2021-12-6
features:
- STEMMA QT/QWIIC
- USB-C
---
What a cutie pie! Or is it... a QT Py? This diminutive dev board comes with one of our new favorite chip, the RP2040. It's been made famous in the new [Raspberry Pi Pico](https://www.adafruit.com/pico) *and* our [Feather RP2040](http://www.adafruit.com/product/4884) and [ItsyBitsy RP2040](http://www.adafruit.com/product/4888), but what if we wanted something really *smol?*

View file

@ -2,17 +2,42 @@
from pathlib import Path
import frontmatter
# Check CircuitPython Download Features
with open('template.md', "rt") as f:
metadata, content = frontmatter.parse(f.read())
acceptable_features = set(metadata['features'])
failed = False
for filename in Path('_board').glob("*.md"):
with open(filename, "rt") as f:
metadata, content = frontmatter.parse(f.read())
features = metadata.get('features') or ()
for feature in sorted(set(features) - acceptable_features):
print(f"{filename}:0: Non-standard feature: {feature}")
failed = True
def verify_features(folder, valid_features):
success = True
for filename in Path(folder).glob("*.md"):
with open(filename, "rt") as f:
metadata, content = frontmatter.parse(f.read())
features = metadata.get('features') or ()
for feature in sorted(set(features) - valid_features):
print(f"{filename}:0: Non-standard feature: {feature}")
success = False
return success
if not verify_features("_board", acceptable_features):
print("Non-standard features found. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-downloads for acceptable features")
raise SystemExit(True)
# Check Blinka Download Features
blinka_features = {
"Ethernet",
"HDMI",
"Wi-Fi",
"40-pin GPIO",
"GPS",
"Feather-Compatible",
"Bluetooth/BLE",
"STEMMA QT/QWIIC",
"USB 3.0",
"Infrared Receiver",
}
failed = not verify_features("_blinka", blinka_features)
if failed:
print("Non-standard features found. See https://learn.adafruit.com/how-to-add-a-new-board-to-the-circuitpython-org-website/adding-to-blinka for acceptable features")
raise SystemExit(failed)