]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
setup.py generation script: removed upper bounds from dependency versions
authorVasek Sraier <git@vakabus.cz>
Thu, 28 Oct 2021 08:43:30 +0000 (10:43 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Fri, 8 Apr 2022 14:17:53 +0000 (16:17 +0200)
manager/scripts/codecheck
manager/scripts/create_setup.py
manager/setup.py

index 0be9f93f0eb1b6f982fec55ce341efc0538712f9..5f16d97851c70195f322c1912c7ef0ccbcc2e845 100755 (executable)
@@ -45,6 +45,8 @@ echo
 echo -e "${yellow}Checking setup.py${reset}"
 python scripts/create_setup.py | diff - setup.py
 check_rv $?
+python setup.py --help > /dev/null
+check_rv $?
 echo
 
 # fancy messages at the end :)
index bf1366c08858a819d554fc4ffde5fe3a7bb3f03a..5c9b00407659fbc99309e5f3a45473d7589b0d3e 100644 (file)
@@ -3,7 +3,8 @@
 #
 # Original source:
 # https://github.com/sdss/flicamera/blob/main/create_setup.py
-# We modified the script so that it outputs the setup.py to stdout
+# We modified the script so that it outputs the setup.py to stdout and that no
+# version upper bounds are outputted in the depencency list.
 #
 # @Author: José Sánchez-Gallego (gallegoj@uw.edu)
 # @Date: 2019-12-18
@@ -19,6 +20,8 @@
 import os
 import sys
 from distutils.version import StrictVersion
+import re
+from typing import List
 
 
 # If there is a global installation of poetry, prefer that.
@@ -55,7 +58,14 @@ if StrictVersion(__version__) >= StrictVersion("1.1.0b1"):
 else:
     sdist_builder = SdistBuilder(poetry, None, None)
 
-setuppy_blob = sdist_builder.build_setup()
+setuppy_blob: bytes = sdist_builder.build_setup()
 
-sys.stdout.buffer.write(setuppy_blob)
-sys.stdout.buffer.write(b"\n# This setup.py was autogenerated using poetry.\n")
+
+# patch the result so that it does not contain upper bounds in dependencies
+# (but it should contain them in python version)
+setuppy = setuppy_blob.decode('utf8')
+setuppy, _ = re.subn(r'(\'[^\']+>=[^<>=,\']*),<[^<>=,\']*\'', '\\1\'', setuppy)
+
+# output the setup.py script to stdout
+print(setuppy)
+print("\n# This setup.py was autogenerated using Poetry for backward compatibility with setuptools.")
index 2fe1c66b1effdd267acd2ab761da542015d58948..cef6f48a6e6aa7c13650e6eb95b9bfd54dcf3c57 100644 (file)
@@ -15,14 +15,14 @@ package_data = \
 {'': ['*']}
 
 install_requires = \
-['Jinja2>=2.11.3,<3.0.0',
- 'PyGObject>=3.38.0,<4.0.0',
- 'PyYAML>=5.4.1,<6.0.0',
- 'aiohttp>=3.6.12,<4.0.0',
- 'click>=7.1.2,<8.0.0',
- 'pydbus>=0.6.0,<0.7.0',
- 'requests>=2.25.1,<3.0.0',
- 'typing-extensions>=3.10.0,<4.0.0']
+['Jinja2>=2.11.3',
+ 'PyGObject>=3.38.0',
+ 'PyYAML>=5.4.1',
+ 'aiohttp>=3.6.12',
+ 'click>=7.1.2',
+ 'pydbus>=0.6.0',
+ 'requests>=2.25.1',
+ 'typing-extensions>=3.10.0']
 
 setup_kwargs = {
     'name': 'knot-resolver-manager',
@@ -43,4 +43,5 @@ setup_kwargs = {
 
 setup(**setup_kwargs)
 
-# This setup.py was autogenerated using poetry.
+
+# This setup.py was autogenerated using Poetry for backward compatibility with setuptools.