Skip to content

Commit 892c556

Browse files
committed
Added code
1 parent 2ecf120 commit 892c556

File tree

15 files changed

+110
-56
lines changed

15 files changed

+110
-56
lines changed

.bumpversion.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ tag = True
99

1010
[bumpversion:file:README.rst]
1111

12-
[bumpversion:file:pytest_mypy_plugin_shim/__init__.py]
12+
[bumpversion:file:pytest_mypy_plugins_shim/__init__.py]

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ THE ISSUE WILL BE CLOSED IF INSUFFICIENT INFORMATION IS PROVIDED.
3838

3939
* Operating System:
4040
* Python:
41-
* pytest-mypy-plugin-shim:
41+
* pytest-mypy-plugins-shim:
4242

4343
## Installation source
4444
<!-- e.g. Github repository, Github Releases, PyPI/pip, Anaconda/conda -->

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ assignees: domdfcoding
2020

2121
* Operating System:
2222
* Python:
23-
* pytest-mypy-plugin-shim:
23+
* pytest-mypy-plugins-shim:
2424

2525

2626
## Other Additional Information:

.github/workflows/octocheese.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
steps:
1515
- uses: domdfcoding/octocheese@master
1616
with:
17-
pypi_name: "pytest-mypy-plugin-shim"
17+
pypi_name: "pytest-mypy-plugins-shim"
1818
env:
1919
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
2020
if: startsWith(github.ref, 'refs/tags/') != true

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ repos:
3838
rev: v0.1.5
3939
hooks:
4040
- id: ensure-dunder-all
41-
files: ^pytest_mypy_plugin_shim/.*\.py$
41+
files: ^pytest_mypy_plugins_shim/.*\.py$
4242

4343
- repo: https://github.com/domdfcoding/flake2lint
4444
rev: v0.2.0
@@ -78,6 +78,6 @@ repos:
7878
hooks:
7979
- id: dep_checker
8080
args:
81-
- pytest_mypy_plugin_shim
81+
- pytest_mypy_plugins_shim
8282

8383
# Custom hooks can be added below this comment

CONTRIBUTING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Contributing
44

55
.. This file based on https://github.com/PyGithub/PyGithub/blob/master/CONTRIBUTING.md
66
7-
``pytest-mypy-plugin-shim`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
7+
``pytest-mypy-plugins-shim`` uses `tox <https://tox.readthedocs.io>`_ to automate testing and packaging,
88
and `pre-commit <https://pre-commit.com>`_ to maintain code quality.
99

1010
Install ``pre-commit`` with ``pip`` and install the git hook:

LICENSE

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
Copyright (c) 2021 Dominic Davis-Foster
22

3+
Based on https://github.com/TypedDjango/pytest-mypy-plugins
4+
Copyright 2018 Maksim Kurnikov
5+
36
Permission is hereby granted, free of charge, to any person obtaining a copy
47
of this software and associated documentation files (the "Software"), to deal
58
in the Software without restriction, including without limitation the rights

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@ include __pkginfo__.py
22
include LICENSE
33
include requirements.txt
44
prune **/__pycache__
5-
recursive-include pytest_mypy_plugin_shim *.pyi
6-
include pytest_mypy_plugin_shim/py.typed
5+
recursive-include pytest_mypy_plugins_shim *.pyi
6+
include pytest_mypy_plugins_shim/py.typed

README.rst

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -26,74 +26,74 @@ pytest-mypy-plugin-shim
2626
* - Other
2727
- |license| |language| |requires|
2828

29-
.. |actions_linux| image:: https://github.com/domdfcoding/pytest-mypy-plugin-shim/workflows/Linux/badge.svg
30-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/actions?query=workflow%3A%22Linux%22
29+
.. |actions_linux| image:: https://github.com/domdfcoding/pytest-mypy-plugins-shim/workflows/Linux/badge.svg
30+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/actions?query=workflow%3A%22Linux%22
3131
:alt: Linux Test Status
3232

33-
.. |actions_windows| image:: https://github.com/domdfcoding/pytest-mypy-plugin-shim/workflows/Windows/badge.svg
34-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/actions?query=workflow%3A%22Windows%22
33+
.. |actions_windows| image:: https://github.com/domdfcoding/pytest-mypy-plugins-shim/workflows/Windows/badge.svg
34+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/actions?query=workflow%3A%22Windows%22
3535
:alt: Windows Test Status
3636

37-
.. |actions_macos| image:: https://github.com/domdfcoding/pytest-mypy-plugin-shim/workflows/macOS/badge.svg
38-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/actions?query=workflow%3A%22macOS%22
37+
.. |actions_macos| image:: https://github.com/domdfcoding/pytest-mypy-plugins-shim/workflows/macOS/badge.svg
38+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/actions?query=workflow%3A%22macOS%22
3939
:alt: macOS Test Status
4040

41-
.. |actions_flake8| image:: https://github.com/domdfcoding/pytest-mypy-plugin-shim/workflows/Flake8/badge.svg
42-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/actions?query=workflow%3A%22Flake8%22
41+
.. |actions_flake8| image:: https://github.com/domdfcoding/pytest-mypy-plugins-shim/workflows/Flake8/badge.svg
42+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/actions?query=workflow%3A%22Flake8%22
4343
:alt: Flake8 Status
4444

45-
.. |actions_mypy| image:: https://github.com/domdfcoding/pytest-mypy-plugin-shim/workflows/mypy/badge.svg
46-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/actions?query=workflow%3A%22mypy%22
45+
.. |actions_mypy| image:: https://github.com/domdfcoding/pytest-mypy-plugins-shim/workflows/mypy/badge.svg
46+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/actions?query=workflow%3A%22mypy%22
4747
:alt: mypy status
4848

49-
.. |requires| image:: https://requires.io/github/domdfcoding/pytest-mypy-plugin-shim/requirements.svg?branch=master
50-
:target: https://requires.io/github/domdfcoding/pytest-mypy-plugin-shim/requirements/?branch=master
49+
.. |requires| image:: https://requires.io/github/domdfcoding/pytest-mypy-plugins-shim/requirements.svg?branch=master
50+
:target: https://requires.io/github/domdfcoding/pytest-mypy-plugins-shim/requirements/?branch=master
5151
:alt: Requirements Status
5252

53-
.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/domdfcoding/pytest-mypy-plugin-shim?logo=codefactor
54-
:target: https://www.codefactor.io/repository/github/domdfcoding/pytest-mypy-plugin-shim
53+
.. |codefactor| image:: https://img.shields.io/codefactor/grade/github/domdfcoding/pytest-mypy-plugins-shim?logo=codefactor
54+
:target: https://www.codefactor.io/repository/github/domdfcoding/pytest-mypy-plugins-shim
5555
:alt: CodeFactor Grade
5656

57-
.. |pypi-version| image:: https://img.shields.io/pypi/v/pytest-mypy-plugin-shim
58-
:target: https://pypi.org/project/pytest-mypy-plugin-shim/
57+
.. |pypi-version| image:: https://img.shields.io/pypi/v/pytest-mypy-plugins-shim
58+
:target: https://pypi.org/project/pytest-mypy-plugins-shim/
5959
:alt: PyPI - Package Version
6060

61-
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pytest-mypy-plugin-shim?logo=python&logoColor=white
62-
:target: https://pypi.org/project/pytest-mypy-plugin-shim/
61+
.. |supported-versions| image:: https://img.shields.io/pypi/pyversions/pytest-mypy-plugins-shim?logo=python&logoColor=white
62+
:target: https://pypi.org/project/pytest-mypy-plugins-shim/
6363
:alt: PyPI - Supported Python Versions
6464

65-
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/pytest-mypy-plugin-shim
66-
:target: https://pypi.org/project/pytest-mypy-plugin-shim/
65+
.. |supported-implementations| image:: https://img.shields.io/pypi/implementation/pytest-mypy-plugins-shim
66+
:target: https://pypi.org/project/pytest-mypy-plugins-shim/
6767
:alt: PyPI - Supported Implementations
6868

69-
.. |wheel| image:: https://img.shields.io/pypi/wheel/pytest-mypy-plugin-shim
70-
:target: https://pypi.org/project/pytest-mypy-plugin-shim/
69+
.. |wheel| image:: https://img.shields.io/pypi/wheel/pytest-mypy-plugins-shim
70+
:target: https://pypi.org/project/pytest-mypy-plugins-shim/
7171
:alt: PyPI - Wheel
7272

73-
.. |license| image:: https://img.shields.io/github/license/domdfcoding/pytest-mypy-plugin-shim
74-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/blob/master/LICENSE
73+
.. |license| image:: https://img.shields.io/github/license/domdfcoding/pytest-mypy-plugins-shim
74+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/blob/master/LICENSE
7575
:alt: License
7676

77-
.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/pytest-mypy-plugin-shim
77+
.. |language| image:: https://img.shields.io/github/languages/top/domdfcoding/pytest-mypy-plugins-shim
7878
:alt: GitHub top language
7979

80-
.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/pytest-mypy-plugin-shim/v0.0.0
81-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/pulse
80+
.. |commits-since| image:: https://img.shields.io/github/commits-since/domdfcoding/pytest-mypy-plugins-shim/v0.0.0
81+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/pulse
8282
:alt: GitHub commits since tagged version
8383

84-
.. |commits-latest| image:: https://img.shields.io/github/last-commit/domdfcoding/pytest-mypy-plugin-shim
85-
:target: https://github.com/domdfcoding/pytest-mypy-plugin-shim/commit/master
84+
.. |commits-latest| image:: https://img.shields.io/github/last-commit/domdfcoding/pytest-mypy-plugins-shim
85+
:target: https://github.com/domdfcoding/pytest-mypy-plugins-shim/commit/master
8686
:alt: GitHub last commit
8787

8888
.. |maintained| image:: https://img.shields.io/maintenance/yes/2021
8989
:alt: Maintenance
9090

91-
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/pytest-mypy-plugin-shim
92-
:target: https://pypi.org/project/pytest-mypy-plugin-shim/
91+
.. |pypi-downloads| image:: https://img.shields.io/pypi/dm/pytest-mypy-plugins-shim
92+
:target: https://pypi.org/project/pytest-mypy-plugins-shim/
9393
:alt: PyPI - Downloads
9494

95-
.. |pre_commit_ci| image:: https://results.pre-commit.ci/badge/github/domdfcoding/pytest-mypy-plugin-shim/master.svg
96-
:target: https://results.pre-commit.ci/latest/github/domdfcoding/pytest-mypy-plugin-shim/master
95+
.. |pre_commit_ci| image:: https://results.pre-commit.ci/badge/github/domdfcoding/pytest-mypy-plugins-shim/master.svg
96+
:target: https://results.pre-commit.ci/latest/github/domdfcoding/pytest-mypy-plugins-shim/master
9797
:alt: pre-commit.ci status
9898

9999
.. end shields
@@ -103,12 +103,12 @@ Installation
103103

104104
.. start installation
105105
106-
``pytest-mypy-plugin-shim`` can be installed from PyPI.
106+
``pytest-mypy-plugins-shim`` can be installed from PyPI.
107107

108108
To install with ``pip``:
109109

110110
.. code-block:: bash
111111
112-
$ python -m pip install pytest-mypy-plugin-shim
112+
$ python -m pip install pytest-mypy-plugins-shim
113113
114114
.. end installation

formate.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,5 @@ lines_between_types = 0
3131
use_parentheses = true
3232
remove_redundant_aliases = true
3333
default_section = "THIRDPARTY"
34-
known_third_party = []
35-
known_first_party = "pytest_mypy_plugin_shim"
34+
known_third_party = [ "pytest",]
35+
known_first_party = "pytest_mypy_plugins_shim"

pytest_mypy_plugin_shim/__init__.py renamed to pytest_mypy_plugins_shim/__init__.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
#
88
# Copyright © 2021 Dominic Davis-Foster <[email protected]>
99
#
10+
# Based on https://github.com/TypedDjango/pytest-mypy-plugins
11+
# Copyright 2018 Maksim Kurnikov
12+
#
1013
# Permission is hereby granted, free of charge, to any person obtaining a copy
1114
# of this software and associated documentation files (the "Software"), to deal
1215
# in the Software without restriction, including without limitation the rights
@@ -26,8 +29,45 @@
2629
# OR OTHER DEALINGS IN THE SOFTWARE.
2730
#
2831

32+
# stdlib
33+
import tempfile
34+
35+
# 3rd party
36+
from _pytest.config.argparsing import Parser # nodep
37+
38+
__all__ = ["pytest_addoption"]
39+
2940
__author__: str = "Dominic Davis-Foster"
3041
__copyright__: str = "2021 Dominic Davis-Foster"
3142
__license__: str = "MIT License"
3243
__version__: str = "0.0.0"
3344
__email__: str = "[email protected]"
45+
46+
47+
def pytest_addoption(parser: Parser) -> None:
48+
group = parser.getgroup("mypy-tests")
49+
group.addoption(
50+
"--mypy-testing-base",
51+
type=str,
52+
default=tempfile.gettempdir(),
53+
help="Base directory for tests to use",
54+
)
55+
56+
group.addoption(
57+
"--mypy-ini-file",
58+
type=str,
59+
help="Which .ini file to use as a default config for tests",
60+
)
61+
62+
group.addoption(
63+
"--mypy-same-process",
64+
action="store_true",
65+
help="Run in the same process. Useful for debugging, will create problems with import cache",
66+
)
67+
68+
group.addoption(
69+
"--mypy-extension-hook",
70+
type=str,
71+
help="Fully qualifield path to the extension hook function, in case you need custom yaml keys. "
72+
"Has to be top-level.",
73+
)

repo_helper.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configuration for 'repo_helper' (https://github.com/domdfcoding/repo_helper)
22
---
3-
modname: 'pytest-mypy-plugin-shim'
3+
modname: 'pytest-mypy-plugins-shim'
44
copyright_years: '2021'
55
author: 'Dominic Davis-Foster'
66
@@ -13,3 +13,7 @@ short_desc: 'Substitute for "pytest-mypy-plugins" for Python implementations whi
1313
enable_conda: false
1414
enable_docs: false
1515
enable_tests: false
16+
17+
entry_points:
18+
pytest11:
19+
- "pytest-mypy-plugins-shim = pytest_mypy_plugins_shim"

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
pytest>=6.0.0

setup.cfg

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,18 @@
77
# * options.entry_points
88

99
[metadata]
10-
name = pytest-mypy-plugin-shim
10+
name = pytest-mypy-plugins-shim
1111
author = Dominic Davis-Foster
1212
author_email = [email protected]
1313
license = MIT License
1414
keywords =
1515
long_description = file: README.rst
1616
long_description_content_type = text/x-rst
1717
platforms = Windows, macOS, Linux
18-
url = https://github.com/domdfcoding/pytest-mypy-plugin-shim
18+
url = https://github.com/domdfcoding/pytest-mypy-plugins-shim
1919
project_urls =
20-
Issue Tracker = https://github.com/domdfcoding/pytest-mypy-plugin-shim/issues
21-
Source Code = https://github.com/domdfcoding/pytest-mypy-plugin-shim
20+
Issue Tracker = https://github.com/domdfcoding/pytest-mypy-plugins-shim/issues
21+
Source Code = https://github.com/domdfcoding/pytest-mypy-plugins-shim
2222
classifiers =
2323
License :: OSI Approved :: MIT License
2424
Operating System :: OS Independent
@@ -44,3 +44,6 @@ python_version = 3.6
4444
namespace_packages = True
4545
check_untyped_defs = True
4646
warn_unused_ignores = True
47+
48+
[options.entry_points]
49+
pytest11 = pytest-mypy-plugins-shim = pytest_mypy_plugins_shim

tox.ini

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,22 +67,22 @@ deps =
6767
git+https://github.com/domdfcoding/flake8-rst-docstrings.git
6868
git+https://github.com/domdfcoding/flake8-rst-docstrings-sphinx.git
6969
pygments>=2.7.1
70-
commands = python3 -m flake8_rst_docstrings_sphinx pytest_mypy_plugin_shim --allow-toolbox {posargs}
70+
commands = python3 -m flake8_rst_docstrings_sphinx pytest_mypy_plugins_shim --allow-toolbox {posargs}
7171

7272
[testenv:mypy]
7373
basepython = python3.6
7474
ignore_errors = True
7575
changedir = {toxinidir}
7676
deps = mypy==0.800
77-
commands = mypy pytest_mypy_plugin_shim {posargs}
77+
commands = mypy pytest_mypy_plugins_shim {posargs}
7878

7979
[testenv:pyup]
8080
basepython = python3.6
8181
skip_install = True
8282
ignore_errors = True
8383
changedir = {toxinidir}
8484
deps = pyupgrade-directories
85-
commands = pyup_dirs pytest_mypy_plugin_shim --py36-plus --recursive
85+
commands = pyup_dirs pytest_mypy_plugins_shim --py36-plus --recursive
8686

8787
[flake8]
8888
max-line-length = 120
@@ -103,9 +103,12 @@ count = True
103103
104104
[check-wheel-contents]
105105
ignore = W002
106-
toplevel = pytest_mypy_plugin_shim
107-
package = pytest_mypy_plugin_shim
106+
toplevel = pytest_mypy_plugins_shim
107+
package = pytest_mypy_plugins_shim
108108
109109
[pytest]
110110
addopts = --color yes --durations 25
111111
timeout = 300
112+
113+
[dep_checker]
114+
allowed_unused = pytest

0 commit comments

Comments
 (0)