Skip to content

Commit e3006de

Browse files
authored
Merge pull request #116 from timlnx/fedora-pkging
Automatic rpm building EPEL 9+
2 parents 83a8170 + e2e7420 commit e3006de

7 files changed

Lines changed: 143 additions & 240 deletions

File tree

.github/workflows/python.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ jobs:
1010
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true
1111
strategy:
1212
matrix:
13-
python-version: ["3.11", "3.12", "3.13"]
13+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1414
os: ["macos-latest", "ubuntu-latest"]
1515
runs-on: ${{ matrix.os }}
1616
steps:

.packit.yaml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
upstream_package_name: bitmath
2+
downstream_package_name: python-bitmath
3+
specfile_path: python-bitmath.spec
4+
upstream_tag_template: "v{version}"
5+
6+
jobs:
7+
# Copr build on every pull request
8+
- job: copr_build
9+
trigger: pull_request
10+
version_suffix: ""
11+
owner: tbielawa
12+
project: bitmath-ci
13+
targets:
14+
- fedora-rawhide-x86_64
15+
- fedora-42-x86_64
16+
- epel-9-x86_64
17+
- epel-10-x86_64
18+
19+
# Copr build on RC tags (v*-rc* pattern)
20+
- job: copr_build
21+
trigger: release
22+
upstream_tag_include: "v.*-rc.*"
23+
owner: tbielawa
24+
project: bitmath-ci
25+
targets:
26+
- fedora-rawhide-x86_64
27+
- fedora-42-x86_64
28+
- epel-9-x86_64
29+
- epel-10-x86_64
30+
31+
# propose_downstream on production tags (clean vX.Y.Z, no RC suffix)
32+
- job: propose_downstream
33+
trigger: release
34+
upstream_tag_exclude: ".*-rc.*"
35+
dist_git_branches:
36+
- rawhide
37+
- f42
38+
- epel9
39+
- epel10
40+
41+
# Koji build triggers after dist-git PR is merged
42+
- job: koji_build
43+
trigger: commit
44+
dist_git_branches:
45+
- rawhide
46+
- f42
47+
- epel9
48+
- epel10
49+
50+
# Bodhi update after successful Koji build (stable branches only, not rawhide)
51+
- job: bodhi_update
52+
trigger: commit
53+
dist_git_branches:
54+
- f42
55+
- epel9
56+
- epel10
57+
bodhi_extra_params:
58+
update_type: enhancement
59+
notes: "New upstream release. See https://github.com/timlnx/bitmath/releases for details."

Makefile

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ PKGNAME := python-$(NAME)
3030

3131
# VERSION file provides one place to update the software version.
3232
VERSION := $(shell cat VERSION)
33-
RPMRELEASE = $(shell awk '/global _short_release/{print $$NF; exit}' $(RPMSPEC).in)
33+
RPMRELEASE := 1
3434

3535
RPMSPECDIR := .
3636
RPMSPEC := $(RPMSPECDIR)/$(PKGNAME).spec
@@ -97,28 +97,24 @@ viewcover: ci-unittests
9797
conf.py: docsite/source/conf.py.in
9898
sed "s/%VERSION%/$(VERSION)/" $< > docsite/source/conf.py
9999

100-
# Build the spec file on the fly. Substitute version numbers from the
101-
# canonical VERSION file.
102-
python-bitmath.spec: python-bitmath.spec.in
103-
sed "s/%VERSION%/$(VERSION)/" $< > $@
104100

105101
build: clean
106102
@echo "#############################################"
107103
@echo "# Building sdist + wheel"
108104
@echo "#############################################"
109-
python -m build
105+
. $(NAME)env3/bin/activate && python -m build
110106

111107
pypi: build
112108
@echo "#############################################"
113109
@echo "# Uploading to PyPI"
114110
@echo "#############################################"
115-
twine upload dist/*
111+
. $(NAME)env3/bin/activate && pip install twine && twine upload dist/*
116112

117113
pypitest: build
118114
@echo "#############################################"
119115
@echo "# Uploading to TestPyPI"
120116
@echo "#############################################"
121-
twine upload --repository testpypi dist/*
117+
. $(NAME)env3/bin/activate && pip install twine && twine upload --repository testpypi dist/*
122118

123119
# usage example: make tag TAG=1.1.0-1
124120
tag:
@@ -140,18 +136,18 @@ install:
140136
mkdir -p /usr/share/man/man1/
141137
gzip -9 -c bitmath.1 > /usr/share/man/man1/bitmath.1.gz
142138

143-
sdist: clean
139+
sdist: clean virtualenv
144140
@echo "#############################################"
145141
@echo "# Creating SDIST"
146142
@echo "#############################################"
147-
python -m build --sdist
143+
. $(NAME)env3/bin/activate && pip install build && python -m build --sdist
148144

149-
rpmcommon: sdist python-bitmath.spec
145+
rpmcommon: sdist
150146
@echo "#############################################"
151147
@echo "# Building (S)RPM Now"
152148
@echo "#############################################"
153149
@mkdir -p rpm-build
154-
@cp dist/$(NAME)-$(VERSION).$(RPMRELEASE).tar.gz rpm-build/$(VERSION).$(RPMRELEASE).tar.gz
150+
@cp dist/$(NAME)-$(VERSION).tar.gz rpm-build/$(VERSION).tar.gz
155151

156152
srpm: rpmcommon
157153
rpmbuild --define "_topdir %(pwd)/rpm-build" \
@@ -160,6 +156,8 @@ srpm: rpmcommon
160156
--define "_srcrpmdir %{_topdir}" \
161157
--define "_specdir $(RPMSPECDIR)" \
162158
--define "_sourcedir %{_topdir}" \
159+
--define "_pkgversion $(VERSION)" \
160+
--define "_pkgrelease $(RPMRELEASE)" \
163161
-bs $(RPMSPEC)
164162
@echo "#############################################"
165163
@echo "$(PKGNAME) SRPM is built:"
@@ -173,6 +171,8 @@ rpm: rpmcommon
173171
--define "_srcrpmdir %{_topdir}" \
174172
--define "_specdir $(RPMSPECDIR)" \
175173
--define "_sourcedir %{_topdir}" \
174+
--define "_pkgversion $(VERSION)" \
175+
--define "_pkgrelease $(RPMRELEASE)" \
176176
-ba $(RPMSPEC)
177177
@echo "#############################################"
178178
@echo "$(PKGNAME) RPMs are built:"

SECURITY.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,3 @@ As an emergency backup you can find me on bsky or instagram and direct message m
4242
* [insta - @tim.lnx](https://www.instagram.com/tim.lnx/)
4343

4444
For less serious security issues with lower potential for exploitation or damage, please open a bug on the project and apply the `security` label to it.
45-

docsite/source/contributing.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,28 @@ fix a failing check yourself, leave a comment on the pull request
9191
explaining the situation and we'll help.
9292

9393

94+
.. _contributing_python_versions:
95+
96+
Supported Python Versions
97+
*************************
98+
99+
bitmath supports Python versions shipping with the current and previous
100+
major RHEL release available via `EPEL <https://docs.fedoraproject.org/en-US/epel/>`_.
101+
This means the minimum supported version tracks the oldest Python still
102+
included in a supported EPEL target:
103+
104+
* **RHEL 10 / EPEL 10** — Python 3.12
105+
* **RHEL 9 / EPEL 9** — Python 3.9, 3.11
106+
107+
The CI matrix tests all versions in this range. When a RHEL major
108+
release reaches end-of-life and is dropped from EPEL, the corresponding
109+
Python versions may be dropped from the support matrix in the next
110+
bitmath release.
111+
112+
If anybody wants to take over Debian/Ubuntu patching, we can add notes
113+
for which distributions are covered.
114+
115+
94116
.. _contributing_automated_tests:
95117

96118
Automated Tests

pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ name = "bitmath"
77
version = "2.0.0"
88
description = "Pythonic module for representing and manipulating file sizes with different prefix notations (file size unit conversion)"
99
readme = "README.rst"
10-
requires-python = ">=3.11"
10+
requires-python = ">=3.9"
1111
authors = [
1212
{ name = "Tim Case", email = "bitmath@lnx.cx" },
1313
]
@@ -23,6 +23,8 @@ classifiers = [
2323
"Programming Language :: Python",
2424
"Programming Language :: Python :: 3",
2525
"Programming Language :: Python :: 3 :: Only",
26+
"Programming Language :: Python :: 3.9",
27+
"Programming Language :: Python :: 3.10",
2628
"Programming Language :: Python :: 3.11",
2729
"Programming Language :: Python :: 3.12",
2830
"Programming Language :: Python :: 3.13",

0 commit comments

Comments
 (0)