diff --git a/Makefile b/Makefile index 2e3740b8c..b7cd47bce 100644 --- a/Makefile +++ b/Makefile @@ -1,32 +1,38 @@ -test: - python3 -m pytest --durations=10 --cov=./ --cov-report term-missing:skip-covered tests/ +.PHONY: dev install check linting test docs docs-release docs-html docs-dirhtml docs-latex release + +# Base build requirements are not installed automatically. +# Inspired by https://meson-python.readthedocs.io/en/latest/how-to-guides/editable-installs.html +dev: + $(info [INFO] Make sure you're using a virtual environment for development) + python3 -m pip install meson-python meson ninja + python3 -m pip install --no-build-isolation --config-settings=editable-verbose=true --config-settings=setup-args=-Dbuildtype=debug --editable .[test,typing,lint,docs] +install: + python3 -m pip install . -check: +check: linting mypy perun/ -# Setuptools fails for nested requirements file when installed as `pip install .`, so sadly no -# simple "dev" optional dependency -dev: - pip3 install -e .[typing,lint,test,docs] +linting: + black -q perun/ -install: - pip3 install . +test: + $(info [INFO] Make sure you're using a virtual environment for testing. See 'make dev') + python3 -m pytest --durations=10 --cov=./ --cov-report term-missing:skip-covered tests/ -docs: - $(MAKE) -C docs html +docs: docs-html docs-dirhtml docs-latex -docs-latex: - $(MAKE) -C docs latex +docs-release: dev docs + cp ./docs/_build/latex/Perun.pdf ./docs/pdf/perun.pdf -docs-all: +docs-html: $(MAKE) -C docs html + +docs-dirhtml: $(MAKE) -C docs dirhtml - $(MAKE) -C docs latex -docs-release: dev docs-latex docs - cp ./docs/_build/latex/Perun.pdf ./docs/pdf/perun.pdf +docs-latex: + $(MAKE) -C docs latex -pypi-release: +release: python3 -m build -.PHONY: init test docs install dev run-gui gh-pages docs-latex docs-release docs-all diff --git a/meson.build b/meson.build new file mode 100644 index 000000000..6e97d3a48 --- /dev/null +++ b/meson.build @@ -0,0 +1,30 @@ +project( + 'perun', + 'c', + version: '0.21.6', + license: 'GPL-3', + meson_version: '>=1.0.0', + default_options: [ + 'buildtype=debugoptimized', + 'c_std=c11', + 'optimization=2', + ], +) + +py3 = import('python').find_installation(pure: false) +py3_dep = py3.dependency() + +perun_files = files( + 'LICENSE', + 'pyproject.toml', + 'tox.ini', +) + +perun_dir = 'perun' + +py3.install_sources( + perun_files, + subdir: perun_dir, +) + +subdir('perun') diff --git a/perun/check/meson.build b/perun/check/meson.build new file mode 100644 index 000000000..3266e9d01 --- /dev/null +++ b/perun/check/meson.build @@ -0,0 +1,21 @@ +perun_check_dir = perun_dir / 'check' + +perun_check_files = files( + '__init__.py', + 'average_amount_threshold.py', + 'best_model_order_equality.py', + 'exclusive_time_outliers.py', + 'factory.py', + 'fast_check.py', + 'general_detection.py', + 'integral_comparison.py', + 'linear_regression.py', + 'local_statistics.py', + 'nonparam_helpers.py', + 'polynomial_regression.py', +) + +py3.install_sources( + perun_check_files, + subdir: perun_check_dir, +) diff --git a/perun/cli_groups/meson.build b/perun/cli_groups/meson.build new file mode 100644 index 000000000..381cae431 --- /dev/null +++ b/perun/cli_groups/meson.build @@ -0,0 +1,14 @@ +perun_cli_groups_dir = perun_dir / 'cli_groups' + +perun_cli_groups_files = files( + '__init__.py', + 'check_cli.py', + 'config_cli.py', + 'run_cli.py', + 'utils_cli.py', +) + +py3.install_sources( + perun_cli_groups_files, + subdir: perun_cli_groups_dir +) diff --git a/perun/collect/bounds/meson.build b/perun/collect/bounds/meson.build new file mode 100644 index 000000000..f1edff980 --- /dev/null +++ b/perun/collect/bounds/meson.build @@ -0,0 +1,22 @@ +perun_collect_bounds_dir = perun_collect_dir / 'bounds' + +perun_collect_bounds_files = files( + '__init__.py', + 'parser.py', + 'run.py', +) + +libedit_2_dep = dependency('libedit', version: ['>=2.0.0', '<3.0.0'], required: false) + +#if libedit_2_dep.found() + py3.install_sources( + perun_collect_bounds_files, + subdir: perun_collect_bounds_dir, + ) + + install_subdir( + 'bin', + install_dir: py3.get_install_dir() / perun_collect_bounds_dir, + install_tag: 'python-runtime', + ) + #endif diff --git a/perun/collect/complexity/meson.build b/perun/collect/complexity/meson.build new file mode 100644 index 000000000..15676efc1 --- /dev/null +++ b/perun/collect/complexity/meson.build @@ -0,0 +1,20 @@ +perun_collect_complexity_dir = perun_collect_dir / 'complexity' + +perun_collect_complexity_files = files( + '__init__.py', + 'configurator.py', + 'makefiles.py', + 'run.py', + 'symbols.py', +) + +py3.install_sources( + perun_collect_complexity_files, + subdir: perun_collect_complexity_dir, +) + +install_subdir( + 'cpp_sources', + install_dir: py3.get_install_dir() / perun_collect_complexity_dir, + install_tag: 'python-runtime', +) \ No newline at end of file diff --git a/perun/collect/memory/meson.build b/perun/collect/memory/meson.build new file mode 100644 index 000000000..a36af3652 --- /dev/null +++ b/perun/collect/memory/meson.build @@ -0,0 +1,30 @@ +perun_collect_memory_dir = perun_collect_dir / 'memory' + +perun_collect_memory_c_files = files( + 'backtrace.c', + 'backtrace.h', + 'malloc.c', +) + +# $(CC) -shared -fPIC malloc.c backtrace.c -o malloc.so -lunwind -ldl + +shared_library( + 'malloc.so', + perun_collect_memory_c_files, + install: true, + install_dir: py3.get_install_dir() / perun_collect_memory_dir, + link_args: ['-lunwind', '-ldl'], +) + +perun_collect_memory_files = files( + '__init__.py', + 'filter.py', + 'parsing.py', + 'run.py', + 'syscalls.py', +) + +py3.install_sources( + perun_collect_memory_files, + subdir: perun_collect_memory_dir, +) diff --git a/perun/collect/meson.build b/perun/collect/meson.build new file mode 100644 index 000000000..59b98d33e --- /dev/null +++ b/perun/collect/meson.build @@ -0,0 +1,16 @@ +perun_collect_dir = perun_dir / 'collect' + +perun_collect_files = files( + '__init__.py', +) + +py3.install_sources( + perun_collect_files, + subdir: perun_collect_dir, +) + +subdir('bounds') +subdir('complexity') +subdir('memory') +subdir('time') +subdir('trace') \ No newline at end of file diff --git a/perun/collect/time/meson.build b/perun/collect/time/meson.build new file mode 100644 index 000000000..aabc74d50 --- /dev/null +++ b/perun/collect/time/meson.build @@ -0,0 +1,11 @@ +perun_collect_time_dir = perun_collect_dir / 'time' + +perun_collect_time_files = files( + '__init__.py', + 'run.py', +) + +py3.install_sources( + perun_collect_time_files, + subdir: perun_collect_time_dir, +) diff --git a/perun/collect/trace/ebpf/meson.build b/perun/collect/trace/ebpf/meson.build new file mode 100644 index 000000000..27f87c673 --- /dev/null +++ b/perun/collect/trace/ebpf/meson.build @@ -0,0 +1,13 @@ +perun_collect_trace_ebpf_dir = perun_collect_trace_dir / 'ebpf' + +perun_collect_trace_ebpf_files = files( + '__init__.py', + 'ebpf.py', + 'engine.py', + 'program.py', +) + +py3.install_sources( + perun_collect_trace_ebpf_files, + subdir: perun_collect_trace_ebpf_dir, +) \ No newline at end of file diff --git a/perun/collect/trace/meson.build b/perun/collect/trace/meson.build new file mode 100644 index 000000000..7d87969ea --- /dev/null +++ b/perun/collect/trace/meson.build @@ -0,0 +1,23 @@ +perun_collect_trace_dir = perun_collect_dir / 'trace' + +perun_collect_trace_files = files( + '__init__.py', + 'collect_engine.py', + 'configuration.py', + 'probes.py', + 'processes.py', + 'run.py', + 'strategy.py', + 'threads.py', + 'values.py', + 'watchdog.py', +) + +py3.install_sources( + perun_collect_trace_files, + subdir: perun_collect_trace_dir, +) + +subdir('ebpf') +subdir('optimizations') +subdir('systemtap') \ No newline at end of file diff --git a/perun/collect/trace/optimizations/meson.build b/perun/collect/trace/optimizations/meson.build new file mode 100644 index 000000000..361929c20 --- /dev/null +++ b/perun/collect/trace/optimizations/meson.build @@ -0,0 +1,22 @@ +perun_collect_trace_optimizations_dir = perun_collect_trace_dir / 'optimizations' + +perun_collect_trace_optimizations_files = files( + '__init__.py', + 'call_graph.py', + 'call_graph_levels.py', + 'cg_projection.py', + 'diff_tracing.py', + 'dynamic_baseline.py', + 'dynamic_sampling.py', + 'dynamic_stats.py', + 'optimization.py', + 'static_baseline.py', + 'structs.py', +) + +py3.install_sources( + perun_collect_trace_optimizations_files, + subdir: perun_collect_trace_optimizations_dir, +) + +subdir('resources') \ No newline at end of file diff --git a/perun/collect/trace/optimizations/resources/meson.build b/perun/collect/trace/optimizations/resources/meson.build new file mode 100644 index 000000000..b311a31dc --- /dev/null +++ b/perun/collect/trace/optimizations/resources/meson.build @@ -0,0 +1,14 @@ +perun_collect_trace_optimizations_resources_dir = perun_collect_trace_optimizations_dir / 'resources' + +perun_collect_trace_optimizations_resources_files = files( + '__init__.py', + 'angr_provider.py', + 'manager.py', + 'perun_call_graph.py', + 'perun_dynamic_stats.py', +) + +py3.install_sources( + perun_collect_trace_optimizations_resources_files, + subdir: perun_collect_trace_optimizations_resources_dir, +) diff --git a/perun/collect/trace/systemtap/meson.build b/perun/collect/trace/systemtap/meson.build new file mode 100644 index 000000000..90ed1768a --- /dev/null +++ b/perun/collect/trace/systemtap/meson.build @@ -0,0 +1,13 @@ +perun_collect_trace_systemtap_dir = perun_collect_trace_dir / 'systemtap' + +perun_collect_trace_systemtap_files = files( + '__init__.py', + 'engine.py', + 'parse_compact.py', + 'script_compact.py', +) + +py3.install_sources( + perun_collect_trace_systemtap_files, + subdir: perun_collect_trace_systemtap_dir, +) diff --git a/perun/fuzz/evaluate/meson.build b/perun/fuzz/evaluate/meson.build new file mode 100644 index 000000000..6d9cdc4a2 --- /dev/null +++ b/perun/fuzz/evaluate/meson.build @@ -0,0 +1,12 @@ +perun_fuzz_evaluate_dir = perun_fuzz_dir / 'evaluate' + +perun_fuzz_evaluate_files = files( + '__init__.py', + 'by_coverage.py', + 'by_perun.py', +) + +py3.install_sources( + perun_fuzz_evaluate_files, + subdir: perun_fuzz_evaluate_dir +) diff --git a/perun/fuzz/meson.build b/perun/fuzz/meson.build new file mode 100644 index 000000000..fba291f20 --- /dev/null +++ b/perun/fuzz/meson.build @@ -0,0 +1,20 @@ +perun_fuzz_dir = perun_dir / 'fuzz' + +perun_fuzz_files = files( + '__init__.py', + 'factory.py', + 'filesystem.py', + 'filetype.py', + 'helpers.py', + 'interpret.py', + 'randomizer.py', + 'structs.py', +) + +py3.install_sources( + perun_fuzz_files, + subdir: perun_fuzz_dir +) + +subdir('evaluate') +subdir('methods') \ No newline at end of file diff --git a/perun/fuzz/methods/meson.build b/perun/fuzz/methods/meson.build new file mode 100644 index 000000000..4677ed2eb --- /dev/null +++ b/perun/fuzz/methods/meson.build @@ -0,0 +1,13 @@ +perun_fuzz_methods_dir = perun_fuzz_dir / 'methods' + +perun_fuzz_methods_files = files( + '__init__.py', + 'binary.py', + 'textfile.py', + 'xml.py', +) + +py3.install_sources( + perun_fuzz_methods_files, + subdir: perun_fuzz_methods_dir +) diff --git a/perun/logic/meson.build b/perun/logic/meson.build new file mode 100644 index 000000000..016287dc5 --- /dev/null +++ b/perun/logic/meson.build @@ -0,0 +1,20 @@ +perun_logic_dir = perun_dir / 'logic' + +perun_logic_files = files( + '__init__.py', + 'commands.py', + 'config.py', + 'config_templates.py', + 'index.py', + 'locks.py', + 'pcs.py', + 'runner.py', + 'stats.py', + 'store.py', + 'temp.py', +) + +py3.install_sources( + perun_logic_files, + subdir: perun_logic_dir, +) \ No newline at end of file diff --git a/perun/meson.build b/perun/meson.build new file mode 100644 index 000000000..e8eb07d84 --- /dev/null +++ b/perun/meson.build @@ -0,0 +1,24 @@ +perun_files = files( + 'cli.py', + '__init__.py', +) + +py3.install_sources( + perun_files, + subdir: perun_dir, +) + +subdir('check') +subdir('cli_groups') +subdir('collect') +subdir('fuzz') +subdir('logic') +subdir('postprocess') +subdir('profile') +subdir('templates') +subdir('testing') +subdir('thirdparty') +subdir('utils') +subdir('vcs') +subdir('view') +subdir('workload') \ No newline at end of file diff --git a/perun/postprocess/clusterizer/meson.build b/perun/postprocess/clusterizer/meson.build new file mode 100644 index 000000000..bc3dca62f --- /dev/null +++ b/perun/postprocess/clusterizer/meson.build @@ -0,0 +1,13 @@ +perun_postprocess_clusterizer_dir = perun_postprocess_dir / 'clusterizer' + +perun_postprocess_clusterizer_files = files( + '__init__.py', + 'run.py', + 'sliding_window.py', + 'sort_order.py', +) + +py3.install_sources( + perun_postprocess_clusterizer_files, + subdir: perun_postprocess_clusterizer_dir +) diff --git a/perun/postprocess/kernel_regression/meson.build b/perun/postprocess/kernel_regression/meson.build new file mode 100644 index 000000000..a29730090 --- /dev/null +++ b/perun/postprocess/kernel_regression/meson.build @@ -0,0 +1,12 @@ +perun_postprocess_kernel_regression_dir = perun_postprocess_dir / 'kernel_regression' + +perun_postprocess_kernel_regression_files = files( + '__init__.py', + 'methods.py', + 'run.py', +) + +py3.install_sources( + perun_postprocess_kernel_regression_files, + subdir: perun_postprocess_kernel_regression_dir +) diff --git a/perun/postprocess/meson.build b/perun/postprocess/meson.build new file mode 100644 index 000000000..575de7afa --- /dev/null +++ b/perun/postprocess/meson.build @@ -0,0 +1,17 @@ +perun_postprocess_dir = perun_dir / 'postprocess' + +perun_postprocess_files = files( + '__init__.py', +) + +py3.install_sources( + perun_postprocess_files, + subdir: perun_postprocess_dir +) + +subdir('clusterizer') +subdir('kernel_regression') +subdir('moving_average') +subdir('normalizer') +subdir('regression_analysis') +subdir('regressogram') diff --git a/perun/postprocess/moving_average/meson.build b/perun/postprocess/moving_average/meson.build new file mode 100644 index 000000000..ae84a9602 --- /dev/null +++ b/perun/postprocess/moving_average/meson.build @@ -0,0 +1,12 @@ +perun_postprocess_moving_average_dir = perun_postprocess_dir / 'moving_average' + +perun_postprocess_moving_average_files = files( + '__init__.py', + 'methods.py', + 'run.py', +) + +py3.install_sources( + perun_postprocess_moving_average_files, + subdir: perun_postprocess_moving_average_dir +) diff --git a/perun/postprocess/normalizer/meson.build b/perun/postprocess/normalizer/meson.build new file mode 100644 index 000000000..ae8248a70 --- /dev/null +++ b/perun/postprocess/normalizer/meson.build @@ -0,0 +1,11 @@ +perun_postprocess_normalizer_dir = perun_postprocess_dir / 'normalizer' + +perun_postprocess_normalizer_files = files( + '__init__.py', + 'run.py', +) + +py3.install_sources( + perun_postprocess_normalizer_files, + subdir: perun_postprocess_normalizer_dir +) diff --git a/perun/postprocess/regression_analysis/extensions/meson.build b/perun/postprocess/regression_analysis/extensions/meson.build new file mode 100644 index 000000000..032040eb9 --- /dev/null +++ b/perun/postprocess/regression_analysis/extensions/meson.build @@ -0,0 +1,11 @@ +perun_postprocess_regression_analysis_extensions_dir = perun_postprocess_regression_analysis_dir / 'extensions' + +perun_postprocess_regression_analysis_extensions_files = files( + '__init__.py', + 'plot_models.py' +) + +py3.install_sources( + perun_postprocess_regression_analysis_extensions_files, + subdir: perun_postprocess_regression_analysis_extensions_dir +) diff --git a/perun/postprocess/regression_analysis/meson.build b/perun/postprocess/regression_analysis/meson.build new file mode 100644 index 000000000..33cd7a7b5 --- /dev/null +++ b/perun/postprocess/regression_analysis/meson.build @@ -0,0 +1,21 @@ +perun_postprocess_regression_analysis_dir = perun_postprocess_dir / 'regression_analysis' + +perun_postprocess_regression_analysis_files = files( + '__init__.py', + 'data_provider.py', + 'derived.py', + 'generic.py', + 'methods.py', + 'regression_models.py', + 'run.py', + 'specific.py', + 'tools.py', + 'transform.py', +) + +py3.install_sources( + perun_postprocess_regression_analysis_files, + subdir: perun_postprocess_regression_analysis_dir +) + +subdir('extensions') diff --git a/perun/postprocess/regressogram/meson.build b/perun/postprocess/regressogram/meson.build new file mode 100644 index 000000000..51131a034 --- /dev/null +++ b/perun/postprocess/regressogram/meson.build @@ -0,0 +1,12 @@ +perun_postprocess_regressogram_dir = perun_postprocess_dir / 'regressogram' + +perun_postprocess_regressogram_files = files( + '__init__.py', + 'methods.py', + 'run.py', +) + +py3.install_sources( + perun_postprocess_regressogram_files, + subdir: perun_postprocess_regressogram_dir +) diff --git a/perun/profile/meson.build b/perun/profile/meson.build new file mode 100644 index 000000000..c8ee85a1e --- /dev/null +++ b/perun/profile/meson.build @@ -0,0 +1,14 @@ +perun_profile_dir = perun_dir / 'profile' + +perun_profile_files = files( + '__init__.py', + 'convert.py', + 'factory.py', + 'helpers.py', + 'query.py', +) + +py3.install_sources( + perun_profile_files, + subdir: perun_profile_dir +) \ No newline at end of file diff --git a/perun/templates/meson.build b/perun/templates/meson.build new file mode 100644 index 000000000..9b07fc3c7 --- /dev/null +++ b/perun/templates/meson.build @@ -0,0 +1,16 @@ +perun_templates_dir = perun_dir / 'templates' + +perun_templates_files = files( + 'check.jinja2', + 'collect.__init__.jinja2', + 'collect.run.jinja2', + 'postprocess.__init__.jinja2', + 'postprocess.run.jinja2', + 'view.__init__.jinja2', + 'view.run.jinja2', +) + +py3.install_sources( + perun_templates_files, + subdir: perun_templates_dir +) \ No newline at end of file diff --git a/perun/testing/meson.build b/perun/testing/meson.build new file mode 100644 index 000000000..f8cd56bae --- /dev/null +++ b/perun/testing/meson.build @@ -0,0 +1,13 @@ +perun_testing_dir = perun_dir / 'testing' + +perun_testing_files = files( + '__init__.py', + 'asserts.py', + 'mock_results.py', + 'utils.py', +) + +py3.install_sources( + perun_testing_files, + subdir: perun_testing_dir +) \ No newline at end of file diff --git a/perun/thirdparty/meson.build b/perun/thirdparty/meson.build new file mode 100644 index 000000000..4e0f8f80b --- /dev/null +++ b/perun/thirdparty/meson.build @@ -0,0 +1,12 @@ +perun_thirdparty_dir = perun_dir / 'thirdparty' + +perun_thirdparty_files = files( + '__init__.py', +) + +py3.install_sources( + perun_thirdparty_files, + subdir: perun_thirdparty_dir +) + +subdir('pyqt_fit_port') diff --git a/perun/thirdparty/pyqt_fit_port/meson.build b/perun/thirdparty/pyqt_fit_port/meson.build new file mode 100644 index 000000000..0e71be44b --- /dev/null +++ b/perun/thirdparty/pyqt_fit_port/meson.build @@ -0,0 +1,17 @@ +perun_thirdparty_pyqt_fit_port_dir = perun_thirdparty_dir / 'pyqt_fit_port' + +perun_thirdparty_pyqt_fit_port_files = files( + '__init__.py', + 'kde.py', + 'kde_bandwidth.py', + 'kde_methods.py', + 'kernels.py', + 'nonparam_regression.py', + 'npr_methods.py', + 'utils.py', +) + +py3.install_sources( + perun_thirdparty_pyqt_fit_port_files, + subdir: perun_thirdparty_pyqt_fit_port_dir +) diff --git a/perun/utils/meson.build b/perun/utils/meson.build new file mode 100644 index 000000000..171097e6d --- /dev/null +++ b/perun/utils/meson.build @@ -0,0 +1,21 @@ +perun_utils_dir = perun_dir / 'utils' + +perun_utils_files = files( + '__init__.py', + 'cli_helpers.py', + 'decorators.py', + 'exceptions.py', + 'helpers.py', + 'log.py', + 'metrics.py', + 'script_helpers.py', + 'streams.py', + 'structs.py', + 'timestamps.py', + 'view_helpers.py', +) + +py3.install_sources( + perun_utils_files, + subdir: perun_utils_dir +) \ No newline at end of file diff --git a/perun/vcs/meson.build b/perun/vcs/meson.build new file mode 100644 index 000000000..acea7fc65 --- /dev/null +++ b/perun/vcs/meson.build @@ -0,0 +1,11 @@ +perun_vcs_dir = perun_dir / 'vcs' + +perun_vcs_files = files( + '__init__.py', + 'git.py', +) + +py3.install_sources( + perun_vcs_files, + subdir: perun_vcs_dir +) \ No newline at end of file diff --git a/perun/view/bars/meson.build b/perun/view/bars/meson.build new file mode 100644 index 000000000..a158ca5c3 --- /dev/null +++ b/perun/view/bars/meson.build @@ -0,0 +1,12 @@ +perun_view_bars_dir = perun_view_dir / 'bars' + +perun_view_bars_files = files( + '__init__.py', + 'factory.py', + 'run.py', +) + +py3.install_sources( + perun_view_bars_files, + subdir: perun_view_bars_dir +) diff --git a/perun/view/flamegraph/meson.build b/perun/view/flamegraph/meson.build new file mode 100644 index 000000000..7843cdaeb --- /dev/null +++ b/perun/view/flamegraph/meson.build @@ -0,0 +1,13 @@ +perun_view_flamegraph_dir = perun_view_dir / 'flamegraph' + +perun_view_flamegraph_files = files( + '__init__.py', + 'flamegraph.pl', + 'flamegraph.py', + 'run.py', +) + +py3.install_sources( + perun_view_flamegraph_files, + subdir: perun_view_flamegraph_dir +) diff --git a/perun/view/flow/meson.build b/perun/view/flow/meson.build new file mode 100644 index 000000000..ad3ecb85d --- /dev/null +++ b/perun/view/flow/meson.build @@ -0,0 +1,12 @@ +perun_view_flow_dir = perun_view_dir / 'flow' + +perun_view_flow_files = files( + '__init__.py', + 'factory.py', + 'run.py', +) + +py3.install_sources( + perun_view_flow_files, + subdir: perun_view_flow_dir +) diff --git a/perun/view/meson.build b/perun/view/meson.build new file mode 100644 index 000000000..f5bd30896 --- /dev/null +++ b/perun/view/meson.build @@ -0,0 +1,17 @@ +perun_view_dir = perun_dir / 'view' + +perun_view_files = files( + '__init__.py', +) + +py3.install_sources( + perun_view_files, + subdir: perun_view_dir +) + +subdir('bars') +subdir('flamegraph') +subdir('flow') +subdir('raw') +subdir('scatter') +subdir('tableof') \ No newline at end of file diff --git a/perun/view/raw/meson.build b/perun/view/raw/meson.build new file mode 100644 index 000000000..7dd0ffb39 --- /dev/null +++ b/perun/view/raw/meson.build @@ -0,0 +1,11 @@ +perun_view_raw_dir = perun_view_dir / 'raw' + +perun_view_raw_files = files( + '__init__.py', + 'run.py', +) + +py3.install_sources( + perun_view_raw_files, + subdir: perun_view_raw_dir +) diff --git a/perun/view/scatter/meson.build b/perun/view/scatter/meson.build new file mode 100644 index 000000000..84554b6e3 --- /dev/null +++ b/perun/view/scatter/meson.build @@ -0,0 +1,12 @@ +perun_view_scatter_dir = perun_view_dir / 'scatter' + +perun_view_scatter_files = files( + '__init__.py', + 'factory.py', + 'run.py', +) + +py3.install_sources( + perun_view_scatter_files, + subdir: perun_view_scatter_dir +) diff --git a/perun/view/tableof/meson.build b/perun/view/tableof/meson.build new file mode 100644 index 000000000..062727725 --- /dev/null +++ b/perun/view/tableof/meson.build @@ -0,0 +1,11 @@ +perun_view_tableof_dir = perun_view_dir / 'tableof' + +perun_view_tableof_files = files( + '__init__.py', + 'run.py', +) + +py3.install_sources( + perun_view_tableof_files, + subdir: perun_view_tableof_dir +) diff --git a/perun/workload/meson.build b/perun/workload/meson.build new file mode 100644 index 000000000..38d7d34a7 --- /dev/null +++ b/perun/workload/meson.build @@ -0,0 +1,16 @@ +perun_workload_dir = perun_dir / 'workload' + +perun_workload_files = files( + '__init__.py', + 'external_generator.py', + 'generator.py', + 'integer_generator.py', + 'singleton_generator.py', + 'string_generator.py', + 'textfile_generator.py', +) + +py3.install_sources( + perun_workload_files, + subdir: perun_workload_dir +) \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index af3a75bf0..83982a906 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,11 +1,14 @@ [build-system] -requires = ["setuptools>=60", "wheel"] -build-backend = "setuptools.build_meta" +requires = [ + "meson-python >= 0.15.0", + "meson >= 1.2.3", + "patchelf >= 0.11.0", +] +build-backend = "mesonpy" [project] name = "perun-toolsuite" description = "Perun: Lightweight Performance Version System" -version = "0.21.6" requires-python = ">=3.9" readme = "README.md" license = { file = "LICENSE" } @@ -21,6 +24,11 @@ authors = [ {name = "Vladimir Hucovic"} ] dependencies = [ + # Build + "meson-python>=0.15.0", + "meson>=1.2.3", + "ninja>=1.0", + # CLI "click>=8.1", @@ -55,10 +63,30 @@ dependencies = [ # Transitive dependencies that we need to limit for some reason "kiwisolver!=1.4.5", # matplotlib dep, 1.4.5 does not work when lazy-importing matplotlib ] -# (1) Optional dependencies are made dynamic so that we can reuse them in tox. The goal is to have each -# dependency and its version constraints specified only once to avoid inconsistencies. -dynamic = ["optional-dependencies"] +dynamic = ["version"] +[project.optional-dependencies] +docs = [ + # Sphinx 7.2 dropped support for Python 3.8 + "Sphinx>=7.1", + "sphinx-click>=5.0", +] +lint = [ + "pylint>=2.17", +] +test = [ + "pytest>=7.4", + "pytest-cov>=4.1", + "tox>=4.9.0", +] +typing = [ + "mypy>=1.5", + "mypy-extensions>=1.0", + "typing-extensions>=4.7", + "types-tabulate>=0.9", + "pandas-stubs>=2.0", + "nptyping>=2.5.0", +] [project.urls] Repository = "https://github.com/tfiedor/perun.git" @@ -68,29 +96,6 @@ Changelog = "https://github.com/tfiedor/perun/blob/master/CHANGELOG.rst" [project.scripts] perun = "perun.cli:launch_cli" -# A flat-level package with multiple directories, we need to specify the python module manually -# See https://stackoverflow.com/questions/72294299/multiple-top-level-packages-discovered-in-a-flat-layout -[tool.setuptools] -py-modules = ["perun"] -package-dir = {"perun" = "perun"} - -[tool.setuptools.dynamic] -# Setuptools fails for nested requirements file when installed as `pip install .`, so sadly no -# simple "dev" optional dependency -optional-dependencies.test = { file = ["requirements_test.txt"] } -optional-dependencies.typing = { file = ["requirements_typing.txt"] } -optional-dependencies.lint = { file = ["requirements_lint.txt"] } -optional-dependencies.docs = { file = ["requirements_docs.txt"] } - - -[tool.setuptools.packages.find] -where = ["."] -include = [ - "perun", - "perun*", -] -namespaces = true - [tool.setuptools.package-data] perun = [ "view/flamegraph/flamegraph.pl", diff --git a/requirements_docs.txt b/requirements_docs.txt deleted file mode 100644 index 46277ec70..000000000 --- a/requirements_docs.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Sphinx 7.2 dropped support for Python 3.8 -Sphinx>=7.1 -sphinx-click>= 5.0 \ No newline at end of file diff --git a/requirements_lint.txt b/requirements_lint.txt deleted file mode 100644 index d430d9624..000000000 --- a/requirements_lint.txt +++ /dev/null @@ -1 +0,0 @@ -pylint>=2.17 \ No newline at end of file diff --git a/requirements_test.txt b/requirements_test.txt deleted file mode 100644 index 390b04da4..000000000 --- a/requirements_test.txt +++ /dev/null @@ -1,3 +0,0 @@ -pytest>=7.4 -pytest-cov>=4.1 -tox>=4.9.0 \ No newline at end of file diff --git a/requirements_typing.txt b/requirements_typing.txt deleted file mode 100644 index d5ffed461..000000000 --- a/requirements_typing.txt +++ /dev/null @@ -1,7 +0,0 @@ -mypy>=1.5 -mypy-extensions>=1.0 -typing-extensions>=4.7 -types-tabulate>=0.9 -types-setuptools>=68.1.0.0 -pandas-stubs>=2.0 -nptyping>=2.5.0 \ No newline at end of file diff --git a/tox.ini b/tox.ini index 33a93595d..90293fe4e 100644 --- a/tox.ini +++ b/tox.ini @@ -16,8 +16,8 @@ commands = [testenv:lint] description = Run code style checker Pylint -skip_install = True -deps = -r requirements_lint.txt +# install_command = python - I -m pip install {opts} .[lint] +extras = lint commands = pylint {posargs:perun} @@ -25,15 +25,17 @@ commands = # We can't skip install as some of our dependencies ship type hints directly in their core package # and not as a standalone typeshed package. description = Run static type checker Mypy -deps = -r requirements_typing.txt +# install_command = python -I -m pip install {opts} .[typing] +extras = typing commands = mypy {posargs:./perun} [testenv:docs] description = Generate Sphinx HTML documentation allowlist_externals = make -deps = -r requirements_docs.txt +# install_command = python -I -m pip install {opts} .[docs] +extras = docs commands = make docs [pytest] -norecursedirs = docs *.egg-info .git .tox build .mypy_cache \ No newline at end of file +norecursedirs = docs *.egg-info .git .tox build .mypy_cache