Skip to content

Commit 1337abe

Browse files
cd: pack deb package
New deb spec files are based on stdeb plugin generated files [1] and Debian Style Guide for Packaging Python Libraries [2]. Beware that RPM name is changed based on recommendations for all mainstream distributives [2]. deb files are named with python3-tarantool prefix. Before the patch they were called tarantool-python (even though there wasn't new deb releases since 0.6.5). deb is suitable for distributives with Python 3.7 or newer. See [3] about pre-Python 3.7 systems support. Since deb requires changelog consistency to build, we generate a changelog entry for all nightly CI builds. 1. https://pypi.org/project/stdeb/ 2. https://wiki.debian.org/Python/LibraryStyleGuide?action=show&redirect=Python%2FPackaging 3. #257 Part of #198
1 parent 64002bf commit 1337abe

File tree

11 files changed

+117
-21
lines changed

11 files changed

+117
-21
lines changed

.github/workflows/packing.yml

+46
Original file line numberDiff line numberDiff line change
@@ -376,3 +376,49 @@ jobs:
376376
RWS_AUTH: ${{ secrets.RWS_AUTH }}
377377
OS: ${{ matrix.target.os }}
378378
DIST: ${{ matrix.target.dist }}
379+
380+
pack_deb:
381+
# We want to run on external PRs, but not on our own internal
382+
# PRs as they'll be run by the push to the branch.
383+
#
384+
# The main trick is described here:
385+
# https://github.com/Dart-Code/Dart-Code/pull/2375
386+
if: (github.event_name == 'push') ||
387+
(github.event_name == 'pull_request' &&
388+
github.event.pull_request.head.repo.full_name != github.repository)
389+
runs-on: ubuntu-20.04
390+
391+
strategy:
392+
fail-fast: false
393+
394+
steps:
395+
- name: Clone the connector repo
396+
uses: actions/checkout@v3
397+
# Checkout all tags for correct version computation
398+
with:
399+
fetch-depth: 0
400+
401+
- name: Install deb packing tools
402+
run: |
403+
sudo apt install -y devscripts equivs
404+
405+
- name: Make changelog entry for non-release build
406+
if: startsWith(github.ref, 'refs/tags') != true
407+
run: make deb-changelog-entry
408+
409+
- name: Install build tools
410+
run: sudo mk-build-deps -i --tool "apt-get --no-install-recommends -y"
411+
env:
412+
DEBIAN_FRONTEND: noninteractive
413+
414+
- name: Pack source and binary deb
415+
run: make deb-dist
416+
417+
- name: Verify the package
418+
run: make deb-dist-check
419+
420+
- name: Archive deb artifacts
421+
uses: actions/upload-artifact@v3
422+
with:
423+
name: deb_dist
424+
path: deb_dist

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ sophia
2020

2121
venv/*
2222

23+
.eggs
24+
2325
tarantool/version.py
2426
pip_dist
2527

@@ -32,3 +34,10 @@ rpm/BUILD
3234
rpm/RPMS
3335

3436
rpm_dist
37+
38+
debian/python3-tarantool
39+
debian/*debhelper*
40+
debian/files
41+
debian/*.substvars
42+
43+
deb_dist

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
189189
- Publish pip artifacts with GitHub Actions (#198).
190190
- Pack RPM artifacts with GitHub Actions (#164, #198).
191191
- Publish RPM artifacts with GitHub Actions (#164, #198).
192+
- Pack deb artifacts with GitHub Actions (#198).
192193

193194
### Changed
194195
- Bump msgpack requirement to 1.0.4 (PR #223).

Makefile

+24
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,27 @@ rpm-dist-publish:
6767
$(eval FILE_FLAGS := $(shell find rpm_dist/ -type f -regex '.*rpm' | xargs -I {} sh -c 'echo -F $$(basename {})=@{}' | xargs))
6868
curl -v -LfsS -X PUT ${RWS_REPO}/release/modules/${OS}/${DIST} \
6969
-F product=python3-tarantool $(FILE_FLAGS) -u ${RWS_AUTH}
70+
71+
72+
.PHONY: deb-changelog-entry
73+
deb-changelog-entry:
74+
[email protected] dch --distribution unstable \
75+
--package "python3-tarantool" \
76+
--newversion $$(python3 setup.py --version) \
77+
"Nightly build"
78+
79+
.PHONY: deb-dist
80+
deb-dist:
81+
dpkg-source -b .
82+
dpkg-buildpackage -rfakeroot -us -uc
83+
mkdir -p deb_dist
84+
find .. -maxdepth 1 -type f -regex '.*/python3-tarantool_.*\.deb' \
85+
-or -regex '.*/python3-tarantool_.*\.buildinfo' \
86+
-or -regex '.*/python3-tarantool_.*\.changes' \
87+
-or -regex '.*/python3-tarantool_.*\.dsc' \
88+
-or -regex '.*/python3-tarantool_.*\.tar\.xz' \
89+
| xargs -I {} mv {} deb_dist/
90+
91+
.PHONY: deb-dist-check
92+
deb-dist-check:
93+
dpkg -I deb_dist/*.deb

debian/changelog

+6-6
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ tarantool-python (0.9.0-0) unstable; urgency=medium
100100

101101
* Tarantool Enterprise testing workflow on GitHub actions (PR #220).
102102

103-
-- Georgy Moiseev <[email protected]> Mon, 20 Jun 2022 18:00:00 +0300
103+
-- Georgy Moiseev <[email protected]> Mon, 20 Jun 2022 18:00:00 +0300
104104

105105
tarantool-python (0.8.0-0) unstable; urgency=medium
106106

@@ -286,7 +286,7 @@ tarantool-python (0.8.0-0) unstable; urgency=medium
286286
- Fixed formatting and wording in README (PR #215).
287287
- Clarified license of the project (BSD-2-Clause) (#197, PR #210).
288288

289-
-- Alexander Turenko <[email protected]> Fri, 29 Apr 2022 22:30:00 +0300
289+
-- Alexander Turenko <[email protected]> Fri, 29 Apr 2022 22:30:00 +0300
290290

291291
tarantool-python (0.7.1-0) unstable; urgency=medium
292292

@@ -295,7 +295,7 @@ tarantool-python (0.7.1-0) unstable; urgency=medium
295295
It is pure technical release. It fixes the dependency on the msgpack
296296
library.
297297

298-
-- Alexander Turenko <[email protected]> Mon, 28 Dec 2020 04:01:30 +0300
298+
-- Alexander Turenko <[email protected]> Mon, 28 Dec 2020 04:01:30 +0300
299299

300300
tarantool-python (0.7.0-0) unstable; urgency=medium
301301

@@ -376,7 +376,7 @@ tarantool-python (0.7.0-0) unstable; urgency=medium
376376
* test: ensure compatibility with Python 3 for some testing /
377377
documentation building code (PR #181).
378378

379-
-- Alexander Turenko <[email protected]> Mon, 28 Dec 2020 03:11:10 +0300
379+
-- Alexander Turenko <[email protected]> Mon, 28 Dec 2020 03:11:10 +0300
380380

381381
tarantool-python (0.6.6-0) unstable; urgency=medium
382382

@@ -398,7 +398,7 @@ tarantool-python (0.6.6-0) unstable; urgency=medium
398398
* Fixed a string representation of a Response object without data (say,
399399
authentication response) (#139).
400400

401-
-- Alexander Turenko <[email protected]> Fri, 14 Jun 2019 23:14:07 +0300
401+
-- Alexander Turenko <[email protected]> Fri, 14 Jun 2019 23:14:07 +0300
402402

403403
tarantool-python (0.6.5-0) unstable; urgency=medium
404404

@@ -419,7 +419,7 @@ tarantool-python (0.6.5-0) unstable; urgency=medium
419419
* Eliminated deprecation warnings on Python 3 (#114).
420420
* Add TCP_NODEPLAY back (it was removed in 0.6.4) (#127).
421421

422-
-- Alexander Turenko <[email protected]> Tue, 19 Mar 2019 03:40:01 +0300
422+
-- Alexander Turenko <[email protected]> Tue, 19 Mar 2019 03:40:01 +0300
423423

424424
tarantool-python (0.6.4-0) unstable; urgency=medium
425425

debian/compat

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8
1+
10

debian/control

+13-9
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
Source: tarantool-python
2-
Maintainer: Konstantin Cherkasoff <[email protected]>
1+
Source: python3-tarantool
2+
Maintainer: tarantool-python AUTHORS <[email protected]>
33
Section: python
44
Priority: optional
5-
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7)
5+
# See https://github.com/astraw/stdeb/issues/175 for dependencies
6+
Build-Depends: python3, python3-dev, python3-pip, python3-setuptools,
7+
python3-distutils, python3-wheel, python3-stdeb, dh-python,
8+
debhelper (>= 10)
69
Standards-Version: 3.9.1
10+
Homepage: https://github.com/tarantool/tarantool-python
711

8-
Package: tarantool-python
9-
Architecture: any
10-
Depends: ${misc:Depends}, python-all (>= 2.6.6-3), python-msgpack | msgpack-python
11-
Description: Python client library for Tarantool Database
12-
Python driver for Tarantool 1.6
13-
This package is a pure-python client library for Tarantool.
12+
Package: python3-tarantool
13+
Replaces: tarantool-python (<< 0.9.1~)
14+
Breaks: tarantool-python (<< 0.9.1~)
15+
Architecture: all
16+
Depends: ${misc:Depends}, ${python3:Depends}
17+
Description: Python client library for Tarantool.

debian/files

-1
This file was deleted.

debian/rules

+15-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,21 @@
11
#!/usr/bin/make -f
22

3-
# This file was automatically generated by stdeb 0.6.0+git at
4-
# Thu, 12 Feb 2015 13:46:33 +0300
3+
# This file was automatically generated by stdeb 0.10.0 at
4+
# Wed, 02 Nov 2022 17:29:57 +0300
55

66
%:
7-
dh $@ --with python2 --buildsystem=python_distutils
7+
dh $@ --with python3 --buildsystem=python_distutils
88

9+
override_dh_auto_clean:
10+
python3 setup.py clean -a
11+
find . -name \*.pyc -exec rm {} \;
12+
13+
override_dh_auto_build:
14+
python3 setup.py build --force
15+
16+
override_dh_auto_install:
17+
python3 setup.py install --force --root=debian/python3-tarantool --no-compile -O0 --install-layout=deb --prefix=/usr
18+
19+
override_dh_python2:
20+
dh_python2 --no-guessing-versions
921

debian/source/format

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.0 (quilt)
1+
3.0 (native)

debian/source/options

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
extend-diff-ignore="\.egg-info$"

0 commit comments

Comments
 (0)