Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise minimum required Python version to 3.6 #272

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions doc/developers_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -46,17 +46,13 @@ Setup
::

pip install pytest
pip install mock


rospkg uses `pytest <http://docs.pytest.org>`_
for testing, which is a fairly simple and straightfoward test
framework. You just have to write a function start with the name
``test`` and use normal ``assert`` statements for your tests.

rospkg also uses `mock <http://www.voidspace.org.uk/python/mock/>`_ to
create mocks for testing.

You can run the tests, including coverage, as follows:

::
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
'install_requires': install_requires,
'extras_require': {
'test': [
"mock; python_version < '3.3'",
'pytest',
]},
'author': 'Ken Conley',
Expand All @@ -43,6 +42,7 @@
'classifiers': [
'Programming Language :: Python',
'License :: OSI Approved :: BSD License'],
'python_requires': '>=3.6',
'description': 'ROS package library',
'long_description': """\
Library for retrieving information about ROS packages and stacks.
Expand Down
4 changes: 1 addition & 3 deletions src/rospkg/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,9 +433,7 @@ def parse_manifest_file(dirpath, manifest_name, rospack=None):
return manifest

with open(filename, 'rb') as f:
data = f.read()
if sys.version_info[0] >= 3:
data = data.decode('utf-8')
data = f.read().decode('utf-8')
return parse_manifest(manifest_name, data, filename)


Expand Down
3 changes: 0 additions & 3 deletions src/rospkg/os_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,6 @@
Linux distributions.
"""

from __future__ import absolute_import
from __future__ import print_function

import codecs
# to be removed after Ubuntu Xenial is out of support
import sys
Expand Down
2 changes: 0 additions & 2 deletions src/rospkg/rosversion.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function

import argparse
import os
import sys
Expand Down
4 changes: 2 additions & 2 deletions stdeb.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Conflicts3: python-rospkg
Suite: bionic buster
Suite3: focal jammy noble bookworm trixie
Python2-Depends-Name: python
X-Python3-Version: >= 3.4
X-Python3-Version: >= 3.6
Setup-Env-Vars: SKIP_PYTHON_MODULES=1

[rospkg_modules]
Expand All @@ -26,5 +26,5 @@ Replaces3: python3-rospkg (<< 1.1.0)
Suite: bionic buster
Suite3: focal jammy noble bookworm trixie
Python2-Depends-Name: python
X-Python3-Version: >= 3.4
X-Python3-Version: >= 3.6
Setup-Env-Vars: SKIP_PYTHON_SCRIPTS=1
2 changes: 0 additions & 2 deletions test/test_rospkg_catkin_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function

import os

import rospkg
Expand Down
2 changes: 0 additions & 2 deletions test/test_rospkg_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function


def test_ResourceNotFound():
from rospkg import ResourceNotFound
Expand Down
2 changes: 0 additions & 2 deletions test/test_rospkg_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function

import os


Expand Down
8 changes: 1 addition & 7 deletions test/test_rospkg_os_detect.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,9 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import absolute_import

import os
import sys

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


class TrueOs():
Expand Down
2 changes: 0 additions & 2 deletions test/test_rospkg_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function

import os
import subprocess
import tempfile
Expand Down
3 changes: 0 additions & 3 deletions test/test_rospkg_stacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

from __future__ import print_function

import os

import subprocess


Expand Down
Loading