Skip to content

Commit

Permalink
cd: pack deb package
Browse files Browse the repository at this point in the history
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
  • Loading branch information
DifferentialOrange committed Nov 9, 2022
1 parent 2b10313 commit c983db6
Show file tree
Hide file tree
Showing 11 changed files with 116 additions and 21 deletions.
46 changes: 46 additions & 0 deletions .github/workflows/packing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -380,3 +380,49 @@ jobs:
RWS_AUTH: ${{ secrets.RWS_AUTH }}
OS: ${{ matrix.target.os }}
DIST: ${{ matrix.target.dist }}

pack_deb:
# We want to run on external PRs, but not on our own internal
# PRs as they'll be run by the push to the branch.
#
# The main trick is described here:
# https://github.com/Dart-Code/Dart-Code/pull/2375
if: (github.event_name == 'push') ||
(github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name != github.repository)
runs-on: ubuntu-latest

strategy:
fail-fast: false

steps:
- name: Clone the connector repo
uses: actions/checkout@v3
# Checkout all tags for correct version computation
with:
fetch-depth: 0

- name: Install deb packing tools
run: |
sudo apt install -y devscripts equivs
- name: Make changelog entry for non-release build
if: startsWith(github.ref, 'refs/tags') != true
run: make deb-changelog-entry

- name: Install build tools
run: sudo mk-build-deps -i --tool "apt-get --no-install-recommends -y"
env:
DEBIAN_FRONTEND: noninteractive

- name: Pack source and binary deb
run: make deb-dist

- name: Verify the package
run: make deb-dist-check

- name: Archive deb artifacts
uses: actions/upload-artifact@v3
with:
name: deb_dist
path: deb_dist
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ sophia

venv/*

.eggs

tarantool/version.py
pip_dist

Expand All @@ -32,3 +34,10 @@ rpm/BUILD
rpm/RPMS

rpm_dist

debian/python3-tarantool
debian/*debhelper*
debian/files
debian/*.substvars

deb_dist
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Publish pip package with GitHub Actions (#198).
- Pack RPM package with GitHub Actions (#164, #198).
- Publish RPM package with GitHub Actions (#164, #198).
- Pack deb package with GitHub Actions (#198).

### Changed
- Bump msgpack requirement to 1.0.4 (PR #223).
Expand Down
24 changes: 24 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,27 @@ rpm-dist:
.PHONY: rpm-dist-check
rpm-dist-check:
rpm -K --nosignature rpm_dist/*.rpm


.PHONY: deb-changelog-entry
deb-changelog-entry:
[email protected] dch --distribution unstable \
--package "python3-tarantool" \
--newversion $$(python3 setup.py --version) \
"Nightly build"

.PHONY: deb-dist
deb-dist:
dpkg-source -b .
dpkg-buildpackage -rfakeroot -us -uc
mkdir -p deb_dist
find .. -maxdepth 1 -type f -regex '.*/python3-tarantool_.*\.deb' \
-or -regex '.*/python3-tarantool_.*\.buildinfo' \
-or -regex '.*/python3-tarantool_.*\.changes' \
-or -regex '.*/python3-tarantool_.*\.dsc' \
-or -regex '.*/python3-tarantool_.*\.tar\.xz' \
| xargs -I {} mv {} deb_dist/

.PHONY: deb-dist-check
deb-dist-check:
dpkg -I deb_dist/*.deb
12 changes: 6 additions & 6 deletions debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ tarantool-python (0.9.0-0) unstable; urgency=medium

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Expand Down
2 changes: 1 addition & 1 deletion debian/compat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
10
22 changes: 13 additions & 9 deletions debian/control
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
Source: tarantool-python
Maintainer: Konstantin Cherkasoff <[email protected]>
Source: python3-tarantool
Maintainer: tarantool-python AUTHORS <[email protected]>
Section: python
Priority: optional
Build-Depends: python-setuptools (>= 0.6b3), python-all (>= 2.6.6-3), debhelper (>= 7)
# See https://github.com/astraw/stdeb/issues/175 for dependencies
Build-Depends: python3, python3-dev, python3-pip, python3-setuptools,
python3-distutils, python3-wheel, python3-stdeb, dh-python,
debhelper (>= 10)
Standards-Version: 3.9.1
Homepage: https://github.com/tarantool/tarantool-python

Package: tarantool-python
Architecture: any
Depends: ${misc:Depends}, python-all (>= 2.6.6-3), python-msgpack | msgpack-python
Description: Python client library for Tarantool Database
Python driver for Tarantool 1.6
This package is a pure-python client library for Tarantool.
Package: python3-tarantool
Replaces: tarantool-python (<< 0.9.1~)
Breaks: tarantool-python (<< 0.9.1~)
Architecture: all
Depends: ${misc:Depends}, ${python3:Depends}
Description: Python client library for Tarantool.
1 change: 0 additions & 1 deletion debian/files

This file was deleted.

17 changes: 14 additions & 3 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -1,9 +1,20 @@
#!/usr/bin/make -f

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

%:
dh $@ --with python2 --buildsystem=python_distutils
dh $@ --with python3 --buildsystem=python_distutils

override_dh_auto_clean:
python3 setup.py clean -a
find . -name \*.pyc -exec rm {} \;

override_dh_auto_build:
python3 setup.py build --force

override_dh_auto_install:
python3 setup.py install --force --root=debian/python3-tarantool --no-compile -O0 --install-layout=deb --prefix=/usr

override_dh_python2:
dh_python2 --no-guessing-versions
2 changes: 1 addition & 1 deletion debian/source/format
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0 (quilt)
3.0 (native)
1 change: 1 addition & 0 deletions debian/source/options
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
extend-diff-ignore="\.egg-info$"

0 comments on commit c983db6

Please sign in to comment.