-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Bernát Gábor <[email protected]>
- Loading branch information
1 parent
2fe8ee2
commit b7b8d4e
Showing
12 changed files
with
246 additions
and
222 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,18 @@ | ||
from __future__ import annotations | ||
from __future__ import annotations # noqa: INP001 | ||
|
||
import pytest | ||
|
||
|
||
def test_track(): | ||
def test_track() -> None: | ||
from heapq import heappush | ||
|
||
h = [] | ||
for value in range(1): | ||
heappush(h, value) | ||
assert [1] * 5_000 | ||
assert [1] * 5_000 # noqa: S101 | ||
|
||
|
||
@pytest.mark.limit_memory("100 KB") | ||
def test_memory_exceed(): | ||
def test_memory_exceed() -> None: | ||
found = [[i] * 1_000 for i in range(15)] | ||
assert found | ||
assert found # noqa: S101 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,65 @@ | ||
[build-system] | ||
build-backend = "hatchling.build" | ||
requires = ["hatchling>=1.12.2", "hatch-vcs>=0.3"] | ||
requires = [ | ||
"hatch-vcs>=0.3", | ||
"hatchling>=1.18", | ||
] | ||
|
||
[project] | ||
name = "pytest-memray" | ||
description = "A simple plugin to use with pytest" | ||
readme.file = "README.md" | ||
readme.content-type = "text/markdown" | ||
readme.file = "README.md" | ||
license = "apache-2.0" | ||
urls."Bug Tracker" = "https://github.com/bloomberg/pytest-memray/issues" | ||
urls.Documentation = "https://pytest-memray.readthedocs.io" | ||
urls."Source Code" = "https://github.com/bloomberg/pytest-memray" | ||
authors = [ | ||
maintainers = [ | ||
{ name = "Pablo Galindo Salgado", email = "[email protected]" }, | ||
] | ||
maintainers = [ | ||
authors = [ | ||
{ name = "Pablo Galindo Salgado", email = "[email protected]" }, | ||
] | ||
requires-python = ">=3.8" | ||
dependencies = [ | ||
"pytest>=7.2", | ||
"memray>=1.5", | ||
] | ||
optional-dependencies.docs = [ | ||
"furo>=2022.12.7", | ||
"sphinx>=6.1.3", | ||
"sphinx-argparse>=0.4", | ||
"sphinx-inline-tabs>=2022.1.2b11", | ||
"sphinxcontrib-programoutput>=0.17", | ||
"towncrier>=22.12", | ||
] | ||
optional-dependencies.lint = [ | ||
"black==22.12", | ||
"flake8==6", | ||
"isort==5.11.4", | ||
"mypy==0.991", | ||
] | ||
optional-dependencies.test = [ | ||
"covdefaults>=2.2.2", | ||
"pytest>=7.2", | ||
"coverage>=7.0.5", | ||
"flaky>=3.7", | ||
"pytest-xdist>=3.1", | ||
] | ||
dynamic = ["version"] | ||
classifiers = [ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: POSIX :: Linux", | ||
"Programming Language :: Python :: 3 :: Only", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: Implementation :: CPython", | ||
"Topic :: Software Development :: Debuggers", | ||
] | ||
|
||
dynamic = [ | ||
"version", | ||
] | ||
dependencies = [ | ||
"memray>=1.8", | ||
"pytest>=7.3.2", | ||
] | ||
optional-dependencies.docs = [ | ||
"furo>=2023.5.20", | ||
"sphinx>=7.0.1", | ||
"sphinx-argparse>=0.4", | ||
"sphinx-inline-tabs>=2023.4.21", | ||
"sphinxcontrib-programoutput>=0.17", | ||
"towncrier>=23.6", | ||
] | ||
optional-dependencies.lint = [ | ||
"black==23.3", | ||
"mypy==1.3", | ||
"ruff==0.0.272", | ||
] | ||
optional-dependencies.test = [ | ||
"covdefaults>=2.3", | ||
"coverage>=7.2.7", | ||
"flaky>=3.7", | ||
"pytest>=7.3.2", | ||
"pytest-xdist>=3.3.1", | ||
] | ||
urls."Bug Tracker" = "https://github.com/bloomberg/pytest-memray/issues" | ||
urls.Documentation = "https://pytest-memray.readthedocs.io" | ||
urls."Source Code" = "https://github.com/bloomberg/pytest-memray" | ||
[project.entry-points.pytest11] | ||
memray = "pytest_memray.plugin" | ||
|
||
|
@@ -91,15 +95,6 @@ python_version = "3.8" | |
show_error_codes = true | ||
strict = true | ||
|
||
[tool.isort] | ||
force_single_line = true | ||
multi_line_output = 3 | ||
include_trailing_comma = true | ||
force_grid_wrap = 0 | ||
use_parentheses = true | ||
line_length = 88 | ||
known_first_party = ["pytest_memray"] | ||
|
||
[tool.towncrier] | ||
name = "pytest-memray" | ||
filename = "docs/news.rst" | ||
|
@@ -114,3 +109,27 @@ type = [ | |
{ name = "Improved Documentation", directory = "doc", showcontent = true }, | ||
{ name = "Miscellaneous", directory = "misc", showcontent = true }, | ||
] | ||
|
||
[tool.ruff] | ||
select = ["ALL"] | ||
line-length = 88 | ||
target-version = "py38" | ||
isort = {known-first-party = ["pytest_memray"], required-imports = ["from __future__ import annotations"]} | ||
ignore = [ | ||
"ANN401", # dynamically typed expression | ||
"D", # documentation not always applied | ||
"ANN101", # self type annotation | ||
"D203", # `one-blank-line-before-class` (D203) and `no-blank-line-before-class` (D211) are incompatible | ||
"D212", # `multi-line-summary-first-line` (D212) and `multi-line-summary-second-line` (D213) are incompatible | ||
"S104", # Possible binding to all interface | ||
] | ||
[tool.ruff.per-file-ignores] | ||
"tests/**/*.py" = [ | ||
"S101", # asserts allowed in tests... | ||
"FBT", # don"t care about booleans as positional arguments in tests | ||
"INP001", # no implicit namespace | ||
"D", # don"t care about documentation in tests | ||
"S603", # `subprocess` call: check for execution of untrusted input | ||
"PLR2004", # Magic value used in comparison, consider replacing with a constant variable | ||
] | ||
"src/pytest_memray/_version.py" = ["I002"] # Missing required import: `from __future__ import annotations |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.