Skip to content

Commit

Permalink
Merge branch 'main' into dev-force-identical
Browse files Browse the repository at this point in the history
  • Loading branch information
isabelizimm committed Aug 27, 2024
2 parents 1ce2aa4 + 8faca6c commit bb5a428
Show file tree
Hide file tree
Showing 37 changed files with 624 additions and 555 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11"]
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
os: ["ubuntu-latest"]
pytest_opts: ["--workers 4 --tests-per-worker 1"]
requirements: [""]
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
- name: run Posit Connect
run: |
docker-compose up --build -d
docker compose up --build -d
make dev
env:
RSC_LICENSE: ${{ secrets.RSC_LICENSE }}
Expand Down
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
12 changes: 5 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,14 @@ repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
hooks:
- id: flake8
# line too long and line before binary operator (black is ok with these)
types:
- python
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
args: ["--unsafe"]
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 22.3.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: "v0.5.4" # Sync with pyproject.toml
hooks:
- id: black
- id: ruff
args: ["--fix"]
- id: ruff-format
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ RSC_API_KEYS=pins/tests/rsconnect_api_keys.json
dev: pins/tests/rsconnect_api_keys.json

dev-start:
docker-compose up -d
docker-compose exec -T rsconnect bash < script/setup-rsconnect/add-users.sh
docker compose up -d
docker compose exec -T rsconnect bash < script/setup-rsconnect/add-users.sh
# curl fails with error 52 without a short sleep....
sleep 5
curl -s --retry 10 --retry-connrefused http://localhost:3939

dev-stop:
docker-compose down
docker compose down
rm -f $(RSC_API_KEYS)

$(RSC_API_KEYS): dev-start
Expand All @@ -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
2 changes: 1 addition & 1 deletion docs/get_started.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ That said, most boards transmit pins over HTTP, and this is going to be slow and
As a general rule of thumb, we don't recommend using pins with files over 500 MB.
If you find yourself routinely pinning data larger that this, you might need to reconsider your data engineering pipeline.

Storing your data/object as a pin works well when you write from a single source or process. It is _not_ appropriate when multiple sources or processes need to write to the same pin; since the pins package reads and writes files, it cannot manage concurrent writes.
Storing your data/object as a pin works well when you write from a single source or process. It is _not_ appropriate when multiple sources or processes need to write to the same pin; since the pins package reads and writes files, it cannot manage concurrent writes. It is also not appropriate for high frequency writes (multiple times per second).

- **Good** use for pins: an ETL pipeline that stores a model or summarized dataset once a day
- **Bad** use for pins: a Shiny app that collects data from users, who may be using the app at the same time
Expand Down
2 changes: 1 addition & 1 deletion pins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
# Imports ----
from .cache import cache_prune, cache_info
from .constructors import (
board_deparse,
board_folder,
board_temp,
board_local,
Expand All @@ -25,3 +24,4 @@
board_gcs,
board,
)
from .boards import board_deparse
2 changes: 1 addition & 1 deletion pins/_types.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from typing import Union
from io import IOBase
from typing import Union

StrOrFile = Union[str, IOBase]
Loading

0 comments on commit bb5a428

Please sign in to comment.