From 470e1e707e752cf98f3f9695b79502b9c36da577 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:08:09 -0700 Subject: [PATCH 01/32] Adds automated codecov support to Hatchet --- .codecov.yml | 13 ----------- .github/workflows/unit-tests.yaml | 37 +++++++++++++++---------------- codecov.yml | 15 +++++++++++++ 3 files changed, 33 insertions(+), 32 deletions(-) delete mode 100644 .codecov.yml create mode 100644 codecov.yml diff --git a/.codecov.yml b/.codecov.yml deleted file mode 100644 index cf365785..00000000 --- a/.codecov.yml +++ /dev/null @@ -1,13 +0,0 @@ -coverage: - precision: 2 - round: nearest - range: 60...90 - status: - project: - default: yes - -ignore: - - hatchet/tests/* - - docs/examples/* - -comment: off diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 03a59781..7554a729 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -17,7 +17,7 @@ jobs: # https://github.com/actions/setup-python/issues/162 os: [ubuntu-20.04] # TODO: add pypy2, pypy3 - python-version: [3.6, 3.7, 3.8] + python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] exclude: - os: macos-latest python-version: [3.6] @@ -57,15 +57,11 @@ jobs: - name: Check License Headers run: | python license.py verify - - - name: Update Coverage - if: ${{ matrix.python-version == 3.8 }} - run: | - pip install coverage==6.2 - - - name: Basic Test with pytest + + - name: Install coverage tools run: | - PYTHONPATH=. coverage run $(which pytest) + pip install codecov + pip install pytest-cov - name: Clone Caliper uses: actions/checkout@v2 @@ -98,13 +94,16 @@ jobs: - name: Test Caliper and Timemory Support with pytest run: | - PYTHONPATH=. coverage run $(which pytest) - -# - name: "Upload coverage to Codecov" -# uses: codecov/codecov-action@d9f34f8cd5cb3b3eb79b3e4b5dae3a16df499a70 # @v2.1.0 -# if: ${{ matrix.python-version >= 3.7 }} -# with: -# fail_ci_if_error: true -# verbose: true -# env_vars: OS,PYTHON -# directory: ./.coverage + PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v4 + env: + CODECOV_TOKEN: ${{ secrets.HATCHET_CODECOV_TOKEN }} + with: + directory: ./coverage/reports + env_vars: OS,PYTHON + files: /home/runner/work/hatchet/hatchet/coverage.xml + flags: unittests + verbose: true + fail_ci_if_error: true \ No newline at end of file diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 00000000..12a2d870 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,15 @@ +coverage: + round: down + range: 65...100 + +ignore: + - hatchet/tests/* + - docs/examples/* + +comment: + layout: "header, diff, changes, tree" + behavior: new + require_changes: false + require_base: false + require_head: true + after_n_builds: 5 From 029e1472a8109867409f91f1c5a62d817a9c1c4e Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:17:20 -0700 Subject: [PATCH 02/32] Bumps Python version for black and flake checks to 3.9 to ensure tool compatibility --- .github/workflows/unit-tests.yaml | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 7554a729..25201d63 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -18,9 +18,6 @@ jobs: os: [ubuntu-20.04] # TODO: add pypy2, pypy3 python-version: [3.7, 3.8, 3.9, "3.10", "3.11"] - exclude: - - os: macos-latest - python-version: [3.6] steps: - uses: actions/checkout@v2 @@ -41,7 +38,7 @@ jobs: python -m pip list - name: Update Black - if: ${{ matrix.python-version == 3.7 }} + if: ${{ matrix.python-version == 3.9 }} run: | pip install flake8-pytest-importorskip pip install --upgrade click==8.0.4 @@ -49,7 +46,7 @@ jobs: pip install flake8==4.0.1 - name: Lint and Format Check with Flake8 and Black - if: ${{ matrix.python-version == 3.7 }} + if: ${{ matrix.python-version == 3.9 }} run: | black --diff --check . flake8 From e78da9980f6d0ab49349169b7ecaec893c71ff7e Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 20:43:33 -0700 Subject: [PATCH 03/32] Initial changes --- meson.build | 7 +++ pyproject.toml | 80 ++++++++++++++++++++++++-------- setup.py | 123 ------------------------------------------------- 3 files changed, 67 insertions(+), 143 deletions(-) create mode 100644 meson.build delete mode 100644 setup.py diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..5aab6843 --- /dev/null +++ b/meson.build @@ -0,0 +1,7 @@ +project('llnl-hatchet', 'cython', + license: 'MIT' + version: '2024.2.0' +) + +py = import('python').find_installation(pure: false) +cython = find_program('cython') diff --git a/pyproject.toml b/pyproject.toml index 4dec4d54..5231ccb7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,33 +1,73 @@ [build-system] -requires = ["setuptools", "wheel", "Cython"] -build-backend = "setuptools.build_meta" +requires = ["meson-python", "meson[ninja]", "Cython"] +build-backend = "mesonpy" -[tool.poetry] +[project] name = "llnl-hatchet" -version = "2024.1.1" -description = "A Python library for analyzing hierarchical performance data." -authors = [ - "Abhinav Bhatele ", - "Stephanie Brink ", - "Todd Gamblin ", -] license = "MIT" +description = "A Python library for analyzing hierarchical performance data" +readme = "./README.md" +dynamic = ["version"] +classifiers = [ + "Development Status :: 5 - Production/Stable", + "License :: OSI Approved :: MIT License", +] +requires-python = ">= 3.7" +dependencies = [ + "pydot", + "PyYAML", + "matplotlib", + "numpy", + "pandas", + "textX < 3.0.0; python_version < '3.6'", + "textX >= 3.0.0; python_version >= '3.6'", + "multiprocess", + "caliper-reader", +] + +[project.urls] +source_code = "https://github.com/llnl/hatchet" +documentation = "https://llnl-hatchet.readthedocs.io/en/latest/" + +[[project.authors]] +name = "Abhinav Bhatele" +email = "bhatele@cs.umd.edu" + +[[project.authors]] +name = "Stephanie Brink" +email = "brink2@llnl.gov" + +[[project.authors]] +name = "Todd Gamblin" +email = "tgamblin@llnl.gov" + +[[project.maintainers]] +name = "Olga Pearce" +email = "pearce8@llnl.gov" + +[[project.maintainers]] +name = "Ian Lumsden" +email = "ilumsden@vols.utk.edu" + +[[project.maintainers]] +name = "Connor Scully-Allison" +email = "cscullyallison@sci.utah.edu" [tool.ruff] line-length = 88 target-version = 'py37' include = ['\.pyi?$'] exclude = [ - ".eggs", - ".git", - ".hg", - ".mypy_cache", - ".tox", - ".venv", - "_build", - "buck-out", - "build", - "dist", + ".eggs", + ".git", + ".hg", + ".mypy_cache", + ".tox", + ".venv", + "_build", + "buck-out", + "build", + "dist", ] [tool.black] diff --git a/setup.py b/setup.py deleted file mode 100644 index c2784924..00000000 --- a/setup.py +++ /dev/null @@ -1,123 +0,0 @@ -# Copyright 2017-2023 Lawrence Livermore National Security, LLC and other -# Hatchet Project Developers. See the top-level LICENSE file for details. -# -# SPDX-License-Identifier: MIT - -from setuptools import setup -from setuptools import Extension -from codecs import open -from os import path - -here = path.abspath(path.dirname(__file__)) - -# Get the long description from the README file -with open(path.join(here, "README.md"), encoding="utf-8") as f: - long_description = f.read() - -# Get the version in a safe way which does not refrence hatchet `__init__` file -# per python docs: https://packaging.python.org/guides/single-sourcing-package-version/ -version = {} -with open("./hatchet/version.py") as fp: - exec(fp.read(), version) - - -cmd_class = {} -ext_modules = [] -should_cythonize = False -mod_import_path = "hatchet.cython_modules.libs" -mod_file_path = "hatchet/cython_modules" -mod_names = [ - "reader_modules", - "graphframe_modules", -] - - -for mname in mod_names: - c_file = path.join(mod_file_path, "{}.c".format(mname)) - pyx_file = path.join(mod_file_path, "{}.pyx".format(mname)) - if not path.isfile(pyx_file): - raise FileNotFoundError( - "Requested Cython extension not found: {}".format(pyx_file) - ) - if path.isfile(c_file): - should_cythonize = False - ext_modules.append( - Extension( - "{}.{}".format(mod_import_path, mname), - [c_file], - ) - ) - else: - should_cythonize = True - ext_modules.append( - Extension( - "{}.{}".format(mod_import_path, mname), - [pyx_file], - ) - ) - -if should_cythonize: - from Cython.Build import cythonize, build_ext - - ext_modules = cythonize(ext_modules) - cmd_class.update({"build_ext": build_ext}) - - -ext_modules = [ - Extension( - "hatchet.cython_modules.libs.reader_modules", - ["hatchet/cython_modules/reader_modules.pyx"], - ), - Extension( - "hatchet.cython_modules.libs.graphframe_modules", - ["hatchet/cython_modules/graphframe_modules.pyx"], - ), -] - - -setup( - name="llnl-hatchet", - version=version["__version__"], - license="MIT", - description="A Python library for analyzing hierarchical performance data", - long_description=long_description, - long_description_content_type="text/markdown", - url="https://github.com/llnl/hatchet", - project_urls={ - "Source Code": "https://github.com/llnl/hatchet", - "Documentation": "https://llnl-hatchet.readthedocs.io/en/latest/", - }, - author="Stephanie Brink", - author_email="brink2@llnl.gov", - classifiers=[ - "Development Status :: 5 - Production/Stable", - "License :: OSI Approved :: MIT License", - ], - keywords="", - python_requires=">=3.5", - packages=[ - "hatchet", - "hatchet.readers", - "hatchet.writers", - "hatchet.query", - "hatchet.vis", - "hatchet.util", - "hatchet.external", - "hatchet.tests", - "hatchet.cython_modules.libs", - ], - include_package_data=True, - install_requires=[ - "pydot", - "PyYAML", - "matplotlib", - "numpy", - "pandas", - "textX < 3.0.0; python_version < '3.6'", - "textX >= 3.0.0; python_version >= '3.6'", - "multiprocess", - "caliper-reader", - ], - ext_modules=ext_modules, - cmdclass=cmd_class, -) From ca108fc8ddeaa2b4e0e1462b7c9490fba1019123 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 20:58:58 -0700 Subject: [PATCH 04/32] Sets gitattributes to not capture tests directory in dist --- .gitattributes | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..42c55e01 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +hatchet/tests export-ignore \ No newline at end of file From d4b779171fd5f6426481ba825ba285f70dd0e5aa Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 21:06:48 -0700 Subject: [PATCH 05/32] Further updates to gitattributes and gitignore --- .gitattributes | 14 +++++++++++++- .gitignore | 1 + 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 42c55e01..a985e29d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,13 @@ -hatchet/tests export-ignore \ No newline at end of file +hatchet/tests export-ignore +screeshot.png export-ignore +pytest.ini export-ignore +logo.png export-ignore +logo-hex.png export-ignore +install.sh export-ignore +CHANGELOG.md export-ignore +.pre-commit-config.yaml export-ignore +.fake8 export-ignore +.coveragerc export-ignore +.codecov.yml export-ignore +docs export-ignore +.github export-ignore \ No newline at end of file diff --git a/.gitignore b/.gitignore index 7473c86b..a30bdca5 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ hatchet/vis/static/*_bundle* dist/ llnl_hatchet.egg-info/ +**/__pycache__/ From 26f7493461d898a3520f267f12b5072115b3e45d Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 21:08:14 -0700 Subject: [PATCH 06/32] Spelling fix --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index a985e29d..7c2c9918 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,5 @@ hatchet/tests export-ignore -screeshot.png export-ignore +screenshot.png export-ignore pytest.ini export-ignore logo.png export-ignore logo-hex.png export-ignore From 0af93d1cae7118dd4a35170cf51c9282bf490534 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 21:28:14 -0700 Subject: [PATCH 07/32] Current progress --- hatchet/cython_modules/meson.build | 14 ++++++++++++++ hatchet/external/meson.build | 10 ++++++++++ hatchet/meson.build | 22 ++++++++++++++++++++++ meson.build | 4 +++- 4 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 hatchet/cython_modules/meson.build create mode 100644 hatchet/external/meson.build create mode 100644 hatchet/meson.build diff --git a/hatchet/cython_modules/meson.build b/hatchet/cython_modules/meson.build new file mode 100644 index 00000000..98de7b31 --- /dev/null +++ b/hatchet/cython_modules/meson.build @@ -0,0 +1,14 @@ +cython_module_names = [ + 'graphframe_modules', + 'reader_modules' +] + +foreach mod_name : cython_module_names + py.extension_module( + mod_name, + mod_name + '.pyx', + dependencies: py_dep, + subdir: 'hatchet/cython_modules/lib', + install: true + ) +endforeach \ No newline at end of file diff --git a/hatchet/external/meson.build b/hatchet/external/meson.build new file mode 100644 index 00000000..01857778 --- /dev/null +++ b/hatchet/external/meson.build @@ -0,0 +1,10 @@ +hatchet_external_python_sources = [ + '__init__.py', + 'console.py' +] + +py.install_sources( + hatchet_external_python_sources, + pure: false, + subdir: 'hatchet/external' +) \ No newline at end of file diff --git a/hatchet/meson.build b/hatchet/meson.build new file mode 100644 index 00000000..84087270 --- /dev/null +++ b/hatchet/meson.build @@ -0,0 +1,22 @@ +hatchet_python_sources = [ + '__init__.py', + 'frame.py', + 'graph.py', + 'graphframe.py', + 'node.py', + 'version.py' +] + +py.install_sources( + hatchet_python_sources, + pure: false, + subdir: 'hatchet' +) + +subdir('cython_modules') +subdir('external') +subdir('query') +subdir('readers') +subdir('util') +subdir('vis') +subdir('writers') \ No newline at end of file diff --git a/meson.build b/meson.build index 5aab6843..9ada67c6 100644 --- a/meson.build +++ b/meson.build @@ -4,4 +4,6 @@ project('llnl-hatchet', 'cython', ) py = import('python').find_installation(pure: false) -cython = find_program('cython') +py_dep = py.dependency() + +subdir('hatchet') \ No newline at end of file From 60e2f8c0c6bba5e74868a82039dc25155979f5f0 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Wed, 22 May 2024 22:08:33 -0700 Subject: [PATCH 08/32] Gets a fully working package with meson-python --- hatchet/cython_modules/meson.build | 2 +- hatchet/external/meson.build | 7 +++++- hatchet/query/meson.build | 16 ++++++++++++ hatchet/readers/meson.build | 22 +++++++++++++++++ hatchet/util/meson.build | 16 ++++++++++++ hatchet/vis/meson.build | 39 ++++++++++++++++++++++++++++++ hatchet/writers/meson.build | 11 +++++++++ meson.build | 2 +- pyproject.toml | 4 ++- 9 files changed, 115 insertions(+), 4 deletions(-) create mode 100644 hatchet/query/meson.build create mode 100644 hatchet/readers/meson.build create mode 100644 hatchet/util/meson.build create mode 100644 hatchet/vis/meson.build create mode 100644 hatchet/writers/meson.build diff --git a/hatchet/cython_modules/meson.build b/hatchet/cython_modules/meson.build index 98de7b31..c84870c8 100644 --- a/hatchet/cython_modules/meson.build +++ b/hatchet/cython_modules/meson.build @@ -8,7 +8,7 @@ foreach mod_name : cython_module_names mod_name, mod_name + '.pyx', dependencies: py_dep, - subdir: 'hatchet/cython_modules/lib', + subdir: 'hatchet' / 'cython_modules' / 'libs', install: true ) endforeach \ No newline at end of file diff --git a/hatchet/external/meson.build b/hatchet/external/meson.build index 01857778..80bd1abf 100644 --- a/hatchet/external/meson.build +++ b/hatchet/external/meson.build @@ -6,5 +6,10 @@ hatchet_external_python_sources = [ py.install_sources( hatchet_external_python_sources, pure: false, - subdir: 'hatchet/external' + subdir: 'hatchet' / 'external' +) + +install_subdir( + 'roundtrip', + install_dir: py_top_install_dir / 'hatchet' / 'external' ) \ No newline at end of file diff --git a/hatchet/query/meson.build b/hatchet/query/meson.build new file mode 100644 index 00000000..d898af68 --- /dev/null +++ b/hatchet/query/meson.build @@ -0,0 +1,16 @@ +hatchet_query_python_sources = [ + '__init__.py', + 'compat.py', + 'compound.py', + 'engine.py', + 'errors.py', + 'object_dialect.py', + 'query.py', + 'string_dialect.py' +] + +py.install_sources( + hatchet_query_python_sources, + pure: false, + subdir: 'hatchet' / 'query' +) \ No newline at end of file diff --git a/hatchet/readers/meson.build b/hatchet/readers/meson.build new file mode 100644 index 00000000..a4459ffe --- /dev/null +++ b/hatchet/readers/meson.build @@ -0,0 +1,22 @@ +hatchet_readers_python_sources = [ + '__init__.py', + 'caliper_native_reader.py', + 'caliper_reader.py', + 'cprofile_reader.py', + 'dataframe_reader.py', + 'gprof_dot_reader.py', + 'hdf5_reader.py', + 'hpctoolkit_reader.py', + 'json_reader.py', + 'literal_reader.py', + 'pyinstrument_reader.py', + 'spotdb_reader.py', + 'tau_reader.py', + 'timemory_reader.py' +] + +py.install_sources( + hatchet_readers_python_sources, + pure: false, + subdir: 'hatchet' / 'readers' +) \ No newline at end of file diff --git a/hatchet/util/meson.build b/hatchet/util/meson.build new file mode 100644 index 00000000..75561e64 --- /dev/null +++ b/hatchet/util/meson.build @@ -0,0 +1,16 @@ +hatchet_util_python_sources = [ + '__init__.py', + 'colormaps.py', + 'config.py', + 'deprecated.py', + 'dot.py', + 'executable.py', + 'profiler.py', + 'timer.py' +] + +py.install_sources( + hatchet_util_python_sources, + pure: false, + subdir: 'hatchet' / 'util' +) \ No newline at end of file diff --git a/hatchet/vis/meson.build b/hatchet/vis/meson.build new file mode 100644 index 00000000..c54bc684 --- /dev/null +++ b/hatchet/vis/meson.build @@ -0,0 +1,39 @@ +hatchet_vis_python_sources = [ + '__init__.py', + 'loader.py', + 'static_fixer.py' +] + +py.install_sources( + hatchet_vis_python_sources, + pure: false, + subdir: 'hatchet' / 'vis' +) + +hatchet_vis_install_dir = py_top_install_dir / 'hatchet' / 'vis' + +install_subdir( + 'external', + install_dir: hatchet_vis_install_dir +) +install_subdir( + 'scripts', + install_dir: hatchet_vis_install_dir +) +install_subdir( + 'static', + install_dir: hatchet_vis_install_dir +) +install_subdir( + 'styles', + install_dir: hatchet_vis_install_dir +) +install_subdir( + 'templates', + install_dir: hatchet_vis_install_dir +) + +install_data( + 'package.json', 'README.md', 'requirements.txt', 'webpack.config.js', + install_dir: hatchet_vis_install_dir +) \ No newline at end of file diff --git a/hatchet/writers/meson.build b/hatchet/writers/meson.build new file mode 100644 index 00000000..e2793661 --- /dev/null +++ b/hatchet/writers/meson.build @@ -0,0 +1,11 @@ +hatchet_writers_python_sources = [ + '__init__.py', + 'dataframe_writer.py', + 'hdf5_writer.py' +] + +py.install_sources( + hatchet_writers_python_sources, + pure: false, + subdir: 'hatchet' / 'writers' +) \ No newline at end of file diff --git a/meson.build b/meson.build index 9ada67c6..35034d3f 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,9 @@ project('llnl-hatchet', 'cython', - license: 'MIT' version: '2024.2.0' ) py = import('python').find_installation(pure: false) py_dep = py.dependency() +py_top_install_dir = py.get_install_dir() subdir('hatchet') \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 5231ccb7..c96cc744 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,6 @@ build-backend = "mesonpy" [project] name = "llnl-hatchet" -license = "MIT" description = "A Python library for analyzing hierarchical performance data" readme = "./README.md" dynamic = ["version"] @@ -25,6 +24,9 @@ dependencies = [ "caliper-reader", ] +[project.license] +file = "LICENSE" + [project.urls] source_code = "https://github.com/llnl/hatchet" documentation = "https://llnl-hatchet.readthedocs.io/en/latest/" From d5a76c9714ca1c1cf1a2f63ee4af078150417f94 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 09:47:52 -0700 Subject: [PATCH 09/32] Removes 'meson[ninja]' from pyproject.toml's build-system.requires since ninja shouldn't be required --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c96cc744..136d4fb2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["meson-python", "meson[ninja]", "Cython"] +requires = ["meson-python", "Cython"] build-backend = "mesonpy" [project] From f101329e669be97af9fd929ca9efd6a5976fdd65 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 10:48:24 -0700 Subject: [PATCH 10/32] Cleans up metadata in pyproject.toml --- pyproject.toml | 42 ++++++++++++++---------------------------- 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 136d4fb2..f12a3df3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,12 +5,25 @@ build-backend = "mesonpy" [project] name = "llnl-hatchet" description = "A Python library for analyzing hierarchical performance data" -readme = "./README.md" dynamic = ["version"] +readme = "./README.md" +license = { file="LICENSE" } classifiers = [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: MIT License", ] +authors = [ + { name = "Abhinav Bhatele", email = "bhatele@cs.umd.edu" }, + { name = "Stephanie Brink", email = "brink2@llnl.gov" }, + { name = "Todd Gamblin", email = "tgamblin@llnl.gov" } +] +maintainers = [ + { name = "Olga Pearce", email = "pearce8@llnl.gov" }, + { name = "Ian Lumsden", email = "ilumsden@vols.utk.edu" }, + { name = "Connor Scully-Allison", email = "cscullyallison@sci.utah.edu" }, + { name = "Dewi Yokelson", email = "dewiy@cs.uoregon.edu" }, + { name = "Michael McKinsey", email = "michaelmckinsey@tamu.edu" } +] requires-python = ">= 3.7" dependencies = [ "pydot", @@ -24,37 +37,10 @@ dependencies = [ "caliper-reader", ] -[project.license] -file = "LICENSE" - [project.urls] source_code = "https://github.com/llnl/hatchet" documentation = "https://llnl-hatchet.readthedocs.io/en/latest/" -[[project.authors]] -name = "Abhinav Bhatele" -email = "bhatele@cs.umd.edu" - -[[project.authors]] -name = "Stephanie Brink" -email = "brink2@llnl.gov" - -[[project.authors]] -name = "Todd Gamblin" -email = "tgamblin@llnl.gov" - -[[project.maintainers]] -name = "Olga Pearce" -email = "pearce8@llnl.gov" - -[[project.maintainers]] -name = "Ian Lumsden" -email = "ilumsden@vols.utk.edu" - -[[project.maintainers]] -name = "Connor Scully-Allison" -email = "cscullyallison@sci.utah.edu" - [tool.ruff] line-length = 88 target-version = 'py37' From cbfe0d221576b384f147003e0b17ff4535e8d288 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 11:25:35 -0700 Subject: [PATCH 11/32] Adds a check to the top-level meson.build to ensure the version in version.py is correct --- hatchet/util/print_version.py | 8 ++++++++ meson.build | 16 +++++++++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 hatchet/util/print_version.py diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py new file mode 100644 index 00000000..492a25fa --- /dev/null +++ b/hatchet/util/print_version.py @@ -0,0 +1,8 @@ +import os +import sys + +sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + +from version import __version__ + +print(__version__) \ No newline at end of file diff --git a/meson.build b/meson.build index 35034d3f..85aa4a38 100644 --- a/meson.build +++ b/meson.build @@ -1,9 +1,23 @@ +# Setup the Meson Project project('llnl-hatchet', 'cython', - version: '2024.2.0' + version: '2024.1.1' ) +# Get the Meson Python object, a dependency object to Python for extension modules, +# and the path to the top-level install directory py = import('python').find_installation(pure: false) py_dep = py.dependency() py_top_install_dir = py.get_install_dir() +# Verify that the version from version.py matches the Meson project version +version_run = run_command(py.path(), meson.current_source_dir() / 'hatchet' / 'util' / 'print_version.py') +if version_run.returncode() != 0 + error('The __version__ variable in Hatchet cannot be determined') +endif +version_from_py = version_run.stdout().strip() +if not version_from_py.version_compare(meson.project_version()) + error('The __version__ variable in Hatchet does not match the Meson project version') +endif + +# Enter the 'hatchet' subdirectory subdir('hatchet') \ No newline at end of file From 60b1e11ec6f25e02c1dbbc4beef8a66e18ed5700 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 11:25:41 -0700 Subject: [PATCH 12/32] Adds comments --- hatchet/cython_modules/meson.build | 3 +++ hatchet/external/meson.build | 5 +++++ hatchet/meson.build | 4 ++++ hatchet/query/meson.build | 3 +++ hatchet/readers/meson.build | 3 +++ hatchet/util/meson.build | 5 +++++ hatchet/vis/meson.build | 8 ++++++++ hatchet/writers/meson.build | 3 +++ 8 files changed, 34 insertions(+) diff --git a/hatchet/cython_modules/meson.build b/hatchet/cython_modules/meson.build index c84870c8..463d6d86 100644 --- a/hatchet/cython_modules/meson.build +++ b/hatchet/cython_modules/meson.build @@ -1,8 +1,11 @@ +# Specify the names of the Cython extension modules, excluding file extensions cython_module_names = [ 'graphframe_modules', 'reader_modules' ] +# Loop over the Cython modules and build/install them to +# /hatchet/cython_modules/libs foreach mod_name : cython_module_names py.extension_module( mod_name, diff --git a/hatchet/external/meson.build b/hatchet/external/meson.build index 80bd1abf..edc44dac 100644 --- a/hatchet/external/meson.build +++ b/hatchet/external/meson.build @@ -1,14 +1,19 @@ +# Specify the pure Python files for this directory hatchet_external_python_sources = [ '__init__.py', 'console.py' ] +# Install the specified pure Python files into +# /hatchet/external py.install_sources( hatchet_external_python_sources, pure: false, subdir: 'hatchet' / 'external' ) +# Install roundtrip as-is into +# /hatchet/external install_subdir( 'roundtrip', install_dir: py_top_install_dir / 'hatchet' / 'external' diff --git a/hatchet/meson.build b/hatchet/meson.build index 84087270..619b2085 100644 --- a/hatchet/meson.build +++ b/hatchet/meson.build @@ -1,3 +1,4 @@ +# Specify the pure Python files for this directory hatchet_python_sources = [ '__init__.py', 'frame.py', @@ -7,12 +8,15 @@ hatchet_python_sources = [ 'version.py' ] +# Install the specified pure Python files into +# /hatchet py.install_sources( hatchet_python_sources, pure: false, subdir: 'hatchet' ) +# Go through all the subdirectories except for 'test' subdir('cython_modules') subdir('external') subdir('query') diff --git a/hatchet/query/meson.build b/hatchet/query/meson.build index d898af68..ca478386 100644 --- a/hatchet/query/meson.build +++ b/hatchet/query/meson.build @@ -1,3 +1,4 @@ +# Specify the pure Python files for this directory hatchet_query_python_sources = [ '__init__.py', 'compat.py', @@ -9,6 +10,8 @@ hatchet_query_python_sources = [ 'string_dialect.py' ] +# Install the specified pure Python files into +# /hatchet/query py.install_sources( hatchet_query_python_sources, pure: false, diff --git a/hatchet/readers/meson.build b/hatchet/readers/meson.build index a4459ffe..d6bbe922 100644 --- a/hatchet/readers/meson.build +++ b/hatchet/readers/meson.build @@ -1,3 +1,4 @@ +# Specify the pure Python files for this directory hatchet_readers_python_sources = [ '__init__.py', 'caliper_native_reader.py', @@ -15,6 +16,8 @@ hatchet_readers_python_sources = [ 'timemory_reader.py' ] +# Install the specified pure Python files into +# /hatchet/readers py.install_sources( hatchet_readers_python_sources, pure: false, diff --git a/hatchet/util/meson.build b/hatchet/util/meson.build index 75561e64..b42b2f3c 100644 --- a/hatchet/util/meson.build +++ b/hatchet/util/meson.build @@ -1,3 +1,6 @@ +# Specify the pure Python files for this directory +# Note: don't include 'print_version.py' because +# that file is not needed in binary distributions hatchet_util_python_sources = [ '__init__.py', 'colormaps.py', @@ -9,6 +12,8 @@ hatchet_util_python_sources = [ 'timer.py' ] +# Install the specified pure Python files into +# /hatchet/util py.install_sources( hatchet_util_python_sources, pure: false, diff --git a/hatchet/vis/meson.build b/hatchet/vis/meson.build index c54bc684..595ed2d2 100644 --- a/hatchet/vis/meson.build +++ b/hatchet/vis/meson.build @@ -1,17 +1,23 @@ +# Specify the pure Python files for this directory hatchet_vis_python_sources = [ '__init__.py', 'loader.py', 'static_fixer.py' ] +# Install the specified pure Python files into +# /hatchet/vis py.install_sources( hatchet_vis_python_sources, pure: false, subdir: 'hatchet' / 'vis' ) +# Install directory for this source directory hatchet_vis_install_dir = py_top_install_dir / 'hatchet' / 'vis' +# Install all the subdirectories for visualization code as-is +# into hatchet_vis_install_dir install_subdir( 'external', install_dir: hatchet_vis_install_dir @@ -33,6 +39,8 @@ install_subdir( install_dir: hatchet_vis_install_dir ) +# Install the following non-Python files as-is +# into hatchet_vis_install_dir install_data( 'package.json', 'README.md', 'requirements.txt', 'webpack.config.js', install_dir: hatchet_vis_install_dir diff --git a/hatchet/writers/meson.build b/hatchet/writers/meson.build index e2793661..da9aaabc 100644 --- a/hatchet/writers/meson.build +++ b/hatchet/writers/meson.build @@ -1,9 +1,12 @@ +# Specify the pure Python files for this directory hatchet_writers_python_sources = [ '__init__.py', 'dataframe_writer.py', 'hdf5_writer.py' ] +# Install the specified pure Python files into +# /hatchet/writers py.install_sources( hatchet_writers_python_sources, pure: false, From e2ff2238cf6aa0732f9f3f26cd49d997e5d01b5f Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 14:53:30 -0700 Subject: [PATCH 13/32] Adds extra for HDF5 writer --- pyproject.toml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index f12a3df3..d90ceb38 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -41,6 +41,11 @@ dependencies = [ source_code = "https://github.com/llnl/hatchet" documentation = "https://llnl-hatchet.readthedocs.io/en/latest/" +[project.optional-dependencies] +hdf_writer = [ + "tables" +] + [tool.ruff] line-length = 88 target-version = 'py37' From 38d45001b34d95f7c08419d8c19f7268424727fa Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 14:53:51 -0700 Subject: [PATCH 14/32] Tweaks CI to install Hatchet locally with pip --- .github/workflows/unit-tests.yaml | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 25201d63..8f5391b3 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -27,15 +27,10 @@ jobs: with: python-version: ${{ matrix.python-version }} - - name: Install Python3 dependencies + - name: Install Hatchet run: | python -m pip install --upgrade pip pytest - pip install -r requirements.txt - # Optional Dependency for HDF Checkpointing - pip install tables - python setup.py install - python setup.py build_ext --inplace - python -m pip list + python -m pip install -e . - name: Update Black if: ${{ matrix.python-version == 3.9 }} From 43a9955a6ea7e90f422239a0b8bf849967145244 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 14:58:45 -0700 Subject: [PATCH 15/32] Fixes license headers --- hatchet/tests/query_compat.py | 2 +- hatchet/util/print_version.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hatchet/tests/query_compat.py b/hatchet/tests/query_compat.py index fae9b5a8..3f669c43 100644 --- a/hatchet/tests/query_compat.py +++ b/hatchet/tests/query_compat.py @@ -1,4 +1,4 @@ -# Copyright 2017-2022 Lawrence Livermore National Security, LLC and other +# Copyright 2017-2023 Lawrence Livermore National Security, LLC and other # Hatchet Project Developers. See the top-level LICENSE file for details. # # SPDX-License-Identifier: MIT diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py index 492a25fa..f3b31284 100644 --- a/hatchet/util/print_version.py +++ b/hatchet/util/print_version.py @@ -1,3 +1,8 @@ +# Copyright 2017-2023 Lawrence Livermore National Security, LLC and other +# Hatchet Project Developers. See the top-level LICENSE file for details. +# +# SPDX-License-Identifier: MIT + import os import sys From ccddb5f6f8779563392f6fc80da6049d295caebb Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:24:52 -0700 Subject: [PATCH 16/32] Formatting fix --- hatchet/util/print_version.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py index f3b31284..a6f977ea 100644 --- a/hatchet/util/print_version.py +++ b/hatchet/util/print_version.py @@ -10,4 +10,4 @@ from version import __version__ -print(__version__) \ No newline at end of file +print(__version__) From 0c9eb9d87122f178dfdcbe1bd717ffdaabdad7b5 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:29:15 -0700 Subject: [PATCH 17/32] Formatting to make flake happy --- .flake8 | 2 ++ hatchet/util/print_version.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.flake8 b/.flake8 index 40ad4a7f..5a9afd25 100644 --- a/.flake8 +++ b/.flake8 @@ -9,3 +9,5 @@ max-line-length = 88 select = C,E,F,W,B,B950 ignore = E501,W503,E203 builtins = IPython +exclude = + build diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py index a6f977ea..360afe4d 100644 --- a/hatchet/util/print_version.py +++ b/hatchet/util/print_version.py @@ -8,6 +8,6 @@ sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) -from version import __version__ +from version import __version__ # noqa: E402 print(__version__) From ecde7ba84ae75665df0450bd8507868e39cb405f Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:37:17 -0700 Subject: [PATCH 18/32] Adds ninja extra to build requirements for Hatchet --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d90ceb38..b5945272 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [build-system] -requires = ["meson-python", "Cython"] +requires = ["meson-python", "meson[ninja]", "Cython"] build-backend = "mesonpy" [project] From 70b2c6b7c87d7e1c4e8710883d949c5d31ef8f49 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:44:16 -0700 Subject: [PATCH 19/32] Adds script for editable installs and tries not using editable in unit tests --- .github/workflows/unit-tests.yaml | 5 +++-- install_editable.sh | 5 +++++ 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 install_editable.sh diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 8f5391b3..37523343 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -30,7 +30,7 @@ jobs: - name: Install Hatchet run: | python -m pip install --upgrade pip pytest - python -m pip install -e . + python -m pip install . - name: Update Black if: ${{ matrix.python-version == 3.9 }} @@ -86,7 +86,8 @@ jobs: - name: Test Caliper and Timemory Support with pytest run: | - PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml + # PYTHONPATH=. $(which pytest) --cov=./ --cov-report=xml + $(which pytest) --cov=./ --cov-report=xml - name: Upload coverage to Codecov uses: codecov/codecov-action@v4 diff --git a/install_editable.sh b/install_editable.sh new file mode 100644 index 00000000..c3d1f21a --- /dev/null +++ b/install_editable.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +python3 -m pip install meson[ninja] meson-python Cython + +python3 -m pip install --no-build-isolation -e . \ No newline at end of file From 2feaace891aa175f41c041709b25151d29bbba36 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:47:14 -0700 Subject: [PATCH 20/32] Adds tables extra to install of Hatchet in CI --- .github/workflows/unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index 37523343..b886bbe0 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -30,7 +30,7 @@ jobs: - name: Install Hatchet run: | python -m pip install --upgrade pip pytest - python -m pip install . + python -m pip install .[tables] - name: Update Black if: ${{ matrix.python-version == 3.9 }} From 4daea241e8dd06c10eb36cf7146c064dccd8c19d Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Thu, 23 May 2024 15:55:15 -0700 Subject: [PATCH 21/32] Fixes the extra name in CI --- .github/workflows/unit-tests.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/unit-tests.yaml b/.github/workflows/unit-tests.yaml index b886bbe0..204803f3 100644 --- a/.github/workflows/unit-tests.yaml +++ b/.github/workflows/unit-tests.yaml @@ -30,7 +30,7 @@ jobs: - name: Install Hatchet run: | python -m pip install --upgrade pip pytest - python -m pip install .[tables] + python -m pip install .[hdf_writer] - name: Update Black if: ${{ matrix.python-version == 3.9 }} From fb08595033115376892607bbb84b76c2496293ad Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 24 May 2024 11:14:30 -0700 Subject: [PATCH 22/32] Update .gitattributes Co-authored-by: Michael McKinsey --- .gitattributes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitattributes b/.gitattributes index 7c2c9918..9ed73389 100644 --- a/.gitattributes +++ b/.gitattributes @@ -6,7 +6,7 @@ logo-hex.png export-ignore install.sh export-ignore CHANGELOG.md export-ignore .pre-commit-config.yaml export-ignore -.fake8 export-ignore +.flake8 export-ignore .coveragerc export-ignore .codecov.yml export-ignore docs export-ignore From 1f9199b23cd9ea27a7aae2ef82e491ecb32323a8 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 24 May 2024 11:14:54 -0700 Subject: [PATCH 23/32] Update pyproject.toml Co-authored-by: Michael McKinsey --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index b5945272..91e13580 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,6 @@ dependencies = [ "matplotlib", "numpy", "pandas", - "textX < 3.0.0; python_version < '3.6'", "textX >= 3.0.0; python_version >= '3.6'", "multiprocess", "caliper-reader", From 2b2e54f7bee0d2848cdd0e5b4e25fd089e1f5453 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 24 May 2024 11:16:01 -0700 Subject: [PATCH 24/32] Drops the version check on the textx dependency since that check will always be true --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 91e13580..5b530c92 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ dependencies = [ "matplotlib", "numpy", "pandas", - "textX >= 3.0.0; python_version >= '3.6'", + "textX >= 3.0.0", "multiprocess", "caliper-reader", ] From f52430d0e73de6ed27ba4ed6fab9aadc8e0bc29a Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 24 May 2024 12:12:07 -0700 Subject: [PATCH 25/32] Deletes install.sh since it will no longer work `install.sh` was used for debugging builds on LLNL systems. However, it was based on deprecated and likely to break functionality from `setuptools`. With `setuptools` being removed, this script will no longer work. Instead, users should use the new `install_editable.sh` script --- install.sh | 13 ------------- 1 file changed, 13 deletions(-) delete mode 100755 install.sh diff --git a/install.sh b/install.sh deleted file mode 100755 index a4e0d1c1..00000000 --- a/install.sh +++ /dev/null @@ -1,13 +0,0 @@ -#!/bin/sh - -case *"$PWD"* in - "$PYTHONPATH") - ;; - - *) - PYTHONPATH=$PWD:$PYTHONPATH - ;; -esac -python setup.py clean --all -python setup.py build_ext --inplace -python hatchet/vis/static_fixer.py From 407ef1a3a27396b90b8a37a30b197a7ce617374a Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Fri, 24 May 2024 16:44:48 -0700 Subject: [PATCH 26/32] Adds some arguments to find_installation to try to restrict lookup --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 85aa4a38..f723b1a1 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project('llnl-hatchet', 'cython', # Get the Meson Python object, a dependency object to Python for extension modules, # and the path to the top-level install directory -py = import('python').find_installation(pure: false) +py = import('python').find_installation('python3', required: true, pure: false) py_dep = py.dependency() py_top_install_dir = py.get_install_dir() From a0386113fcbba0d4771a3311125426d07aeb02b9 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Tue, 28 May 2024 15:47:17 -0700 Subject: [PATCH 27/32] Updates top level meson.build to get version from Hatchet's Python code --- hatchet/util/print_version.py | 1 + meson.build | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py index 360afe4d..a91e5bb9 100644 --- a/hatchet/util/print_version.py +++ b/hatchet/util/print_version.py @@ -1,3 +1,4 @@ +#!/usr/bin/env python3 # Copyright 2017-2023 Lawrence Livermore National Security, LLC and other # Hatchet Project Developers. See the top-level LICENSE file for details. # diff --git a/meson.build b/meson.build index f723b1a1..bc6b12bd 100644 --- a/meson.build +++ b/meson.build @@ -1,11 +1,14 @@ # Setup the Meson Project project('llnl-hatchet', 'cython', - version: '2024.1.1' + version: run_command( + ['hatchet/utils/print_version.py'], + check=true + ).stdout().strip() ) # Get the Meson Python object, a dependency object to Python for extension modules, # and the path to the top-level install directory -py = import('python').find_installation('python3', required: true, pure: false) +py = import('python').find_installation(pure: false) py_dep = py.dependency() py_top_install_dir = py.get_install_dir() From 670ab8a044cea827a73a21b38228b7fcfbee0931 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Tue, 28 May 2024 15:47:43 -0700 Subject: [PATCH 28/32] Removes the hatchet.__version__ check as it is now redundant --- meson.build | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/meson.build b/meson.build index bc6b12bd..219fd4ce 100644 --- a/meson.build +++ b/meson.build @@ -12,15 +12,5 @@ py = import('python').find_installation(pure: false) py_dep = py.dependency() py_top_install_dir = py.get_install_dir() -# Verify that the version from version.py matches the Meson project version -version_run = run_command(py.path(), meson.current_source_dir() / 'hatchet' / 'util' / 'print_version.py') -if version_run.returncode() != 0 - error('The __version__ variable in Hatchet cannot be determined') -endif -version_from_py = version_run.stdout().strip() -if not version_from_py.version_compare(meson.project_version()) - error('The __version__ variable in Hatchet does not match the Meson project version') -endif - # Enter the 'hatchet' subdirectory subdir('hatchet') \ No newline at end of file From e067ae1ef3da9f371202ab0c4fa667d2ececad54 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Tue, 28 May 2024 15:48:40 -0700 Subject: [PATCH 29/32] Small syntax fix --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 219fd4ce..088033a8 100644 --- a/meson.build +++ b/meson.build @@ -2,7 +2,7 @@ project('llnl-hatchet', 'cython', version: run_command( ['hatchet/utils/print_version.py'], - check=true + check: true ).stdout().strip() ) From 66d5d811d9e5be10b4f38b972eaa57f277185771 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Tue, 28 May 2024 15:54:55 -0700 Subject: [PATCH 30/32] Tries to get print_version.py running --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 088033a8..21d58ded 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ # Setup the Meson Project project('llnl-hatchet', 'cython', version: run_command( - ['hatchet/utils/print_version.py'], + ['python3 hatchet/utils/print_version.py'], check: true ).stdout().strip() ) From 8e92bc57b1fb26eb5829d75aba42049d69aa6ab8 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Tue, 28 May 2024 16:55:21 -0700 Subject: [PATCH 31/32] Reverts the version stuff in meson since running print_version.py isn't working --- hatchet/util/print_version.py | 0 meson.build | 17 ++++++++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) mode change 100644 => 100755 hatchet/util/print_version.py diff --git a/hatchet/util/print_version.py b/hatchet/util/print_version.py old mode 100644 new mode 100755 diff --git a/meson.build b/meson.build index 21d58ded..f723b1a1 100644 --- a/meson.build +++ b/meson.build @@ -1,16 +1,23 @@ # Setup the Meson Project project('llnl-hatchet', 'cython', - version: run_command( - ['python3 hatchet/utils/print_version.py'], - check: true - ).stdout().strip() + version: '2024.1.1' ) # Get the Meson Python object, a dependency object to Python for extension modules, # and the path to the top-level install directory -py = import('python').find_installation(pure: false) +py = import('python').find_installation('python3', required: true, pure: false) py_dep = py.dependency() py_top_install_dir = py.get_install_dir() +# Verify that the version from version.py matches the Meson project version +version_run = run_command(py.path(), meson.current_source_dir() / 'hatchet' / 'util' / 'print_version.py') +if version_run.returncode() != 0 + error('The __version__ variable in Hatchet cannot be determined') +endif +version_from_py = version_run.stdout().strip() +if not version_from_py.version_compare(meson.project_version()) + error('The __version__ variable in Hatchet does not match the Meson project version') +endif + # Enter the 'hatchet' subdirectory subdir('hatchet') \ No newline at end of file From 952efa7eb95faac16bdeb96ed08b35497163b3a4 Mon Sep 17 00:00:00 2001 From: Ian Lumsden Date: Sat, 1 Jun 2024 10:04:17 -0700 Subject: [PATCH 32/32] A few attempted fixes --- hatchet/cython_modules/meson.build | 1 - meson.build | 6 +++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/hatchet/cython_modules/meson.build b/hatchet/cython_modules/meson.build index 463d6d86..9566b0e7 100644 --- a/hatchet/cython_modules/meson.build +++ b/hatchet/cython_modules/meson.build @@ -10,7 +10,6 @@ foreach mod_name : cython_module_names py.extension_module( mod_name, mod_name + '.pyx', - dependencies: py_dep, subdir: 'hatchet' / 'cython_modules' / 'libs', install: true ) diff --git a/meson.build b/meson.build index f723b1a1..be5f01bc 100644 --- a/meson.build +++ b/meson.build @@ -5,12 +5,12 @@ project('llnl-hatchet', 'cython', # Get the Meson Python object, a dependency object to Python for extension modules, # and the path to the top-level install directory -py = import('python').find_installation('python3', required: true, pure: false) -py_dep = py.dependency() +py = import('python').find_installation(required: true, pure: false) +py_dep = py.dependency(method: 'system') py_top_install_dir = py.get_install_dir() # Verify that the version from version.py matches the Meson project version -version_run = run_command(py.path(), meson.current_source_dir() / 'hatchet' / 'util' / 'print_version.py') +version_run = run_command(py.path(), meson.current_source_dir() / 'hatchet' / 'util' / 'print_version.py', check: true) if version_run.returncode() != 0 error('The __version__ variable in Hatchet cannot be determined') endif