Skip to content

Commit

Permalink
Drop support for Python 2 (#183)
Browse files Browse the repository at this point in the history
* The minimum Python version is now 3.6
* Shebangs now use python3 specifically
* Use of the 'mock' backport package has been removed
  • Loading branch information
cottsay authored May 31, 2024
1 parent c2f729b commit c836a9e
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 29 deletions.
2 changes: 1 addition & 1 deletion scripts/rosdistro
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import optparse
import sys
Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_build_cache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Software License Agreement (BSD License)
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_convert
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Software License Agreement (BSD License)
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_freeze_source
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Software License Agreement (BSD License)
#
Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_generate_cache
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import optparse
import sys
Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_migrate_to_rep_141
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_migrate_to_rep_143
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

from __future__ import print_function

Expand Down
2 changes: 1 addition & 1 deletion scripts/rosdistro_reformat
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

# Software License Agreement (BSD License)
#
Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env python
#!/usr/bin/env python3

import os

Expand All @@ -11,6 +11,7 @@
# - stdeb.cfg
'version': '0.9.1',
'install_requires': ['PyYAML', 'setuptools'],
'python_requires': '>=3.6',
'packages': find_packages('src'),
'package_dir': {'': 'src'},
'scripts': [
Expand All @@ -25,7 +26,6 @@
],
'extras_require': {
'test': [
"mock; python_version < '3.3'",
'pytest',
]},
'author': 'Wim Meeussen, Dirk Thomas',
Expand Down
18 changes: 4 additions & 14 deletions stdeb.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,30 +3,20 @@ Debian-Version: 100
; rosdistro-modules same version as in:
; - setup.py
; - src/rosdistro/__init__.py
Depends: ca-certificates, python-rosdistro-modules (>= 0.9.1), python-setuptools, python-yaml
; rosdistro-modules same version as in:
; - setup.py
; - src/rosdistro/__init__.py
Depends3: ca-certificates, python3-rosdistro-modules (>= 0.9.1), python3-setuptools, python3-yaml
Conflicts: python3-rosdistro
Conflicts3: python-rosdistro
Copyright-File: LICENSE.txt
Suite: bionic cosmic disco eoan buster
Suite3: focal jammy noble bookworm trixie
Python2-Depends-Name: python
X-Python3-Version: >= 3.4
No-Python2:
X-Python3-Version: >= 3.6
Setup-Env-Vars: SKIP_PYTHON_MODULES=1

[rosdistro_modules]
Depends: ca-certificates, python-catkin-pkg-modules, python-rospkg-modules, python-setuptools, python-yaml
Depends3: ca-certificates, python3-catkin-pkg-modules, python3-rospkg-modules, python3-setuptools, python3-yaml
Conflicts: python-rosdistro (<< 0.6.0)
Conflicts3: python3-rosdistro (<< 0.6.0)
Replaces: python-rosdistro (<< 0.6.0)
Replaces3: python3-rosdistro (<< 0.6.0)
Copyright-File: LICENSE.txt
Suite: bionic cosmic disco eoan buster
Suite3: focal jammy noble bookworm trixie
Python2-Depends-Name: python
X-Python3-Version: >= 3.4
No-Python2:
X-Python3-Version: >= 3.6
Setup-Env-Vars: SKIP_PYTHON_SCRIPTS=1
6 changes: 1 addition & 5 deletions test/test_manifest_providers.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-

import os

try:
from unittest.mock import patch
except ImportError:
from mock import patch
from unittest.mock import patch

import rosdistro.manifest_provider.github
import rosdistro.vcs
Expand Down

0 comments on commit c836a9e

Please sign in to comment.