Skip to content

Commit

Permalink
maint: add rdata as a testing dependency (#265)
Browse files Browse the repository at this point in the history
* Add rdata as a dependency

* Don't explicitly install rdata an extra time.
Don't reference [test] in `pip install -e .`

* Revert removal of `[test]` in cases where it is still needed.

* Add read_rds workaround for rdata on Python 3.8.

* Remove `hasattr` check

* Add type conversion for 3.8 support of rds load

* Use f.name for 3.8 rdata call

* Use f.name rather than type conversion.

* Enable `reportMissingImports` in pyright

* Isolate protected import for pyright

* Disable pyright for protected optional import

* Fix typo 🤦‍♂️

* dropped 3.8, no longer need workaround

---------

Co-authored-by: isabelizimm <[email protected]>
  • Loading branch information
nathanjmcdougall and isabelizimm authored Dec 17, 2024
1 parent 0ae055e commit 8a4faf1
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,7 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements/dev.txt
python -m pip install rdata
python -m pip install -e .[test]
python -m pip install -e .
- name: run Posit Connect
run: |
Expand Down
2 changes: 1 addition & 1 deletion pins/drivers.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def load_data(

elif meta.type == "rds":
try:
import rdata
import rdata # pyright: ignore[reportMissingImports]

return rdata.read_rds(f)
except ModuleNotFoundError:
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ test = [
"pytest-dotenv",
"pytest-parallel",
"s3fs",
"rdata",
]

[build-system]
Expand Down Expand Up @@ -102,7 +103,6 @@ reportArgumentType = false
reportAttributeAccessIssue = false
reportCallIssue = false
reportIncompatibleMethodOverride = false
reportMissingImports = false
reportMissingTypeStubs = false
reportOptionalMemberAccess = false
reportOptionalSubscript = false
Expand Down
4 changes: 4 additions & 0 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,8 @@ pyzmq==26.2.0
# jupyter-client
quartodoc==0.9.1
# via pins (pyproject.toml)
rdata==0.11.2
# via pins (pyproject.toml)
referencing==0.35.1
# via
# jsonschema
Expand Down Expand Up @@ -442,6 +444,8 @@ wheel==0.45.1
# via pip-tools
wrapt==1.17.0
# via aiobotocore
xarray==2024.6.0
# via rdata
xxhash==3.5.0
# via pins (pyproject.toml)
yarl==1.18.3
Expand Down

0 comments on commit 8a4faf1

Please sign in to comment.