From 39108881d3375ef9b6bfd2afca57599010ed018c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guti=C3=A9rrez=20Hermosillo=20Muriedas=2C=20Juan=20Pedro?= Date: Thu, 1 Feb 2024 17:25:34 +0100 Subject: [PATCH] build: transitioned to pdm from poetry, not sure I like it. Python 3.12 support will not work as long as we support 3.8, because numpy --- .gitignore | 4 +- pyproject.toml | 101 ++++++++++++++++++++++++------------------------- 2 files changed, 52 insertions(+), 53 deletions(-) diff --git a/.gitignore b/.gitignore index dd86b00..109345a 100644 --- a/.gitignore +++ b/.gitignore @@ -131,7 +131,9 @@ dmypy.json # Custom .vscode *.out -poetry.lock +*.lock .perun.ini examples/data examples/**/perun_results +.pdm-python +perun_results/ diff --git a/pyproject.toml b/pyproject.toml index d1927b4..11c6376 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,62 +1,63 @@ -[tool.poetry] +[project] name = "perun" version = "0.5.0" -description = "" -authors = ["GutiƩrrez Hermosillo Muriedas, Juan Pedro "] -license = "BSD-3-Clause" +description = "Command line tool to easily estimate energy consumption of python applications." +authors = [ + {name = "GutiƩrrez Hermosillo Muriedas, Juan Pedro", email = "juanpedroghm@gmail.com"}, +] +dependencies = [ + "py-cpuinfo>=6.0.0", + "numpy>=1.23", + "psutil>=5.9.0", + "h5py<4.0.0,>=3.2.0", + "pandas>=1.3", + "tabulate>=0.9", +] +requires-python = ">=3.8,<3.13" readme = "README.md" -homepage = "https://github.com/Helmholtz-AI-Energy/perun" - -[tool.poetry.scripts] -perun = "perun.api.cli:cli" - -[tool.poetry.dependencies] -python = ">=3.8,<4.0" -py-cpuinfo = ">=5.0.0" -numpy = ">=1.20.0" -psutil = "^5.9.0" -h5py = "^3.5.9" -pandas = {version = ">=1.3"} -tabulate = ">=0.9" -mpi4py = {version = "^3.1", optional = true } -nvidia-ml-py = {version = "^12.535.77", optional = true } -pyrsmi = {version = "^1.0.1", optional = true } - -[tool.poetry.extras] -mpi = ["mpi4py"] -nvidia = ["nvidia-ml-py"] -rocm = ["pyrsmi"] - -[tool.poetry.group.dev] -optional = true +license = {text = "BSD-3-Clause"} -[tool.poetry.group.dev.dependencies] -pytest = "*" -pytest-cov = "*" -flake8 = "*" -mypy = "*" -black = "*" -pre-commit = "*" -pydocstyle = "*" -python-semantic-release = "^8.1.1" +[project.urls] +homepage = "https://github.com/Helmholtz-AI-Energy/perun" -[tool.poetry.group.docs] -optional = true +[project.optional-dependencies] +mpi = ["mpi4py<4.0,>=3.1"] +nvidia = ["nvidia-ml-py<13.0.0,>=12.535.77"] +rocm = ["pyrsmi<2.0.0,>=1.0.1"] -[tool.poetry.group.docs.dependencies] -sphinx = "*" -sphinx-rtd-theme = "*" -sphinx-autoapi = "*" +[project.scripts] +perun = "perun.api.cli:cli" -[tool.poetry.group.mpi] -optional = true +[tool.pdm.build] +includes = [] -[tool.poetry.group.mpi.dependencies] -mpi4py = "^3.1" +[build-system] +requires = ["pdm-backend"] +build-backend = "pdm.backend" + +[tool.pdm] +distribution = true + +[tool.pdm.dev-dependencies] +dev = [ + "pytest>=6.0.0", + "pytest-cov", + "flake8>=4.0.0", + "mypy>=1.0.0", + "black>=22.0.0", + "pre-commit>=3.0.0", + "pydocstyle", + "python-semantic-release>=8.0.0", +] +docs = [ + "sphinx>=7.0.0", + "sphinx-rtd-theme>=2.0.0", + "sphinx-autoapi", +] [tool.semantic_release] version_variables = [ "perun/__init__.py:__version__", "docs/conf.py:release" ] -version_toml = ["pyproject.toml:tool.poetry.version"] +version_toml = ["pyproject.toml:project.version"] commit_message = "{version} [skip ci]" [tool.semantic_release.remote.token] @@ -82,10 +83,6 @@ profile = "black" match-dir = 'perun' convention = 'numpy' -[build-system] -requires = ["poetry-core>=1.0.0"] -build-backend = "poetry.core.masonry.api" - [tool.mypy] exclude = [ 'tests/**/*'