From b89f6db81f0fffb21a817113531383b0487895dd Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Fri, 15 Dec 2023 15:50:41 -0600 Subject: [PATCH 1/7] first attempt at pyproject.toml [wheel build] --- .../pydarshan/RELEASE-CHECKLIST-PyDarshan.txt | 2 - darshan-util/pydarshan/pyproject.toml | 38 +++++++++++++++++++ darshan-util/pydarshan/setup.py | 35 ----------------- 3 files changed, 38 insertions(+), 37 deletions(-) diff --git a/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt b/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt index 31858a589..708a28b79 100644 --- a/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt +++ b/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt @@ -10,9 +10,7 @@ Notes on how to release a new version of PyDarshan - Update CHANGELOG.rst - commit - Update version numbers in: - setup.py pyproject.toml - setup.cfg darshan/__init__.py - Make sure documentation in docs/ is up to date - commit diff --git a/darshan-util/pydarshan/pyproject.toml b/darshan-util/pydarshan/pyproject.toml index 326aad620..944774d74 100644 --- a/darshan-util/pydarshan/pyproject.toml +++ b/darshan-util/pydarshan/pyproject.toml @@ -8,6 +8,44 @@ requires = [ name = "darshan" requires-python = ">=3.7" version = "3.4.4.0" +description = "Python tools to interact with Darshan log records of HPC applications." +readme = 'README.rst' +dependencies = [ + "cffi", + "numpy", + "pandas", + "matplotlib", + "seaborn", + "mako", + "humanize" +] +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "Intended Audience :: Science/Research", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12" +] + +[project.urls] +homepage = 'https://www.mcs.anl.gov/research/projects/darshan/' +repository = 'https://github.com/darshan-hpc/darshan' + +[project.optional-dependencies] +test = [ + "packaging", + "pytest", + "lxml", + "matplotlib", + "importlib_resources;python_version<'3.9'", + "humanize" +] [tool.cibuildwheel] environment = "PYDARSHAN_BUILD_EXT=1" diff --git a/darshan-util/pydarshan/setup.py b/darshan-util/pydarshan/setup.py index 541d2bdd3..126beba33 100644 --- a/darshan-util/pydarshan/setup.py +++ b/darshan-util/pydarshan/setup.py @@ -9,17 +9,6 @@ raise RuntimeError("Python version >= 3.7 required.") -with open("README.rst") as readme_file: - readme = readme_file.read() - - -requirements = ["cffi", "numpy", "pandas", "matplotlib", "seaborn", "mako", "humanize"] - -setup_requirements = [ - "pytest-runner", -] -test_requirements = ["pytest"] - # NOTE: The Python C extension is currently only used to automate # the build process of binary wheels for distribution via PyPi. @@ -54,33 +43,9 @@ setup( - author="", - author_email="", - classifiers=[ - "Development Status :: 4 - Beta", - "Intended Audience :: Developers", - "Intended Audience :: Science/Research", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - ], - description="Python tools to interact with darshan log records of HPC applications.", - long_description=readme, ext_modules=ext_modules, - install_requires=requirements, include_package_data=True, - keywords="darshan", - name="darshan", packages=find_packages(include=["darshan"]), - setup_requires=setup_requirements, - tests_require=test_requirements, - url='https://www.mcs.anl.gov/research/projects/darshan/', - version='3.4.4.0', zip_safe=False, package_data={"": ["*.darshan"], "darshan": ["cli/style.css", From 1274cf2bc0eecd72692e136767220812dadc51da Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Fri, 15 Dec 2023 17:56:21 -0600 Subject: [PATCH 2/7] consolidate pytest dependencies --- .github/workflows/main_ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main_ci.yml b/.github/workflows/main_ci.yml index 4e6bec0f9..475136b13 100644 --- a/.github/workflows/main_ci.yml +++ b/.github/workflows/main_ci.yml @@ -32,7 +32,7 @@ jobs: - name: Install dependencies run: | python -m pip install --upgrade pip - python -m pip install --upgrade pytest pyflakes asv pytest-cov lxml matplotlib packaging humanize "mypy<1.0.0" + python -m pip install --upgrade pyflakes asv pytest-cov "mypy<1.0.0" - if: ${{matrix.platform == 'macos-latest'}} name: Install MacOS deps run: | @@ -53,7 +53,7 @@ jobs: - name: Install pydarshan run: | cd darshan-util/pydarshan - python -m pip install . + python -m pip install .[test] # shim for importlib.resources on Python < 3.9 - if: ${{matrix.python-version < 3.9}} name: Install importlib_resources From a58aeded606176b8e281fc724844a8357d481031 Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Fri, 15 Dec 2023 18:11:25 -0600 Subject: [PATCH 3/7] more test dependency consolidation --- .github/workflows/main_ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/main_ci.yml b/.github/workflows/main_ci.yml index 475136b13..c54016b79 100644 --- a/.github/workflows/main_ci.yml +++ b/.github/workflows/main_ci.yml @@ -54,11 +54,6 @@ jobs: run: | cd darshan-util/pydarshan python -m pip install .[test] - # shim for importlib.resources on Python < 3.9 - - if: ${{matrix.python-version < 3.9}} - name: Install importlib_resources - run: | - python -m pip install -U importlib_resources # only install the darshan_logs project in some CI # entries so we test proper handling of skips # in test suite From 1963654c7ea82fcaf82c1ae67839daf9a5eed124 Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Mon, 18 Dec 2023 11:33:39 -0600 Subject: [PATCH 4/7] more migration from setup.py to pyproject.toml --- darshan-util/pydarshan/pyproject.toml | 11 +++++++++++ darshan-util/pydarshan/setup.py | 11 +---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/darshan-util/pydarshan/pyproject.toml b/darshan-util/pydarshan/pyproject.toml index 944774d74..52c78870c 100644 --- a/darshan-util/pydarshan/pyproject.toml +++ b/darshan-util/pydarshan/pyproject.toml @@ -47,6 +47,17 @@ test = [ "humanize" ] +[tool.setuptools.packages.find] +include = ["darshan"] + +[tool.setuptools.package-data] +"*" = ["*.darshan"] +"darshan" = ["cli/style.css", + "cli/base.html", + "examples/example_logs/*", + "examples/darshan-graph/*", + "tests/input/*"] + [tool.cibuildwheel] environment = "PYDARSHAN_BUILD_EXT=1" skip = [ diff --git a/darshan-util/pydarshan/setup.py b/darshan-util/pydarshan/setup.py index 126beba33..46b1bb258 100644 --- a/darshan-util/pydarshan/setup.py +++ b/darshan-util/pydarshan/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from setuptools import setup, find_packages, Extension +from setuptools import setup, Extension import sys import os @@ -44,13 +44,4 @@ setup( ext_modules=ext_modules, - include_package_data=True, - packages=find_packages(include=["darshan"]), - zip_safe=False, - package_data={"": ["*.darshan"], - "darshan": ["cli/style.css", - "cli/base.html", - "examples/example_logs/*", - "examples/darshan-graph/*", - "tests/input/*"]}, ) From c5cee7011ca2cef6439808a811116d9826966c3b Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Tue, 19 Dec 2023 09:39:51 -0600 Subject: [PATCH 5/7] add build_meta backend [wheel build] --- darshan-util/pydarshan/pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/darshan-util/pydarshan/pyproject.toml b/darshan-util/pydarshan/pyproject.toml index 52c78870c..b18badc86 100644 --- a/darshan-util/pydarshan/pyproject.toml +++ b/darshan-util/pydarshan/pyproject.toml @@ -3,6 +3,7 @@ requires = [ "wheel", "setuptools>=65.0.0", ] +build-backend = "setuptools.build_meta" [project] name = "darshan" From 6d8bbc8c0c691fdd9cd8ef0c904526a88e0287fa Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Tue, 19 Dec 2023 20:32:53 -0600 Subject: [PATCH 6/7] reduce setup.cfg --- darshan-util/pydarshan/setup.cfg | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/darshan-util/pydarshan/setup.cfg b/darshan-util/pydarshan/setup.cfg index 08aa76875..6fbbb57b6 100644 --- a/darshan-util/pydarshan/setup.cfg +++ b/darshan-util/pydarshan/setup.cfg @@ -10,17 +10,3 @@ replace = version='{new_version}' [bumpversion:file:darshan/__init__.py] search = __version__ = '{current_version}' replace = __version__ = '{new_version}' - -[bdist_wheel] -universal = 1 - -[flake8] -exclude = docs -ignore = E501 E231 E265 E303 E271 E272 - -[aliases] -test = pytest - -[tool:pytest] -testpaths = tests - From 9733ad884310149d9dcc49d3c2bbfe0febb8833f Mon Sep 17 00:00:00 2001 From: Shane Snyder Date: Tue, 19 Dec 2023 21:22:41 -0600 Subject: [PATCH 7/7] extract package version in pyproject.toml --- .../pydarshan/RELEASE-CHECKLIST-PyDarshan.txt | 1 - darshan-util/pydarshan/pyproject.toml | 5 ++++- darshan-util/pydarshan/setup.cfg | 12 ------------ 3 files changed, 4 insertions(+), 14 deletions(-) delete mode 100644 darshan-util/pydarshan/setup.cfg diff --git a/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt b/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt index 708a28b79..665c6f845 100644 --- a/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt +++ b/darshan-util/pydarshan/RELEASE-CHECKLIST-PyDarshan.txt @@ -10,7 +10,6 @@ Notes on how to release a new version of PyDarshan - Update CHANGELOG.rst - commit - Update version numbers in: - pyproject.toml darshan/__init__.py - Make sure documentation in docs/ is up to date - commit diff --git a/darshan-util/pydarshan/pyproject.toml b/darshan-util/pydarshan/pyproject.toml index b18badc86..9d6abc187 100644 --- a/darshan-util/pydarshan/pyproject.toml +++ b/darshan-util/pydarshan/pyproject.toml @@ -7,8 +7,8 @@ build-backend = "setuptools.build_meta" [project] name = "darshan" +dynamic = ["version"] requires-python = ">=3.7" -version = "3.4.4.0" description = "Python tools to interact with Darshan log records of HPC applications." readme = 'README.rst' dependencies = [ @@ -59,6 +59,9 @@ include = ["darshan"] "examples/darshan-graph/*", "tests/input/*"] +[tool.setuptools.dynamic] +version = {attr = "darshan.__version__"} + [tool.cibuildwheel] environment = "PYDARSHAN_BUILD_EXT=1" skip = [ diff --git a/darshan-util/pydarshan/setup.cfg b/darshan-util/pydarshan/setup.cfg deleted file mode 100644 index 6fbbb57b6..000000000 --- a/darshan-util/pydarshan/setup.cfg +++ /dev/null @@ -1,12 +0,0 @@ -[bumpversion] -current_version = 3.4.4.0 -commit = False -tag = False - -[bumpversion:file:setup.py] -search = version='{current_version}' -replace = version='{new_version}' - -[bumpversion:file:darshan/__init__.py] -search = __version__ = '{current_version}' -replace = __version__ = '{new_version}'