Skip to content

Commit 795e771

Browse files
committed
move from setup.py to pyproject.toml
1 parent 025929f commit 795e771

File tree

4 files changed

+66
-2
lines changed

4 files changed

+66
-2
lines changed

pyproject.toml

Lines changed: 56 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,60 @@
1+
[project]
2+
name = "memory_profiler"
3+
description = "A module for monitoring memory usage of a python program"
4+
readme = "README.rst"
5+
dynamic = ["version"]
6+
license = { text = "BSD" }
7+
license-files = { paths = ["COPYING"] }
8+
authors = [{ name = "Fabian Pedregosa", email = "f@bianp.net" }]
9+
urls = { Homepage = "https://github.com/pythonprofilers/memory_profiler" }
10+
classifiers = [
11+
"Development Status :: 5 - Production/Stable",
12+
"Intended Audience :: Science/Research",
13+
"Intended Audience :: Developers",
14+
"License :: OSI Approved :: BSD License",
15+
"Programming Language :: Python",
16+
"Programming Language :: Python :: 3",
17+
"Topic :: Software Development",
18+
"Operating System :: POSIX",
19+
"Operating System :: Unix"
20+
]
21+
requires-python = ">=3.9"
22+
dependencies = [
23+
"psutil>=0.0"
24+
]
25+
26+
[dependency-groups]
27+
dev = [
28+
"hatch>=1.14.1"
29+
]
30+
31+
[project.scripts]
32+
mprof = "memory_profiler.mprof:main"
33+
34+
135
[build-system]
2-
requires = ["setuptools"]
3-
build-backend = "setuptools.build_meta"
36+
requires = ["hatchling", "hatch-vcs", "uv-dynamic-versioning"]
37+
38+
build-backend = "hatchling.build"
39+
40+
[tool.hatch.build]
41+
packages = [
42+
"src/memory_profiler"
43+
]
44+
exclude = [
45+
".venv*",
46+
"tests/",
47+
"**/tests/",
48+
"**/*.pyc",
49+
"**/__pycache__/",
50+
"**/README.md",
51+
]
52+
53+
[tool.hatch.build.targets.sdist]
54+
include = ["/src/memory_profile", "README.rst"]
55+
56+
[tool.hatch.version]
57+
source = "vcs"
458

559
[tool.codespell]
660
skip = './.git'
File renamed without changes.

test/sample.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
@profile
2+
def my_func():
3+
a = [1] * (10 ** 6)
4+
b = [2] * (2 * 10 ** 7)
5+
del b
6+
return a
7+
8+
if __name__ == '__main__':
9+
my_func()
10+

0 commit comments

Comments
 (0)