Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
470e1e7
Adds automated codecov support to Hatchet
ilumsden May 23, 2024
029e147
Bumps Python version for black and flake checks to 3.9 to ensure tool…
ilumsden May 23, 2024
e78da99
Initial changes
ilumsden May 23, 2024
ca108fc
Sets gitattributes to not capture tests directory in dist
ilumsden May 23, 2024
d4b7791
Further updates to gitattributes and gitignore
ilumsden May 23, 2024
26f7493
Spelling fix
ilumsden May 23, 2024
0af93d1
Current progress
ilumsden May 23, 2024
60e2f8c
Gets a fully working package with meson-python
ilumsden May 23, 2024
d5a76c9
Removes 'meson[ninja]' from pyproject.toml's build-system.requires si…
ilumsden May 23, 2024
f101329
Cleans up metadata in pyproject.toml
ilumsden May 23, 2024
cbfe0d2
Adds a check to the top-level meson.build to ensure the version in ve…
ilumsden May 23, 2024
60b1e11
Adds comments
ilumsden May 23, 2024
e2ff223
Adds extra for HDF5 writer
ilumsden May 23, 2024
38d4500
Tweaks CI to install Hatchet locally with pip
ilumsden May 23, 2024
43a9955
Fixes license headers
ilumsden May 23, 2024
ccddb5f
Formatting fix
ilumsden May 23, 2024
0c9eb9d
Formatting to make flake happy
ilumsden May 23, 2024
ecde7ba
Adds ninja extra to build requirements for Hatchet
ilumsden May 23, 2024
70b2c6b
Adds script for editable installs and tries not using editable in uni…
ilumsden May 23, 2024
2feaace
Adds tables extra to install of Hatchet in CI
ilumsden May 23, 2024
4daea24
Fixes the extra name in CI
ilumsden May 23, 2024
fce6d47
Merge branch 'develop' into meson_build_sys
ilumsden May 24, 2024
fb08595
Update .gitattributes
ilumsden May 24, 2024
1f9199b
Update pyproject.toml
ilumsden May 24, 2024
2b2e54f
Drops the version check on the textx dependency since that check will…
ilumsden May 24, 2024
f52430d
Deletes install.sh since it will no longer work
ilumsden May 24, 2024
407ef1a
Adds some arguments to find_installation to try to restrict lookup
ilumsden May 24, 2024
a038611
Updates top level meson.build to get version from Hatchet's Python code
ilumsden May 28, 2024
670ab8a
Removes the hatchet.__version__ check as it is now redundant
ilumsden May 28, 2024
e067ae1
Small syntax fix
ilumsden May 28, 2024
66d5d81
Tries to get print_version.py running
ilumsden May 28, 2024
8e92bc5
Reverts the version stuff in meson since running print_version.py isn…
ilumsden May 28, 2024
952efa7
A few attempted fixes
ilumsden Jun 1, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ max-line-length = 88
select = C,E,F,W,B,B950
ignore = E501,W503,E203
builtins = IPython
exclude =
build
13 changes: 13 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
hatchet/tests export-ignore
screenshot.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
.flake8 export-ignore
.coveragerc export-ignore
.codecov.yml export-ignore
docs export-ignore
.github export-ignore
12 changes: 4 additions & 8 deletions .github/workflows/unit-tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 .[hdf_writer]

- name: Update Black
if: ${{ matrix.python-version == 3.9 }}
Expand Down Expand Up @@ -91,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
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ hatchet/vis/static/*_bundle*

dist/
llnl_hatchet.egg-info/
**/__pycache__/
16 changes: 16 additions & 0 deletions hatchet/cython_modules/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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
# <INSTALL_PREFIX>/hatchet/cython_modules/libs
foreach mod_name : cython_module_names
py.extension_module(
mod_name,
mod_name + '.pyx',
subdir: 'hatchet' / 'cython_modules' / 'libs',
install: true
)
endforeach
20 changes: 20 additions & 0 deletions hatchet/external/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Specify the pure Python files for this directory
hatchet_external_python_sources = [
'__init__.py',
'console.py'
]

# Install the specified pure Python files into
# <INSTALL_PREFIX>/hatchet/external
py.install_sources(
hatchet_external_python_sources,
pure: false,
subdir: 'hatchet' / 'external'
)

# Install roundtrip as-is into
# <INSTALL_PREFIX>/hatchet/external
install_subdir(
'roundtrip',
install_dir: py_top_install_dir / 'hatchet' / 'external'
)
26 changes: 26 additions & 0 deletions hatchet/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Specify the pure Python files for this directory
hatchet_python_sources = [
'__init__.py',
'frame.py',
'graph.py',
'graphframe.py',
'node.py',
'version.py'
]

# Install the specified pure Python files into
# <INSTALL_PREFIX>/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')
subdir('readers')
subdir('util')
subdir('vis')
subdir('writers')
19 changes: 19 additions & 0 deletions hatchet/query/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Specify the pure Python files for this directory
hatchet_query_python_sources = [
'__init__.py',
'compat.py',
'compound.py',
'engine.py',
'errors.py',
'object_dialect.py',
'query.py',
'string_dialect.py'
]

# Install the specified pure Python files into
# <INSTALL_PREFIX>/hatchet/query
py.install_sources(
hatchet_query_python_sources,
pure: false,
subdir: 'hatchet' / 'query'
)
25 changes: 25 additions & 0 deletions hatchet/readers/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Specify the pure Python files for this directory
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'
]

# Install the specified pure Python files into
# <INSTALL_PREFIX>/hatchet/readers
py.install_sources(
hatchet_readers_python_sources,
pure: false,
subdir: 'hatchet' / 'readers'
)
2 changes: 1 addition & 1 deletion hatchet/tests/query_compat.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
21 changes: 21 additions & 0 deletions hatchet/util/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# 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',
'config.py',
'deprecated.py',
'dot.py',
'executable.py',
'profiler.py',
'timer.py'
]

# Install the specified pure Python files into
# <INSTALL_PREFIX>/hatchet/util
py.install_sources(
hatchet_util_python_sources,
pure: false,
subdir: 'hatchet' / 'util'
)
14 changes: 14 additions & 0 deletions hatchet/util/print_version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/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.
#
# SPDX-License-Identifier: MIT

import os
import sys

sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from version import __version__ # noqa: E402

print(__version__)
47 changes: 47 additions & 0 deletions hatchet/vis/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# 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
# <INSTALL_PREFIX>/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
)
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 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
)
14 changes: 14 additions & 0 deletions hatchet/writers/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# 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
# <INSTALL_PREFIX>/hatchet/writers
py.install_sources(
hatchet_writers_python_sources,
pure: false,
subdir: 'hatchet' / 'writers'
)
13 changes: 0 additions & 13 deletions install.sh

This file was deleted.

5 changes: 5 additions & 0 deletions install_editable.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash

python3 -m pip install meson[ninja] meson-python Cython

python3 -m pip install --no-build-isolation -e .
23 changes: 23 additions & 0 deletions meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Setup the Meson Project
project('llnl-hatchet', 'cython',
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(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', check: true)
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')
Loading