diff --git a/.editorconfig b/.editorconfig index fe37401..b25efea 100644 --- a/.editorconfig +++ b/.editorconfig @@ -10,3 +10,4 @@ insert_final_newline = true charset = utf-8 indent_style = space indent_size = 4 +quote_type = double diff --git a/.github/actions/setup/action.yml b/.github/actions/setup/action.yml index 9853070..a2c09a3 100644 --- a/.github/actions/setup/action.yml +++ b/.github/actions/setup/action.yml @@ -4,10 +4,10 @@ description: "Install development dependencies" inputs: python-version: description: "Python version to install" - default: "3.11" + default: "3.12" poetry-version: description: "Poetry version to install" - default: "1.5.1" + default: "1.7.0" cache: description: "Cache directory" default: "${{ runner.temp }}/cache" @@ -20,12 +20,18 @@ runs: uses: actions/setup-python@v4 with: python-version: ${{ inputs.python-version }} - allow-prereleases: true + update-environment: false + + - name: "Set up Python 3.12 for Poetry" + id: setup-poetry-python + uses: actions/setup-python@v4 + with: + python-version: 3.12 - name: "Set up dependency cache" uses: actions/cache@v3 with: - key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('poetry.lock') }} + key: ${{ runner.os }}-${{ steps.setup-poetry-python.outputs.python-version }}-${{ steps.setup-python.outputs.python-version }}-${{ inputs.poetry-version }}-${{ hashFiles('poetry.lock') }} path: ${{ inputs.cache }} - name: "Set up PATH on POSIX" @@ -42,7 +48,7 @@ runs: shell: bash run: | if ! poetry --version; then - "${{ steps.setup-python.outputs.python-path }}" -m venv "${{ inputs.cache }}/tools" + "${{ steps.setup-poetry-python.outputs.python-path }}" -m venv "${{ inputs.cache }}/tools" pip install poetry==${{ inputs.poetry-version }} fi @@ -50,4 +56,5 @@ runs: shell: bash run: | poetry config cache-dir "${{ inputs.cache }}/poetry" + poetry env use "${{ steps.setup-python.outputs.python-path }}" poetry install --sync diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index c23c099..17fa9f8 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -59,7 +59,7 @@ representative at an online or offline event. ## Enforcement Instances of abusive, harassing, or otherwise unacceptable behavior may be -reported to [Mike Cousins][]. +reported to [Michael Cousins][]. All complaints will be reviewed and investigated promptly and fairly. 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 [mozilla coc]: https://github.com/mozilla/diversity [faq]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations -[mike cousins]: mailto:mike@cousins.io?subject=Decoy%20Code%20of%20Conduct +[michael cousins]: mailto:michael@cousins.io?subject=Decoy%20Code%20of%20Conduct diff --git a/LICENSE b/LICENSE index 20fff1a..404aa73 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2020-2023, Mike Cousins +Copyright (c) 2020-2023, Michael Cousins Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 05b45ba..3a7d644 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- Decoy logo + Decoy logo

Decoy

Opinionated mocking library for Python

@@ -11,7 +11,7 @@

- Usage guide and documentation + Usage guide and documentation

@@ -59,8 +59,8 @@ plugins = decoy.mypy 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: -1. Create a new instance of [`Decoy()`](https://mike.cousins.io/decoy/api/#decoy.Decoy) before each test -2. Call [`decoy.reset()`](https://mike.cousins.io/decoy/api/#decoy.Decoy.reset) after each test +1. Create a new instance of [`Decoy()`](https://michael.cousins.io/decoy/api/#decoy.Decoy) before each test +2. Call [`decoy.reset()`](https://michael.cousins.io/decoy/api/#decoy.Decoy.reset) after each test 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). @@ -144,8 +144,8 @@ See [spying with verify][] for more details. [unittest]: https://docs.python.org/3/library/unittest.html [typing]: https://docs.python.org/3/library/typing.html [mypy]: https://mypy.readthedocs.io/ -[api reference]: https://mike.cousins.io/decoy/api/ -[usage guide]: https://mike.cousins.io/decoy/usage/create/ -[creating mocks]: https://mike.cousins.io/decoy/usage/create/ -[stubbing with when]: https://mike.cousins.io/decoy/usage/when/ -[spying with verify]: https://mike.cousins.io/decoy/usage/verify/ +[api reference]: https://michael.cousins.io/decoy/api/ +[usage guide]: https://michael.cousins.io/decoy/usage/create/ +[creating mocks]: https://michael.cousins.io/decoy/usage/create/ +[stubbing with when]: https://michael.cousins.io/decoy/usage/when/ +[spying with verify]: https://michael.cousins.io/decoy/usage/verify/ diff --git a/decoy/warnings.py b/decoy/warnings.py index 508bd03..dc75528 100644 --- a/decoy/warnings.py +++ b/decoy/warnings.py @@ -79,7 +79,7 @@ def __init__(self, rehearsal: VerifyRehearsal) -> None: "The same rehearsal was used in both a `when` and a `verify`.", "This is redundant and probably a misuse of the mock.", f"\t{stringify_call(rehearsal)}", - "See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", + "See https://michael.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", ] ) super().__init__(message) diff --git a/mkdocs.yml b/mkdocs.yml index c72e794..0b63829 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -1,10 +1,10 @@ site_name: Decoy -site_description: 'Opinionated mocking library for Python.' -site_author: 'Mike Cousins' -site_url: 'https://mike.cousins.io/decoy/' -repo_url: 'https://github.com/mcous/decoy' -repo_name: 'mcous/decoy' -edit_uri: '' +site_description: "Opinionated mocking library for Python." +site_author: "Michael Cousins" +site_url: "https://michael.cousins.io/decoy/" +repo_url: "https://github.com/mcous/decoy" +repo_name: "mcous/decoy" +edit_uri: "" nav: - Getting Started: index.md @@ -22,24 +22,24 @@ nav: - license.md theme: - name: 'material' + name: "material" favicon: img/favicon.ico icon: logo: material/duck features: - navigation.instant - navigation.sections - font: 'Open Sans' - code: 'Fira Mono' + font: "Open Sans" + code: "Fira Mono" palette: - - media: '(prefers-color-scheme: light)' + - media: "(prefers-color-scheme: light)" scheme: default primary: black accent: indigo toggle: icon: material/weather-sunny name: Switch to dark mode - - media: '(prefers-color-scheme: dark)' + - media: "(prefers-color-scheme: dark)" scheme: slate primary: amber accent: yellow @@ -63,7 +63,7 @@ watch: markdown_extensions: - toc: - permalink: '#' + permalink: "#" - admonition - pymdownx.highlight - pymdownx.superfences diff --git a/pyproject.toml b/pyproject.toml index 17c33dd..7c9ed77 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,12 +2,12 @@ name = "decoy" version = "2.1.0" description = "Opinionated mocking library for Python" -authors = ["Mike Cousins "] +authors = ["Michael Cousins "] license = "MIT" readme = "README.md" repository = "https://github.com/mcous/decoy" -homepage = "https://mike.cousins.io/decoy/" -documentation = "https://mike.cousins.io/decoy/" +homepage = "https://michael.cousins.io/decoy/" +documentation = "https://michael.cousins.io/decoy/" classifiers = [ "Development Status :: 5 - Production/Stable", diff --git a/tests/test_warnings.py b/tests/test_warnings.py index a384045..0999cfd 100644 --- a/tests/test_warnings.py +++ b/tests/test_warnings.py @@ -112,7 +112,7 @@ class WarningSpec(NamedTuple): "The same rehearsal was used in both a `when` and a `verify`.", "This is redundant and probably a misuse of the mock.", "\tspy(1)", - "See https://mike.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", + "See https://michael.cousins.io/decoy/usage/errors-and-warnings/#redundantverifywarning", ] ), ),