Skip to content

Commit c983db6

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 2b10313 commit c983db6

File tree

11 files changed

+116
-21
lines changed

11 files changed

+116
-21
lines changed

.github/workflows/packing.yml

+46
Original file line numberDiff line numberDiff line change
@@ -380,3 +380,49 @@ jobs:
380380
RWS_AUTH: ${{ secrets.RWS_AUTH }}
381381
OS: ${{ matrix.target.os }}
382382
DIST: ${{ matrix.target.dist }}
383+
384+
pack_deb:
385+
# We want to run on external PRs, but not on our own internal
386+
# PRs as they'll be run by the push to the branch.
387+
#
388+
# The main trick is described here:
389+
# https://github.com/Dart-Code/Dart-Code/pull/2375
390+
if: (github.event_name == 'push') ||
391+
(github.event_name == 'pull_request' &&
392+
github.event.pull_request.head.repo.full_name != github.repository)
393+
runs-on: ubuntu-latest
394+
395+
strategy:
396+
fail-fast: false
397+
398+
steps:
399+
- name: Clone the connector repo
400+
uses: actions/checkout@v3
401+
# Checkout all tags for correct version computation
402+
with:
403+
fetch-depth: 0
404+
405+
- name: Install deb packing tools
406+
run: |
407+
sudo apt install -y devscripts equivs
408+
409+
- name: Make changelog entry for non-release build
410+
if: startsWith(github.ref, 'refs/tags') != true
411+
run: make deb-changelog-entry
412+
413+
- name: Install build tools
414+
run: sudo mk-build-deps -i --tool "apt-get --no-install-recommends -y"
415+
env:
416+
DEBIAN_FRONTEND: noninteractive
417+
418+
- name: Pack source and binary deb
419+
run: make deb-dist
420+
421+
- name: Verify the package
422+
run: make deb-dist-check
423+
424+
- name: Archive deb artifacts
425+
uses: actions/upload-artifact@v3
426+
with:
427+
name: deb_dist
428+
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 package with GitHub Actions (#198).
190190
- Pack RPM package with GitHub Actions (#164, #198).
191191
- Publish RPM package with GitHub Actions (#164, #198).
192+
- Pack deb package 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
@@ -60,3 +60,27 @@ rpm-dist:
6060
.PHONY: rpm-dist-check
6161
rpm-dist-check:
6262
rpm -K --nosignature rpm_dist/*.rpm
63+
64+
65+
.PHONY: deb-changelog-entry
66+
deb-changelog-entry:
67+
[email protected] dch --distribution unstable \
68+
--package "python3-tarantool" \
69+
--newversion $$(python3 setup.py --version) \
70+
"Nightly build"
71+
72+
.PHONY: deb-dist
73+
deb-dist:
74+
dpkg-source -b .
75+
dpkg-buildpackage -rfakeroot -us -uc
76+
mkdir -p deb_dist
77+
find .. -maxdepth 1 -type f -regex '.*/python3-tarantool_.*\.deb' \
78+
-or -regex '.*/python3-tarantool_.*\.buildinfo' \
79+
-or -regex '.*/python3-tarantool_.*\.changes' \
80+
-or -regex '.*/python3-tarantool_.*\.dsc' \
81+
-or -regex '.*/python3-tarantool_.*\.tar\.xz' \
82+
| xargs -I {} mv {} deb_dist/
83+
84+
.PHONY: deb-dist-check
85+
deb-dist-check:
86+
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

+14-3
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,20 @@
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 {} \;
912

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

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)