Skip to content

Commit 3f02e02

Browse files
committed
chore: disable BoardManual.pin_read
1 parent 7cd934a commit 3f02e02

File tree

4 files changed

+17
-1
lines changed

4 files changed

+17
-1
lines changed

.env.dev

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# This allows the unit tests to run, while not using
22
# the full <user_name>/<pin_name> format.
33
PINS_ALLOW_RSC_SHORT_NAME=1
4+
PINS_FEATURE_PREVIEW=1
45

56
# Pins optional config ----
67
#PINS_CACHE_DIR=.pins_cache

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ on:
1010

1111
env:
1212
PINS_ALLOW_RSC_SHORT_NAME: 1
13+
PINS_FEATURE_PREVIEW: 1
1314

1415
jobs:
1516
tests:

pins/boards.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from .errors import PinsError
1717
from .drivers import load_data, save_data, default_title
1818
from .utils import inform
19-
from .config import get_allow_rsc_short_name
19+
from .config import get_allow_rsc_short_name, get_feature_preview
2020

2121

2222
_log = logging.getLogger(__name__)
@@ -623,6 +623,15 @@ def __init__(self, *args, pin_paths: dict, **kwargs):
623623

624624
self.pin_paths = pin_paths
625625

626+
def pin_read(self, *args, **kwargs):
627+
if not get_feature_preview():
628+
raise NotImplementedError(
629+
"pin_read with BoardManual is currently unimplemented. "
630+
"See https://github.com/machow/pins-python/issues/59."
631+
)
632+
633+
return super().pin_read(*args, **kwargs)
634+
626635
def pin_list(self):
627636
return list(self.pin_paths)
628637

pins/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
PINS_ENV_CACHE_DIR = "PINS_CACHE_DIR"
99
PINS_ENV_INSECURE_READ = "PINS_ALLOW_PICKLE_READ"
1010
PINS_ENV_ALLOW_RSC_SHORT_NAME = "PINS_ALLOW_RSC_SHORT_NAME"
11+
PINS_ENV_FEATURE_PREVIEW = "PINS_FEATURE_PREVIEW"
1112

1213
pins_options = SimpleNamespace(quiet=False)
1314

@@ -42,3 +43,7 @@ def get_allow_pickle_read(flag):
4243

4344
def get_allow_rsc_short_name():
4445
return _interpret_int(PINS_ENV_ALLOW_RSC_SHORT_NAME)
46+
47+
48+
def get_feature_preview():
49+
return _interpret_int(PINS_ENV_FEATURE_PREVIEW)

0 commit comments

Comments
 (0)