Add pypi module version overrides

Enable selectively removing version dependencies for a given set of
python modules. The motiviation for this change is to avoid breaking
package builds when there are packages that often lag pypi in updating
their max version requirements.

Signed-off-by: William Douglas <william.douglas@intel.com>
This commit is contained in:
William Douglas
2021-10-19 12:01:14 -07:00
committed by Arjan van de Ven
parent db39793d81
commit 668822df6c
3 changed files with 19 additions and 0 deletions
+14
View File
@@ -324,6 +324,20 @@ series
0001-my-awesome-patch.patch -d some/subdir -p1
```
pypi_overrides
This file contains a list of modules to remove version tests on during the
build. It also modifies the requirement of the requires.txt egg if it
exists in the package. For example:
```
colorama
```
in the file will cause this modification:
```
- 'colorama>=0.2.5,<0.4.4',
+ 'colorama',
```
golang_libpath
When building go packages, the go import path will be guessed automatically
(e.g. building ``https://github.com/go-yaml/yaml/`` would get
+3
View File
@@ -96,6 +96,7 @@ class Config(object):
self.install_append = []
self.service_restart = []
self.patches = []
self.pypi_overrides = []
self.verpatches = OrderedDict()
self.extra_sources = []
self.autoreconf = False
@@ -891,6 +892,8 @@ class Config(object):
self.config_opts['security_sensitive'] = True
self.rewrite_config_opts()
self.pypi_overrides += self.read_conf_file(os.path.join(self.download_path, "pypi_overrides"))
content = self.read_conf_file(os.path.join(self.download_path, "configure"))
self.extra_configure = " \\\n".join(content)
+2
View File
@@ -1363,6 +1363,8 @@ class Specfile(object):
self._write_strip("export MAKEFLAGS=%{?_smp_mflags}")
if self.config.subdir:
self._write_strip("pushd " + self.config.subdir)
for module in self.config.pypi_overrides:
self._write_strip(f"pypi-dep-fix.py . {module}")
self._write_strip("python3 setup.py build " + self.config.extra_configure)
self._write_strip("\n")
if self.tests_config and not self.config.config_opts['skip_tests']: