Skip to content

Commit

Permalink
Merge branch 'main' into feature/move-to-adaptor-backend
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanjmcdougall committed Dec 17, 2024
2 parents fe6092f + 8a4faf1 commit 1289134
Show file tree
Hide file tree
Showing 20 changed files with 463 additions and 166 deletions.
2 changes: 1 addition & 1 deletion .env.dev
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ AZURE_STORAGE_ACCOUNT_KEY=
# default auth setting, which requires authenticating
# via the gcloud cli.

# Rstudio Connect license ----
# Posit Connect license ----
RSC_LICENSE=

# Uncomment and change the variables below to specify the bucket (directory) the buckets
Expand Down
13 changes: 6 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]
python: ["3.9", "3.10", "3.11", "3.12", "3.13"]
os: ["ubuntu-latest"]
pytest_opts: ["--workers 4 --tests-per-worker 1"]
requirements: [""]
include:
- os: "ubuntu-latest"
python: "3.8"
python: "3.9"
requirements: "requirements/minimum.txt"
- os: "macos-latest"
python: "3.10"
Expand Down 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 Expand Up @@ -149,7 +148,7 @@ jobs:
run: |
make docs-build
- name: Save docs artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: docs-html
path: docs/_site
Expand All @@ -161,7 +160,7 @@ jobs:
if: "${{github.event_name == 'pull_request' && !github.event.pull_request.head.repo.fork }}"

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: docs-html
path: docs/_site
Expand Down Expand Up @@ -220,7 +219,7 @@ jobs:
needs: ["build-docs", "tests", "test-rsconnect"]
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: docs-html
path: docs/_site
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: 3.12 # Use the maximum version supported by python-pins
python-version: 3.13 # 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
version: 1.1.372
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ Tests can be run using pytest:
```shell
pytest pins

# run all tests except those for Rstudio Connect
# run all tests except those for Posit Connect
pytest pins -m 'not fs_rsc'

# run only local filesystem backend tests
Expand All @@ -60,7 +60,7 @@ pytest pins -m 'not skip_on_github' -k 'not pins.boards.BoardManual'

There are two important details to note for testing:

* **Backends**. pins can write to backends like s3, azure, and RStudio Connect, so you
* **Backends**. pins can write to backends like s3, azure, and Posit Connect, so you
will need to set credentials to test against them.
* **Pytest Marks**. You can disable tests over a specific backend through pytest's
`-m` flag. For example...
Expand All @@ -74,7 +74,7 @@ There are two important details to note for testing:
* Modify `.env` to file in environment variables (e.g. AWS_ACCESS_KEY_ID)
* Be careful not to put any sensitive information in `.env.dev`!

### Setting up RStudio Connect tests
### Setting up Posit Connect tests

```
# Be sure to set RSC_LICENSE in .env
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ docs-build:
docs-clean:
rm -rf docs/_build docs/api/api_card

requirements/dev.txt: setup.cfg
requirements/dev.txt: pyproject.toml
@# allows you to do this...
@# make requirements | tee > requirements/some_file.txt
@pip-compile setup.cfg --rebuild --extra doc --extra test --extra check --output-file=- > $@
@pip-compile pyproject.toml --rebuild --extra doc --extra test --extra check --output-file=- > $@

binder/requirements.txt: requirements/dev.txt
cp $< $@
Expand Down
22 changes: 20 additions & 2 deletions docs/get_started.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ jupyter: python3
---

```{python}
#| include: false
# | include: false
import time
import pandas as pd
pd.options.display.max_rows = 25
```
Expand Down Expand Up @@ -126,7 +127,7 @@ While we’ll do our best to keep the automatically generated metadata consisten

## Versioning

Every [](`~pins.boards.BaseBoard.pin_write`) will create a new version:
By default, calls to [](`~pins.boards.BaseBoard.pin_write`) will usually create a new version:

```{python}
board2 = board_temp()
Expand All @@ -136,6 +137,23 @@ board2.pin_write([1,2], name = "x", type = "json")
board2.pin_versions("x")
```

The only exception is if the data is identical with the most recent version (compared via file hash):

```{python}
board2.pin_write([1], name = "x", type = "json")
time.sleep(1.1) # later, let's try and write a new version of the same data...
board2.pin_write([1], name = "x", type = "json")
board2.pin_versions("x")
```


However you can opt-out of this behaviour with `force_identical_write=True`:
```{python}
time.sleep(1.1) # try again...
board2.pin_write([1], name = "x", type = "json", force_identical_write=True)
board2.pin_versions("x")
```

By default, [](`~pins.boards.BaseBoard.pin_read`) will return the most recent version:

```{python}
Expand Down
Loading

0 comments on commit 1289134

Please sign in to comment.