debian: Add and patch dh-python package

This is a transient work that enables us to progress Debian
integration. This work affects only Debian.

Sysinv loads stevedore plugins. The logic is based on the fact that
the source files are listed in SOURCES.txt which is included in the
egg. The package that provides a plugin is determined by parsing
entry_point and distribution data. Distribution data loads
information from SOURCES.txt.

dh-python is used during build and silently removes the file that
sysinv expects to be present.

Patch the package to keep the file.

Skip CentOS tests because this is a Debian only package.
Debian tests:
PASS: build python package, build non-package python
PASS: SOURCES.txt present in .egg-info in python package

Partial-Bug: https://bugs.launchpad.net/starlingx/+bug/1955648
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Change-Id: Id45b1ba93f9ee88cc01a9cb1fb25527b8a5f1e19
This commit is contained in:
Dan Voiculeasa 2021-12-23 15:05:51 +02:00 committed by Al Bailey
parent dce85a57fa
commit 9b0fb8e455
4 changed files with 43 additions and 0 deletions

View File

@ -55,6 +55,7 @@ ostree/initramfs-ostree
ostree/mttyexec
ostree/ostree
ostree/ostree-upgrade-mgr
python/dh-python
python/python3-setuptools
security/keyrings.alt
security/python-keyring

View File

@ -0,0 +1,10 @@
---
debname: dh-python
debver: 4.20201102+nmu1
dl_path:
name: dh-python-4.20201102+nmu1.tar.gz
url: https://salsa.debian.org/python-team/tools/dh-python/-/archive/4.20201102+nmu1/dh-python-4.20201102+nmu1.tar.gz
md5sum: e8ffceb6618446cd57916d3063a326e3
revision:
dist: $STX_DIST
PKG_GITREVCOUNT: true

View File

@ -0,0 +1,31 @@
From a199540ebeb3be34ce8602f5977cdaf867c578d9 Mon Sep 17 00:00:00 2001
From: Dan Voiculeasa <dan.voiculeasa@windriver.com>
Date: Thu, 23 Dec 2021 15:00:17 +0200
Subject: [PATCH] Keep SOURCES.txt
Sysinv logic is based on the fact that the source files are listed
in SOURCES.txt.
Partial-Bug: https://bugs.launchpad.net/starlingx/+bug/1955648
Signed-off-by: Dan Voiculeasa <dan.voiculeasa@windriver.com>
---
dhpython/fs.py | 3 ---
1 file changed, 3 deletions(-)
diff --git a/dhpython/fs.py b/dhpython/fs.py
index 08fd8a9..6d411e2 100644
--- a/dhpython/fs.py
+++ b/dhpython/fs.py
@@ -400,9 +400,6 @@ class Scan:
self.result['requires.txt'].add(join(dpath, 'requires.txt'))
if 'namespace_packages.txt' in file_names:
self.result['nsp.txt'].add(join(dpath, 'namespace_packages.txt'))
- if 'SOURCES.txt' in file_names:
- os.remove(join(dpath, 'SOURCES.txt'))
- file_names.remove('SOURCES.txt')
def is_egg_file(self, fpath):
"""Check if given file contains egg-info."""
--
2.30.0

View File

@ -0,0 +1 @@
0001-Keep-SOURCES.txt.patch