Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,20 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: pre-commit/[email protected]

pyright:
name: "Run Pyright"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12 # Use the maximum version supported by python-pins
- name: Install dependencies
shell: bash
run: |
python -m pip install --upgrade pip
python -m pip install -e .[check]
- uses: jakebailey/pyright-action@v2
with:
version: 1.1.372 # Manually sync with setup.cfg
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ docs-clean:
requirements/dev.txt: setup.cfg
@# allows you to do this...
@# make requirements | tee > requirements/some_file.txt
@pip-compile setup.cfg --rebuild --extra doc --extra test --output-file=- > $@
@pip-compile setup.cfg --rebuild --extra doc --extra test --extra check --output-file=- > $@

binder/requirements.txt: requirements/dev.txt
cp $< $@
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# pins
<a href="https://rstudio.github.io/pins-python/"><img src="docs/logo.png" align="right" height="138" /></a>

![PyPI - Version](https://img.shields.io/pypi/v/pins.svg) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pins)
![PyPI - Version](https://img.shields.io/pypi/v/pins.svg) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/pins) [![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)



Expand Down
63 changes: 63 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,69 @@ markers = ["skip_on_github: skip this test if running on github"]

[tool.setuptools_scm]

[tool.pyright]
include = ["pins"]
exclude = ["**/__pycache__"]
ignore = ["pins/tests"]
pythonVersion = "3.12" # Use the maximum version supported by python-pins
pythonPlatform = "Linux"

# #######################
# Rules disabled and reasons why
# #######################

# None defaults without None in their type hint
# Variety of other issues
reportArgumentType = false

# Only one change needed - to avoid trying to treat Traversable as Path
reportAssignmentType = false

# Variety of issues
reportAttributeAccessIssue = false

# Passing extra args to the IFileSystem Protocol
# Missing overloads for as_df arg in pin_search and pin_versions
reportCallIssue = false

# Return type issues in CachePruner.versions and pins.constructors.board
reportGeneralTypeIssues = false

# Issues with ExtendMethodDoc
# RSConnect implementation of the IFileSystem Protocol
reportIncompatibleMethodOverride = false

# Only one change needed in RsConnectFs; protocol: ClassVar[str | tuple[str, ...]]
reportIncompatibleVariableOverride = false

# Using __delitem__ on a Mapping
# RSConnect API Reponse object issues
reportIndexIssue = false

# https://github.com/rstudio/pins-python/issues/262#issuecomment-2240875273
reportMissingImports = false

# Missing stubs for fsspec: https://github.com/fsspec/filesystem_spec/issues/625
# Missing stubs for joblib: https://github.com/joblib/joblib/issues/1516
reportMissingTypeStubs = false

# RSConnect API _raw_query return type issue
reportOptionalIterable = false

# RSConnect API _raw_query return type issue
# prepare_pin_version unhandled case
reportOptionalMemberAccess = false

# RSConnect API _raw_query return type issue
# RSConnect implementation of the IFileSystem Protocol
reportOptionalSubscript = false

# Mostly False positives arising from fragmented if statements and integer comparisons
reportPossiblyUnboundVariable = false

# Variety of issues
reportReturnType = false

[tool.ruff]
line-length = 90
extend-exclude = ["docs"]
Expand Down
27 changes: 25 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is autogenerated by pip-compile with Python 3.11
# by the following command:
#
# pip-compile --extra=doc --extra=test --output-file=- --strip-extras setup.cfg
# pip-compile --extra=doc --extra=test --extra=check --output-file=- --strip-extras setup.cfg
#
--index-url https://pypi.python.org/simple/
--trusted-host pypi.org
Expand Down Expand Up @@ -67,6 +67,8 @@ cffi==1.16.0
# via
# azure-datalake-store
# cryptography
cfgv==3.4.0
# via pre-commit
charset-normalizer==3.3.2
# via requests
click==8.1.7
Expand All @@ -93,12 +95,16 @@ decorator==5.1.1
# via
# gcsfs
# ipython
distlib==0.3.8
# via virtualenv
executing==2.0.1
# via stack-data
fastjsonschema==2.20.0
# via nbformat
fastparquet==2024.5.0
# via pins (setup.cfg)
filelock==3.15.4
# via virtualenv
frozenlist==1.4.1
# via
# aiohttp
Expand Down Expand Up @@ -141,6 +147,8 @@ griffe==0.48.0
# via quartodoc
humanize==4.10.0
# via pins (setup.cfg)
identify==2.6.0
# via pre-commit
idna==3.7
# via
# requests
Expand Down Expand Up @@ -220,6 +228,10 @@ nbformat==5.10.4
# pins (setup.cfg)
nest-asyncio==1.6.0
# via ipykernel
nodeenv==1.9.1
# via
# pre-commit
# pyright
numpy==2.0.0
# via
# fastparquet
Expand Down Expand Up @@ -247,13 +259,17 @@ pickleshare==0.7.5
pip-tools==7.4.1
# via pins (setup.cfg)
platformdirs==4.2.2
# via jupyter-core
# via
# jupyter-core
# virtualenv
pluggy==1.5.0
# via pytest
plum-dispatch==2.5.1.post1
# via quartodoc
portalocker==2.10.1
# via msal-extensions
pre-commit==3.7.1
# via pins (setup.cfg)
prompt-toolkit==3.0.47
# via ipython
proto-plus==1.24.0
Expand Down Expand Up @@ -297,6 +313,8 @@ pyproject-hooks==1.1.0
# via
# build
# pip-tools
pyright==1.1.372
# via pins (setup.cfg)
pytest==7.1.3
# via
# pins (setup.cfg)
Expand All @@ -320,6 +338,7 @@ pytz==2024.1
pyyaml==6.0.1
# via
# pins (setup.cfg)
# pre-commit
# quartodoc
pyzmq==26.0.3
# via
Expand Down Expand Up @@ -384,6 +403,8 @@ traitlets==5.14.3
# matplotlib-inline
# nbclient
# nbformat
types-appdirs==1.4.3.5
# via pins (setup.cfg)
typing-extensions==4.12.2
# via
# azure-core
Expand All @@ -398,6 +419,8 @@ urllib3==2.2.2
# via
# botocore
# requests
virtualenv==20.26.3
# via pre-commit
watchdog==4.0.1
# via quartodoc
wcwidth==0.2.13
Expand Down
5 changes: 5 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -66,5 +66,10 @@ test =
fastparquet
pyarrow

check =
pre-commit
pyright==1.1.372 # Pinned; manually sync with .github/workflows/code-checks.yml
types-appdirs

[bdist_wheel]
universal = 1