Skip to content

Commit 18e0d76

Browse files
committed
Merging pull request 240
Signed-off-by: Lukáš Doktor <ldoktor@redhat.com> * github.com:distributed-system-analysis/run-perf: contrib: Move contrib to runperf/contrib .workflows: Remove code-coverage workflow Port from setup.py to pyproject.toml
2 parents 62d6338 + 36f8dbe commit 18e0d76

File tree

22 files changed

+166
-226
lines changed

22 files changed

+166
-226
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,14 @@ jobs:
1515
python-version: [3.12]
1616
fail-fast: false
1717
steps:
18-
- uses: actions/checkout@v2
18+
- uses: actions/checkout@v4
1919
with:
20-
fetch-depth: 500
21-
- name: Fetch tags required for run-perf version
22-
run: git fetch --tags --depth 500
23-
- uses: actions/setup-python@v2
20+
fetch-depth: 1
21+
fetch-tags: true
22+
- uses: actions/setup-python@v5
2423
with:
2524
python-version: ${{ matrix.python-version }}
2625
- name: Install missing aexpect dependency (remove when https://github.com/avocado-framework/aexpect/pull/81 is merged)
2726
run: pip install six numpy
28-
- run: pip install -r requirements.txt
27+
- run: pip install -e .[dev]
2928
- run: make check
30-
31-
code_coverage:
32-
name: CodeCoverage
33-
runs-on: ubuntu-latest
34-
strategy:
35-
fail-fast: false
36-
steps:
37-
- uses: actions/checkout@v2
38-
with:
39-
fetch-depth: 500
40-
- name: Fetch tags required for run-perf version
41-
run: git fetch --tags --depth 500
42-
- uses: actions/setup-python@v2
43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
- name: Install missing aexpect dependency (remove when https://github.com/avocado-framework/aexpect/pull/81 is merged)
46-
run: pip install six
47-
- run: pip install -r requirements.txt
48-
- run: |
49-
pip install coverage
50-
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
51-
chmod +x ./cc-test-reporter
52-
./cc-test-reporter before-build
53-
make develop && ./selftests/run_coverage
54-
./cc-test-reporter after-build
55-
env:
56-
CC_TEST_REPORTER_ID: 009b4c0bfafb850daeb66460df98eded574477a064df0b4a75f65752b18b1d01

Makefile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ all:
66
@echo
77
@echo "Development related targets:"
88
@echo "check: Executes selftests"
9-
@echo "develop: Runs 'python setup.py --develop' on this tree alone"
9+
@echo "develop: Deploy run-perf editable from this directory"
1010
@echo "clean: Get rid of scratch, byte files and removes the links to other subprojects"
1111
@echo "docs: Build html docs in docs/build/html/ dir"
1212
@echo "html_result: Refresh the docs/source/_static/html_result.html from selftests/.assets/results"
@@ -25,7 +25,7 @@ coverage: clean develop
2525
./selftests/run_coverage
2626

2727
develop:
28-
$(PYTHON) -m pip install -e .
28+
$(PYTHON) -m pip install -e ".[dev]"
2929

3030
clean:
3131
$(PYTHON) -m pip uninstall -y runperf
@@ -36,8 +36,8 @@ clean:
3636
docs: develop
3737
make -C docs html
3838

39-
pypi: clean develop
40-
RUNPERF_RELEASE=yes $(PYTHON) setup.py sdist bdist_wheel
39+
pypi: clean
40+
$(PYTHON) -m build
4141
@echo
4242
@echo
4343
@echo "Use 'python3 -m twine upload dist/*'"

docs/source/conf.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import sys
1818
ROOT_PATH = os.path.abspath(os.path.join(os.path.pardir, os.path.pardir))
1919
sys.path.insert(0, ROOT_PATH)
20-
from setup import _get_git_version # pylint: disable=C0413
20+
from runperf.version import __version__ # pylint: disable=C0413
2121

2222
# -- Project information -----------------------------------------------------
2323

@@ -26,15 +26,7 @@
2626
author = 'Lukáš Doktor'
2727

2828
# The full version, including alpha/beta/rc tags
29-
release = _get_git_version()
30-
if release == '0.0':
31-
# Probably in shallow-cloned git, fetch the latest tag
32-
try:
33-
subprocess.call([shutil.which("git"), "fetch", # nosec
34-
"--depth=500"])
35-
release = _get_git_version()
36-
except subprocess.SubprocessError:
37-
pass
29+
release = __version__
3830

3931
# -- API docs ----------------------------------------------------------------
4032
API_SOURCE_DIR = os.path.join(ROOT_PATH, 'runperf')

pyproject.toml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
[build-system]
2+
requires = ["setuptools>=64", "setuptools-scm>=8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "runperf"
7+
description = "Helper to execute perf-beaker-tasks locally or in VM"
8+
readme = "README.rst"
9+
license = "GPL-2.0-or-later"
10+
authors = [
11+
{name = "Lukas Doktor", email = "ldoktor@redhat.com"}
12+
]
13+
classifiers = [
14+
"Development Status :: 4 - Beta",
15+
"Intended Audience :: Developers",
16+
"Natural Language :: English",
17+
"Operating System :: POSIX",
18+
"Topic :: Software Development :: Quality Assurance",
19+
"Topic :: Software Development :: Testing",
20+
"Programming Language :: Python :: 3",
21+
]
22+
requires-python = ">=3.9"
23+
dependencies = [
24+
"aexpect>=1.5.1",
25+
"PyYAML",
26+
"numpy",
27+
]
28+
dynamic = ["version"]
29+
30+
[project.optional-dependencies]
31+
dev = [
32+
"inspektor",
33+
"Sphinx",
34+
"jinja2",
35+
"build",
36+
]
37+
38+
[project.urls]
39+
Homepage = "https://github.com/distributed-system-analysis/run-perf"
40+
41+
[project.entry-points."runperf.profiles"]
42+
"50Localhost" = "runperf.profiles:Localhost"
43+
"50DefaultLibvirt" = "runperf.profiles:DefaultLibvirt"
44+
"50DefaultLibvirtMulti" = "runperf.profiles:DefaultLibvirtMulti"
45+
"50Overcommit1_5" = "runperf.profiles:Overcommit1p5"
46+
"50TunedLibvirt" = "runperf.profiles:TunedLibvirt"
47+
48+
[project.entry-points."runperf.tests"]
49+
"50DummyTest" = "runperf.tests:DummyTest"
50+
"50PBenchFio" = "runperf.tests:PBenchFio"
51+
"50Linpack" = "runperf.tests:Linpack"
52+
"50UPerf" = "runperf.tests:UPerf"
53+
"50PBenchNBD" = "runperf.tests:PBenchNBD"
54+
"50PBenchLibblkio" = "runperf.tests:PBenchLibblkio"
55+
56+
[project.entry-points."runperf.machine.distro_info"]
57+
"50get_distro_info" = "runperf.machine:get_distro_info"
58+
59+
[project.entry-points."runperf.utils.cloud_image_providers"]
60+
"50Fedora" = "runperf.utils.cloud_image_providers:Fedora"
61+
62+
[project.entry-points."runperf.provisioners"]
63+
"50Beaker" = "runperf.provisioners:Beaker"
64+
65+
[project.entry-points."runperf.utils.pbench"]
66+
"50Dnf" = "runperf.utils.pbench:Dnf"
67+
68+
[tool.setuptools.packages.find]
69+
exclude = ["selftests*"]
70+
71+
[project.scripts]
72+
runperf-contrib-path = "runperf.contrib:main"
73+
74+
[tool.setuptools.package-data]
75+
"*" = ["assets/**/*", "contrib/**/*"]
76+
77+
[tool.setuptools]
78+
script-files = [
79+
"scripts/run-perf",
80+
"scripts/analyze-perf",
81+
"scripts/compare-perf",
82+
"scripts/diff-perf",
83+
"scripts/strip-run-perf",
84+
]
85+
86+
[tool.setuptools_scm]
87+
# Version format:
88+
# - Tagged release: X.Y.Z (e.g., 1.2)
89+
# - Development: X.Y.devN+gHASH (e.g., 1.2.dev86+g62d6338)
90+
# - Dirty: X.Y.devN+gHASH.dirty (e.g., 1.2.dev86+g62d6338.dirty)
91+
local_scheme = "dirty-tag"

requirements.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

runperf/contrib.py

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#!/bin/env python3
2+
# This program is free software; you can redistribute it and/or modify
3+
# it under the terms of the GNU General Public License as published by
4+
# the Free Software Foundation; either version 2 of the License, or
5+
# (at your option) any later version.
6+
#
7+
# This program is distributed in the hope that it will be useful,
8+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
#
11+
# See LICENSE for more details.
12+
#
13+
# Copyright: Red Hat Inc. 2024
14+
# Author: Lukas Doktor <ldoktor@redhat.com>
15+
16+
"""Helper to locate contrib scripts directory"""
17+
18+
import os
19+
import sys
20+
21+
22+
def get_contrib_path():
23+
"""
24+
Return the path to the contrib scripts directory.
25+
26+
Works for both editable installs and regular pip installs.
27+
"""
28+
return os.path.join(os.path.dirname(__file__), 'contrib')
29+
30+
31+
def main():
32+
"""Print the path to contrib scripts directory"""
33+
path = get_contrib_path()
34+
if not os.path.isdir(path):
35+
sys.stderr.write(f"Warning: contrib directory not found at {path}\n")
36+
return 1
37+
print(path)
38+
return 0
39+
40+
41+
if __name__ == '__main__':
42+
sys.exit(main())
File renamed without changes.

0 commit comments

Comments
 (0)