Skip to content

Commit 781397a

Browse files
authored
chore: update Python to 3.12 and Poetry to 1.7 (#231)
1 parent 86d61db commit 781397a

File tree

9 files changed

+42
-34
lines changed

9 files changed

+42
-34
lines changed

.editorconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ insert_final_newline = true
1010
charset = utf-8
1111
indent_style = space
1212
indent_size = 4
13+
quote_type = double

.github/actions/setup/action.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ description: "Install development dependencies"
44
inputs:
55
python-version:
66
description: "Python version to install"
7-
default: "3.11"
7+
default: "3.12"
88
poetry-version:
99
description: "Poetry version to install"
10-
default: "1.5.1"
10+
default: "1.7.0"
1111
cache:
1212
description: "Cache directory"
1313
default: "${{ runner.temp }}/cache"
@@ -20,12 +20,18 @@ runs:
2020
uses: actions/setup-python@v4
2121
with:
2222
python-version: ${{ inputs.python-version }}
23-
allow-prereleases: true
23+
update-environment: false
24+
25+
- name: "Set up Python 3.12 for Poetry"
26+
id: setup-poetry-python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: 3.12
2430

2531
- name: "Set up dependency cache"
2632
uses: actions/cache@v3
2733
with:
28-
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('poetry.lock') }}
34+
key: ${{ runner.os }}-${{ steps.setup-poetry-python.outputs.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('poetry.lock') }}
2935
path: ${{ inputs.cache }}
3036

3137
- name: "Set up PATH on POSIX"
@@ -42,12 +48,13 @@ runs:
4248
shell: bash
4349
run: |
4450
if ! poetry --version; then
45-
"${{ steps.setup-python.outputs.python-path }}" -m venv "${{ inputs.cache }}/tools"
51+
"${{ steps.setup-poetry-python.outputs.python-path }}" -m venv "${{ inputs.cache }}/tools"
4652
pip install poetry==${{ inputs.poetry-version }}
4753
fi
4854
4955
- name: "Install development dependencies"
5056
shell: bash
5157
run: |
5258
poetry config cache-dir "${{ inputs.cache }}/poetry"
59+
poetry env use "${{ steps.setup-python.outputs.python-path }}"
5360
poetry install --sync

CODE_OF_CONDUCT.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ representative at an online or offline event.
5959
## Enforcement
6060

6161
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to [Mike Cousins][].
62+
reported to [Michael Cousins][].
6363
All complaints will be reviewed and investigated promptly and fairly.
6464

6565
All community leaders are obligated to respect the privacy and security of the
@@ -129,4 +129,4 @@ For answers to common questions about this code of conduct, see the FAQ at
129129
[mozilla coc]: https://github.com/mozilla/diversity
130130
[faq]: https://www.contributor-covenant.org/faq
131131
[translations]: https://www.contributor-covenant.org/translations
132-
[mike cousins]: mailto:mike@cousins.io?subject=Decoy%20Code%20of%20Conduct
132+
[michael cousins]: mailto:michael@cousins.io?subject=Decoy%20Code%20of%20Conduct

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2020-2023, Mike Cousins
3+
Copyright (c) 2020-2023, Michael Cousins
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<div align="center">
2-
<img alt="Decoy logo" src="https://mike.cousins.io/decoy/img/decoy.png" width="256px">
2+
<img alt="Decoy logo" src="https://michael.cousins.io/decoy/img/decoy.png" width="256px">
33
<h1 class="decoy-title">Decoy</h1>
44
<p>Opinionated mocking library for Python</p>
55
<p>
@@ -11,7 +11,7 @@
1111
<a title="Supported Python Versions" href="https://pypi.org/project/decoy/"><img src="https://img.shields.io/pypi/pyversions/decoy?style=flat-square"></a>
1212
</p>
1313
<p>
14-
<a href="https://mike.cousins.io/decoy/" class="decoy-hidden">Usage guide and documentation</a>
14+
<a href="https://michael.cousins.io/decoy/" class="decoy-hidden">Usage guide and documentation</a>
1515
</p>
1616
</div>
1717

@@ -59,8 +59,8 @@ plugins = decoy.mypy
5959

6060
Decoy works well with [pytest][], but if you use another testing library or framework, you can still use Decoy! You just need to do two things:
6161

62-
1. Create a new instance of [`Decoy()`](https://mike.cousins.io/decoy/api/#decoy.Decoy) before each test
63-
2. Call [`decoy.reset()`](https://mike.cousins.io/decoy/api/#decoy.Decoy.reset) after each test
62+
1. Create a new instance of [`Decoy()`](https://michael.cousins.io/decoy/api/#decoy.Decoy) before each test
63+
2. Call [`decoy.reset()`](https://michael.cousins.io/decoy/api/#decoy.Decoy.reset) after each test
6464

6565
For example, using the built-in [unittest][] framework, you would use the `setUp` fixture method to do `self.decoy = Decoy()` and the `tearDown` method to call `self.decoy.reset()`. For a working example, see [`tests/test_unittest.py`](https://github.com/mcous/decoy/blob/main/tests/test_unittest.py).
6666

@@ -144,8 +144,8 @@ See [spying with verify][] for more details.
144144
[unittest]: https://docs.python.org/3/library/unittest.html
145145
[typing]: https://docs.python.org/3/library/typing.html
146146
[mypy]: https://mypy.readthedocs.io/
147-
[api reference]: https://mike.cousins.io/decoy/api/
148-
[usage guide]: https://mike.cousins.io/decoy/usage/create/
149-
[creating mocks]: https://mike.cousins.io/decoy/usage/create/
150-
[stubbing with when]: https://mike.cousins.io/decoy/usage/when/
151-
[spying with verify]: https://mike.cousins.io/decoy/usage/verify/
147+
[api reference]: https://michael.cousins.io/decoy/api/
148+
[usage guide]: https://michael.cousins.io/decoy/usage/create/
149+
[creating mocks]: https://michael.cousins.io/decoy/usage/create/
150+
[stubbing with when]: https://michael.cousins.io/decoy/usage/when/
151+
[spying with verify]: https://michael.cousins.io/decoy/usage/verify/

decoy/warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def __init__(self, rehearsal: VerifyRehearsal) -> None:
7979
"The same rehearsal was used in both a `when` and a `verify`.",
8080
"This is redundant and probably a misuse of the mock.",
8181
f"\t{stringify_call(rehearsal)}",
82-
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
82+
"See https://michael.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
8383
]
8484
)
8585
super().__init__(message)

mkdocs.yml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
site_name: Decoy
2-
site_description: 'Opinionated mocking library for Python.'
3-
site_author: 'Mike Cousins'
4-
site_url: 'https://mike.cousins.io/decoy/'
5-
repo_url: 'https://github.com/mcous/decoy'
6-
repo_name: 'mcous/decoy'
7-
edit_uri: ''
2+
site_description: "Opinionated mocking library for Python."
3+
site_author: "Michael Cousins"
4+
site_url: "https://michael.cousins.io/decoy/"
5+
repo_url: "https://github.com/mcous/decoy"
6+
repo_name: "mcous/decoy"
7+
edit_uri: ""
88

99
nav:
1010
- Getting Started: index.md
@@ -22,24 +22,24 @@ nav:
2222
- license.md
2323

2424
theme:
25-
name: 'material'
25+
name: "material"
2626
favicon: img/favicon.ico
2727
icon:
2828
logo: material/duck
2929
features:
3030
- navigation.instant
3131
- navigation.sections
32-
font: 'Open Sans'
33-
code: 'Fira Mono'
32+
font: "Open Sans"
33+
code: "Fira Mono"
3434
palette:
35-
- media: '(prefers-color-scheme: light)'
35+
- media: "(prefers-color-scheme: light)"
3636
scheme: default
3737
primary: black
3838
accent: indigo
3939
toggle:
4040
icon: material/weather-sunny
4141
name: Switch to dark mode
42-
- media: '(prefers-color-scheme: dark)'
42+
- media: "(prefers-color-scheme: dark)"
4343
scheme: slate
4444
primary: amber
4545
accent: yellow
@@ -63,7 +63,7 @@ watch:
6363

6464
markdown_extensions:
6565
- toc:
66-
permalink: '#'
66+
permalink: "#"
6767
- admonition
6868
- pymdownx.highlight
6969
- pymdownx.superfences

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
name = "decoy"
33
version = "2.1.0"
44
description = "Opinionated mocking library for Python"
5-
authors = ["Mike Cousins <mike@cousins.io>"]
5+
authors = ["Michael Cousins <michael@cousins.io>"]
66
license = "MIT"
77
readme = "README.md"
88
repository = "https://github.com/mcous/decoy"
9-
homepage = "https://mike.cousins.io/decoy/"
10-
documentation = "https://mike.cousins.io/decoy/"
9+
homepage = "https://michael.cousins.io/decoy/"
10+
documentation = "https://michael.cousins.io/decoy/"
1111

1212
classifiers = [
1313
"Development Status :: 5 - Production/Stable",

tests/test_warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ class WarningSpec(NamedTuple):
112112
"The same rehearsal was used in both a `when` and a `verify`.",
113113
"This is redundant and probably a misuse of the mock.",
114114
"\tspy(1)",
115-
"See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
115+
"See https://michael.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning",
116116
]
117117
),
118118
),

0 commit comments

Comments
 (0)