Skip to content

Commit 17c78bf

Browse files
committed
Merge branch 'master' of github.com:kevin1024/vcrpy into fix-resource-warning-2
2 parents f414435 + 713cb36 commit 17c78bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+441
-366
lines changed

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ jobs:
1717

1818
steps:
1919
- name: Checkout
20-
uses: actions/checkout@v3
20+
uses: actions/checkout@v4
2121
- name: Codespell
2222
uses: codespell-project/actions-codespell@v2

.github/workflows/docs.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ jobs:
1010
runs-on: ubuntu-latest
1111

1212
steps:
13-
- uses: actions/checkout@v3
14-
- uses: actions/setup-python@v4
13+
- uses: actions/checkout@v4
14+
- uses: actions/setup-python@v5
1515
with:
16-
python-version: "3.11"
17-
16+
python-version: "3.12"
17+
1818
- name: Install build dependencies
1919
run: pip install -r docs/requirements.txt
2020
- name: Rendering HTML documentation

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ jobs:
1313
strategy:
1414
fail-fast: false
1515
matrix:
16-
python-version: ["3.8", "3.9", "3.10", "3.11", "pypy-3.8"]
16+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "pypy-3.8", "pypy-3.9", "pypy-3.10"]
1717

1818
steps:
19-
- uses: actions/checkout@v3.5.2
19+
- uses: actions/checkout@v4
2020

2121
- name: Set up Python ${{ matrix.python-version }}
22-
uses: actions/setup-python@v4
22+
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
2525

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# Copyright (c) 2023 Sebastian Pipping <[email protected]>
2+
# Licensed under the MIT license
3+
4+
name: Detect outdated pre-commit hooks
5+
6+
on:
7+
schedule:
8+
- cron: '0 16 * * 5' # Every Friday 4pm
9+
10+
# NOTE: This will drop all permissions from GITHUB_TOKEN except metadata read,
11+
# and then (re)add the ones listed below:
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
jobs:
17+
pre_commit_detect_outdated:
18+
name: Detect outdated pre-commit hooks
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
23+
- name: Set up Python 3.12
24+
uses: actions/setup-python@v4
25+
with:
26+
python-version: 3.12
27+
28+
- name: Install pre-commit
29+
run: |-
30+
pip install \
31+
--disable-pip-version-check \
32+
--no-warn-script-location \
33+
--user \
34+
pre-commit
35+
echo "PATH=${HOME}/.local/bin:${PATH}" >> "${GITHUB_ENV}"
36+
37+
- name: Check for outdated hooks
38+
run: |-
39+
pre-commit autoupdate
40+
git diff -- .pre-commit-config.yaml
41+
42+
- name: Create pull request from changes (if any)
43+
id: create-pull-request
44+
uses: peter-evans/create-pull-request@v5
45+
with:
46+
author: 'pre-commit <[email protected]>'
47+
base: master
48+
body: |-
49+
For your consideration.
50+
51+
:warning: Please **CLOSE AND RE-OPEN** this pull request so that [further workflow runs get triggered](https://github.com/peter-evans/create-pull-request/blob/main/docs/concepts-guidelines.md#triggering-further-workflow-runs) for this pull request.
52+
branch: precommit-autoupdate
53+
commit-message: "pre-commit: Autoupdate"
54+
delete-branch: true
55+
draft: true
56+
labels: enhancement
57+
title: "pre-commit: Autoupdate"
58+
59+
- name: Log pull request URL
60+
if: "${{ steps.create-pull-request.outputs.pull-request-url }}"
61+
run: |
62+
echo "Pull request URL is: ${{ steps.create-pull-request.outputs.pull-request-url }}"

.github/workflows/pre-commit.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Copyright (c) 2023 Sebastian Pipping <[email protected]>
2+
# Licensed under the MIT license
3+
4+
name: Run pre-commit
5+
6+
on:
7+
- pull_request
8+
- push
9+
- workflow_dispatch
10+
11+
jobs:
12+
pre-commit:
13+
name: Run pre-commit
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: 3.12
20+
- uses: pre-commit/[email protected]

.pre-commit-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright (c) 2023 Sebastian Pipping <[email protected]>
2+
# Licensed under the MIT license
3+
4+
repos:
5+
- repo: https://github.com/astral-sh/ruff-pre-commit
6+
rev: v0.1.7
7+
hooks:
8+
- id: ruff
9+
args: ["--show-source"]
10+
- id: ruff-format
11+
12+
- repo: https://github.com/pre-commit/pre-commit-hooks
13+
rev: v4.4.0
14+
hooks:
15+
- id: check-merge-conflict
16+
- id: end-of-file-fixer
17+
- id: trailing-whitespace

.readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ version: 2
99
build:
1010
os: ubuntu-22.04
1111
tools:
12-
python: "3.11"
12+
python: "3.12"
1313

1414
# Build documentation in the docs/ directory with Sphinx
1515
sphinx:
@@ -20,3 +20,5 @@ sphinx:
2020
python:
2121
install:
2222
- requirements: docs/requirements.txt
23+
- method: pip
24+
path: .

README.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ VCR.py 📼
44
###########
55

66

7-
|PyPI| |Python versions| |Build Status| |CodeCov| |Gitter| |CodeStyleBlack|
7+
|PyPI| |Python versions| |Build Status| |CodeCov| |Gitter|
88

99
----
1010

@@ -70,6 +70,3 @@ more details
7070
.. |CodeCov| image:: https://codecov.io/gh/kevin1024/vcrpy/branch/master/graph/badge.svg
7171
:target: https://codecov.io/gh/kevin1024/vcrpy
7272
:alt: Code Coverage Status
73-
.. |CodeStyleBlack| image:: https://img.shields.io/badge/code%20style-black-000000.svg
74-
:target: https://github.com/psf/black
75-
:alt: Code Style: black

docs/_static/vcr.svg

Lines changed: 1 addition & 1 deletion
Loading

docs/advanced.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ a nice addition. Here's an example:
1616
with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml') as cass:
1717
response = urllib2.urlopen('http://www.zombo.com/').read()
1818
# cass should have 1 request inside it
19-
assert len(cass) == 1
19+
assert len(cass) == 1
2020
# the request uri should have been http://www.zombo.com/
2121
assert cass.requests[0].uri == 'http://www.zombo.com/'
2222
@@ -208,7 +208,7 @@ So these two calls are the same:
208208
209209
# original (still works)
210210
vcr = VCR(filter_headers=['authorization'])
211-
211+
212212
# new
213213
vcr = VCR(filter_headers=[('authorization', None)])
214214
@@ -218,7 +218,7 @@ Here are two examples of the new functionality:
218218
219219
# replace with a static value (most common)
220220
vcr = VCR(filter_headers=[('authorization', 'XXXXXX')])
221-
221+
222222
# replace with a callable, for example when testing
223223
# lots of different kinds of authorization.
224224
def replace_auth(key, value, request):
@@ -286,7 +286,7 @@ sensitive data from the response body:
286286
before_record_response=scrub_string(settings.USERNAME, 'username'),
287287
)
288288
with my_vcr.use_cassette('test.yml'):
289-
# your http code here
289+
# your http code here
290290
291291
292292
Decode compressed response

0 commit comments

Comments
 (0)