Skip to content

Commit 16b4113

Browse files
authored
feat: update min. python version to 3.10 (#1024)
BREAKING CHANGE: Min. python version is now 3.10.
1 parent 434c63f commit 16b4113

File tree

24 files changed

+633
-592
lines changed

24 files changed

+633
-592
lines changed

.github/actions/setup-env/action.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,12 @@ runs:
2626
echo "version=$(head -n1 .poetry-version | tr -d '\n')" >> $GITHUB_OUTPUT
2727
shell: bash
2828
- name: Set up Python ${{ inputs.python-version }}
29-
uses: actions/setup-python@v6.0.0
29+
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
3030
with:
3131
python-version: ${{ inputs.python-version }}
32+
allow-prereleases: true
3233
- name: Install Poetry
33-
uses: snok/install-poetry@v1.4.1
34+
uses: snok/install-poetry@76e04a911780d5b312d89783f7b1cd627778900a # v1.4.1
3435
with:
3536
version: ${{ steps.detect-poetry.outputs.version }}
3637
virtualenvs-create: true

.github/renovate.json5

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
$schema: "https://docs.renovatebot.com/renovate-schema.json",
3+
extends: ["helpers:pinGitHubActionDigests"],
34
prConcurrentLimit: 2,
45
semanticCommits: "enabled",
56
semanticCommitType: "chore",
@@ -16,6 +17,6 @@
1617
automergeType: "pr",
1718
automergeStrategy: "squash",
1819
constraints: {
19-
poetry: "2.1.2",
20+
poetry: "2.2.1",
2021
},
2122
}

.github/workflows/benchmark.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020
runs-on: ubuntu-latest
2121
if: (!contains(github.event.head_commit.message, '[skip ci]'))
2222
steps:
23-
- uses: actions/checkout@v5.0.0
23+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2424
- name: Setup Environment
2525
uses: ./.github/actions/setup-env
2626
- name: Install project dependencies
2727
run: . script/bootstrap
2828
- name: Benchmark
2929
run: poetry run invoke benchmark
3030
- name: Publish Benchmark Results
31-
uses: benchmark-action/github-action-benchmark@v1
31+
uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
3232
with:
3333
tool: 'pytest'
3434
output-file-path: benchmarks.json

.github/workflows/ci.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
runs-on: ubuntu-latest
2525
if: (!contains(github.event.head_commit.message, '[skip ci]'))
2626
steps:
27-
- uses: actions/checkout@v5.0.0
27+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2828
- name: Setup Environment
2929
uses: ./.github/actions/setup-env
3030
- name: Install project dependencies
@@ -40,10 +40,10 @@ jobs:
4040
strategy:
4141
matrix:
4242
os: [ubuntu-latest, windows-latest]
43-
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13-dev']
43+
python-version: ['3.10', '3.11', '3.12', '3.13-dev']
4444
fail-fast: ${{ !contains(github.event.pull_request.labels.*.name, 'ci/run-all-tests') }}
4545
steps:
46-
- uses: actions/checkout@v5.0.0
46+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
4747
- name: Setup Environment
4848
uses: ./.github/actions/setup-env
4949
with:
@@ -99,15 +99,15 @@ jobs:
9999
contents: write
100100
pull-requests: write
101101
steps:
102-
- uses: actions/checkout@v5.0.0
102+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
103103
- name: Setup Environment
104104
uses: ./.github/actions/setup-env
105105
- name: Install project dependencies
106106
run: . script/bootstrap
107107
- name: Benchmark
108108
run: poetry run invoke benchmark
109109
- name: Publish Benchmark Results
110-
uses: benchmark-action/github-action-benchmark@v1
110+
uses: benchmark-action/github-action-benchmark@4bdcce38c94cec68da58d012ac24b7b1155efe8b # v1.20.7
111111
with:
112112
tool: 'pytest'
113113
output-file-path: benchmarks.json

.github/workflows/release.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
runs-on: ubuntu-latest
2222
environment: release
2323
steps:
24-
- uses: actions/checkout@v5.0.0
24+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
2525
with:
2626
fetch-depth: 0
2727
persist-credentials: false
@@ -33,7 +33,7 @@ jobs:
3333
run: . script/bootstrap
3434

3535
- name: Release
36-
uses: cycjimmy/semantic-release-action@v5.0.0
36+
uses: cycjimmy/semantic-release-action@9cc899c47e6841430bbaedb43de1560a568dfd16 # v5.0.0
3737
with:
3838
branches: |
3939
[

.poetry-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2.1.2
1+
2.2.1

README.md

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,15 @@
66

77
[![All Contributors](https://img.shields.io/github/all-contributors/syrupy-project/syrupy?color=ee8449&style=flat-square)](#contributors) [![Stage](https://img.shields.io/pypi/status/syrupy)](https://pypi.org/project/syrupy/) [![codecov](https://codecov.io/gh/syrupy-project/syrupy/graph/badge.svg?token=GB9EmYKPAl)](https://codecov.io/gh/syrupy-project/syrupy)
88

9-
![Pytest>=5.1.0,<9.0.0](https://img.shields.io/badge/pytest-%3E%3D5.1.0,%20%3C9.0.0-green) [![Pypi](https://img.shields.io/pypi/v/syrupy)](https://pypi.org/project/syrupy/) [![Wheel](https://img.shields.io/pypi/wheel/syrupy)](https://pypi.org/project/syrupy/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syrupy) [![PyPI - Downloads](https://img.shields.io/pypi/dm/syrupy)](https://pypi.org/project/syrupy/) [![PyPI - License](https://img.shields.io/pypi/l/syrupy)](./LICENSE)
9+
![Pytest>=8,<9.0.0](https://img.shields.io/badge/pytest-%3E=8,%20%3C9.0.0-green) [![Pypi](https://img.shields.io/pypi/v/syrupy)](https://pypi.org/project/syrupy/) [![Wheel](https://img.shields.io/pypi/wheel/syrupy)](https://pypi.org/project/syrupy/) ![PyPI - Python Version](https://img.shields.io/pypi/pyversions/syrupy) [![PyPI - Downloads](https://img.shields.io/pypi/dm/syrupy)](https://pypi.org/project/syrupy/) [![PyPI - License](https://img.shields.io/pypi/l/syrupy)](./LICENSE)
1010

1111
## Overview
1212

1313
Syrupy is a zero-dependency [pytest](https://docs.pytest.org/en/latest/) snapshot plugin. It enables developers to write tests which assert immutability of computed results.
1414

1515
## Motivation
1616

17-
The most popular snapshot test plugin compatible with pytest has some core limitations which this package attempts to address by upholding some key values:
17+
Syrupy upholds three principles:
1818

1919
- Extensible: If a particular data type is not supported, users should be able to easily and quickly add support.
2020
- Idiomatic: Snapshot testing should fit naturally among other test cases in pytest, e.g. `assert x == snapshot` vs. `snapshot.assert_match(x)`.
@@ -26,23 +26,14 @@ The most popular snapshot test plugin compatible with pytest has some core limit
2626
python -m pip install syrupy
2727
```
2828

29-
### Migration from snapshottest
30-
31-
You cannot use syrupy alongside snapshottest due to argument conflicts. To ease migration, we've made syrupy aware of snapshottest call syntax. Simply uninstall snapshottest and remove old snapshots:
32-
33-
```shell
34-
pip uninstall snapshottest -y;
35-
find . -type d ! -path '*/\.*' -name 'snapshots' | xargs rm -r
36-
```
37-
3829
### Pytest and Python Compatibility
3930

4031
Syrupy will always be compatible with the latest version of Python and Pytest. If you're running an old version of Python or Pytest, you will need to use an older major version of Syrupy:
4132

4233
| Syrupy Version | Python Support | Pytest Support |
4334
| -------------- | -------------- | -------------- |
44-
| 5.x.x | >3.9 | >=8 |
45-
| 4.x.x | >3.8.1, | >=7, <9 |
35+
| 5.x.x | >=3.10 | >=8 |
36+
| 4.x.x | >=3.8.1, | >=7, <9 |
4637
| 3.x.x | >=3.7, <4 | >=5.1, <8 |
4738
| 2.x.x | >=3.6, <4 | >=5.1, <8 |
4839

@@ -545,6 +536,17 @@ See [#675](https://github.com/syrupy-project/syrupy/issues/675) for the original
545536

546537
_We welcome contributions to patch these known limitations._
547538

539+
## Migrating from another tool
540+
541+
### From snapshottest
542+
543+
You cannot use syrupy alongside snapshottest due to argument conflicts. To ease migration, we've made syrupy aware of snapshottest call syntax. Simply uninstall snapshottest and remove old snapshots:
544+
545+
```shell
546+
pip uninstall snapshottest -y;
547+
find . -type d ! -path '*/\.*' -name 'snapshots' | xargs rm -r
548+
```
549+
548550
## Uninstalling
549551

550552
```python

0 commit comments

Comments
 (0)