Skip to content

Commit a836976

Browse files
committed
chore: unblock pyright for pre-commit hook
simple_salesforce has tightened its __all__ exports, so reading Salesforce/OrderedDict via the top-level namespace now trips pyright's reportPrivateImportUsage. Switch to the canonical submodule imports (simple_salesforce.api) and a setattr() monkey-patch that pyright doesn't flag. Also pin the pyright version in the pre-commit hook so node-side version drift can't silently reintroduce the same class of failure.
1 parent 1292386 commit a836976

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ repos:
3535
types: [python]
3636
pass_filenames: false
3737
additional_dependencies:
38-
- pyright
38+
- pyright@1.1.408

cumulusci/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414
if sys.version_info < (3, 8): # pragma: no cover
1515
raise Exception("CumulusCI requires Python 3.8+.")
1616

17-
api.OrderedDict = dict
18-
bulk.OrderedDict = dict
17+
setattr(api, "OrderedDict", dict)
18+
setattr(bulk, "OrderedDict", dict)

cumulusci/utils/salesforce/count_sobjects.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import typing as T
22

3-
from simple_salesforce import Salesforce
3+
from simple_salesforce.api import Salesforce
44

55
from cumulusci.utils.http.multi_request import CompositeParallelSalesforce
66
from cumulusci.utils.iterators import partition

0 commit comments

Comments
 (0)