Skip to content

Commit 643c2e6

Browse files
authored
Merge pull request #59 from VCTLabs/develop
add line_profiler package
2 parents 38e3805 + 70e3471 commit 643c2e6

File tree

3 files changed

+202
-0
lines changed

3 files changed

+202
-0
lines changed
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
name: line_profiler RPMs
2+
3+
on:
4+
workflow_dispatch:
5+
pull_request:
6+
push:
7+
branches:
8+
- master
9+
10+
jobs:
11+
get_version:
12+
name: Get version info
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
defaults:
17+
run:
18+
shell: bash
19+
outputs:
20+
version: ${{ steps.spec_ver.outputs.version }}
21+
22+
steps:
23+
- uses: actions/checkout@v6
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Get package version
28+
id: spec_ver
29+
run: |
30+
version=$(make version)
31+
echo "version=${version}" >> $GITHUB_OUTPUT
32+
echo Version from spec: $version
33+
env:
34+
NAME: python-line_profiler
35+
36+
build_rpms:
37+
name: line_profiler-rpms
38+
timeout-minutes: 30
39+
strategy:
40+
fail-fast: false
41+
matrix:
42+
name: [rocky9]
43+
include:
44+
- name: rocky9
45+
spec: python-line_profiler
46+
image: quay.io/rockylinux/rockylinux:9
47+
48+
runs-on: ubuntu-latest
49+
needs: [get_version]
50+
container:
51+
image: ${{ matrix.image }}
52+
permissions:
53+
contents: read
54+
defaults:
55+
run:
56+
shell: bash
57+
env:
58+
PYTHONIOENCODING: utf-8
59+
60+
steps:
61+
- uses: actions/checkout@v6
62+
with:
63+
fetch-depth: 0
64+
65+
# Work-around for https://github.com/actions/runner-images/issues/6775
66+
- name: Change Owner of Container Working Directory
67+
if: matrix.image
68+
run: chown root.root .
69+
70+
- name: Check version
71+
env:
72+
VERSION: ${{ needs.get_version.outputs.version }}
73+
run: |
74+
echo Dev version from get_version step: $VERSION
75+
76+
- name: Install deps for rpm builds (centos/rocky)
77+
run: |
78+
bash scripts/install_deps_el9.sh
79+
80+
- name: Build rpm pkgs
81+
run: |
82+
NAME="${{ matrix.spec }}" make packages
83+
84+
- name: Upload rpm files
85+
uses: actions/upload-artifact@v6
86+
with:
87+
name: packages
88+
path: |
89+
tmp/RPMS/*/*.rpm
90+
tmp/SRPMS/*.rpm
91+
92+
create-release:
93+
name: Create line_profiler Release
94+
runs-on: ubuntu-latest
95+
needs: [get_version, build_rpms]
96+
permissions:
97+
contents: write
98+
steps:
99+
- name: Checkout
100+
uses: actions/checkout@v6
101+
102+
- name: Download Artifacts
103+
uses: actions/download-artifact@v7
104+
with:
105+
name: packages
106+
path: packages
107+
108+
- name: List Artifacts
109+
run: find . -maxdepth 3 -name \*.rpm
110+
111+
- name: Fetch tags
112+
run: git fetch --tags --prune --quiet
113+
114+
- name: Tag Release
115+
id: tag_release
116+
if: ${{ github.event_name != 'pull_request' }}
117+
run: |
118+
set +e
119+
if git rev-list "line_profiler-${{ needs.get_version.outputs.version }}" >/dev/null 2>&1 ; then
120+
echo "Tag for line_profiler-${{ needs.get_version.outputs.version }} already exists. Skipping release creation."
121+
echo "NEW_RELEASE=false" >> $GITHUB_OUTPUT
122+
else
123+
git tag "line_profiler-${{ needs.get_version.outputs.version }}"
124+
git push origin "line_profiler-${{ needs.get_version.outputs.version }}"
125+
echo "NEW_RELEASE=true" >> $GITHUB_OUTPUT
126+
fi
127+
128+
- name: Create draft release
129+
id: create_release
130+
if: ${{ github.event_name != 'pull_request' && steps.tag_release.outputs.NEW_RELEASE == 'true' }}
131+
uses: softprops/action-gh-release@v2
132+
env:
133+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
134+
with:
135+
tag_name: line_profiler-${{ needs.get_version.outputs.version }}
136+
name: RPM Release line_profiler-${{ needs.get_version.outputs.version }}
137+
body: Latest RPMs for line_profiler-${{ needs.get_version.outputs.version }}
138+
draft: false
139+
prerelease: false
140+
files: |
141+
packages/RPMS/*/*.rpm
142+
packages/SRPMS/*.rpm

README.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ or RPM repo host).
8383
:target: https://honcho.readthedocs.io/
8484
:alt: honcho RPM status
8585

86+
.. |line_profiler| image:: https://github.com/VCTLabs/el9-rpm-toolbox/actions/workflows/line_profiler.yml/badge.svg
87+
:target: https://github.com/pyutils/line_profiler
88+
:alt: line_profiler RPM status
89+
8690
.. |logwatcher| image:: https://github.com/VCTLabs/el9-rpm-toolbox/actions/workflows/logwatcher.yml/badge.svg
8791
:target: https://github.com/sarnold/pylogtailer
8892
:alt: logwatcher RPM status

specs/python-line_profiler.spec

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
%global pypi_name line_profiler
2+
3+
Name: python-%{pypi_name}
4+
Version: 5.0.0
5+
Release: 1%{?dist}
6+
Summary: Line-by-line profiling for Python.
7+
8+
License: BSD-3-Clause
9+
URL: http://github.com/pyutils/line_profiler
10+
Source0: %{pypi_source}
11+
BuildArch: noarch
12+
13+
%?python_enable_dependency_generator
14+
15+
%description
16+
line_profiler is a module for doing line-by-line profiling of functions.
17+
kernprof is a convenient script for running either line_profiler or the
18+
Python standard library's cProfile or profile modules, depending on what
19+
is available.
20+
21+
%package -n python3-%{pypi_name}
22+
Summary: Line-by-line profiling for Python.
23+
BuildRequires: python3-devel
24+
BuildRequires: python3-setuptools
25+
BuildRequires: python3-wheel
26+
BuildRequires: python3-tomli
27+
%{?python_provide:%python_provide python3-%{pypi_name}}
28+
29+
%description -n python3-%{pypi_name}
30+
line_profiler is a module for doing line-by-line profiling of functions.
31+
kernprof is a convenient script for running either line_profiler or the
32+
Python standard library's cProfile or profile modules, depending on what
33+
is available.
34+
35+
%prep
36+
%autosetup -p1 -n %{pypi_name}-%{version}
37+
rm -rf %{pypi_name}.egg-info
38+
39+
%build
40+
%py3_build
41+
42+
%install
43+
%py3_install
44+
45+
%files -n python3-%{pypi_name}
46+
%doc README.rst CHANGELOG.rst
47+
%license LICENSE.txt
48+
%{python3_sitelib}/%{pypi_name}/
49+
%{python3_sitelib}/%{pypi_name}-%{version}-py*.egg-info/
50+
%{python3_sitelib}/__pycache__
51+
%{python3_sitelib}/*.py
52+
%{_bindir}/kernprof
53+
54+
%changelog
55+
* Tue Dec 23 2025 Stephen Arnold <nerdboy@gentoo.org> - 5.0.0
56+
- New package

0 commit comments

Comments
 (0)