diff --git a/ros_buildfarm/jenkins.py b/ros_buildfarm/jenkins.py index edf0451a3..01b3f1b73 100644 --- a/ros_buildfarm/jenkins.py +++ b/ros_buildfarm/jenkins.py @@ -274,9 +274,8 @@ def _diff_configs(remote_config, new_config, context_lines): if ElementTree.tostring(remote_root) == ElementTree.tostring(new_root): return [] - encoding_type = 'utf-8' if sys.version_info[0] < 3 else 'unicode' - xml1 = ElementTree.tostring(remote_root, encoding=encoding_type) - xml2 = ElementTree.tostring(new_root, encoding=encoding_type) + xml1 = ElementTree.tostring(remote_root, encoding='unicode') + xml2 = ElementTree.tostring(new_root, encoding='unicode') lines1 = xml1.splitlines() lines2 = xml2.splitlines() diff --git a/ros_buildfarm/status_page.py b/ros_buildfarm/status_page.py index 702be7fa7..6bd20a585 100644 --- a/ros_buildfarm/status_page.py +++ b/ros_buildfarm/status_page.py @@ -582,16 +582,15 @@ def _version_is_gt_other(version, other_version): def _get_comparable_loose_versions(version_str1, version_str2): loose_version1 = LooseVersion(version_str1) loose_version2 = LooseVersion(version_str2) - if sys.version_info[0] > 2: - # might raise TypeError in Python 3: http://bugs.python.org/issue14894 - version_parts1 = loose_version1.version - version_parts2 = loose_version2.version - for i in range(min(len(version_parts1), len(version_parts2))): - try: - version_parts1[i] < version_parts2[i] - except TypeError: - version_parts1[i] = str(version_parts1[i]) - version_parts2[i] = str(version_parts2[i]) + # might raise TypeError in Python 3: http://bugs.python.org/issue14894 + version_parts1 = loose_version1.version + version_parts2 = loose_version2.version + for i in range(min(len(version_parts1), len(version_parts2))): + try: + version_parts1[i] < version_parts2[i] + except TypeError: + version_parts1[i] = str(version_parts1[i]) + version_parts2[i] = str(version_parts2[i]) return loose_version1, loose_version2 diff --git a/setup.py b/setup.py index d40b5ca61..cb7ad7c79 100644 --- a/setup.py +++ b/setup.py @@ -25,6 +25,7 @@ # - ros_buildfarm/__init__.py # - stdeb.cfg 'version': '3.0.1-master', + 'python_requires': '>=3.6', 'packages': find_packages(exclude=['test']), 'package_data': { 'ros_buildfarm.templates': [ @@ -72,9 +73,6 @@ 'license': 'Apache 2.0', } -if os.sys.version_info[0] == 2: - kwargs['install_requires'].append('configparser') - if 'SKIP_PYTHON_MODULES' in os.environ: kwargs['packages'] = [] elif 'SKIP_PYTHON_SCRIPTS' in os.environ: diff --git a/stdeb.cfg b/stdeb.cfg index 1ef8438bc..5e604b617 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -3,26 +3,18 @@ Debian-Version: 100 ; ros-buildfarm-modules same version (without the branch suffix) as in: ; - ros_buildfarm/__init__.py ; - setup.py -Depends: python-argparse, python-catkin-pkg-modules, python-ros-buildfarm-modules (>= 3.0.0), python-rosdistro-modules (>= 1.0.0), python-yaml -; ros-buildfarm-modules same version (without the branch suffix) as in: -; - ros_buildfarm/__init__.py -; - setup.py Depends3: python3-catkin-pkg-modules, python3-ros-buildfarm-modules (>= 3.0.0), python3-rosdistro-modules (>= 1.0.0), python3-yaml -Conflicts: python3-ros-buildfarm Conflicts3: python-ros-buildfarm -Suite: xenial yakkety zesty artful bionic cosmic disco eoan stretch buster Suite3: xenial yakkety zesty artful bionic cosmic disco eoan focal stretch buster -Python2-Depends-Name: python +No-Python2: +X-Python3-Version: >= 3.6 Setup-Env-Vars: SKIP_PYTHON_MODULES=1 [ros_buildfarm_modules] -Depends: python-catkin-pkg-modules, python-configparser, python-empy, python-rosdistro-modules (>= 1.0.0), python-yaml, python3-empy, python3-vcstool (>= 0.1.37) Depends3: python3-catkin-pkg-modules, python3-empy, python3-rosdistro-modules (>= 1.0.0), python3-vcstool (>= 0.1.37), python3-yaml -Conflicts: python-ros-buildfarm (<< 1.3.0) Conflicts3: python3-ros-buildfarm (<< 1.3.0) -Replaces: python-ros-buildfarm (<< 1.3.0) Replaces3: python3-ros-buildfarm (<< 1.3.0) -Suite: xenial yakkety zesty artful bionic cosmic disco eoan stretch buster Suite3: xenial yakkety zesty artful bionic cosmic disco eoan focal stretch buster -Python2-Depends-Name: python +No-Python2: +X-Python3-Version: >= 3.6 Setup-Env-Vars: SKIP_PYTHON_SCRIPTS=1