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

Add noble as an Ubuntu distro of choice. #738

Merged
merged 10 commits into from
Feb 1, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ To use the latest released version, use an empty string.</description>
<a class="string-array">
<string>@ubuntu_distro</string>
@{
choices = ['jammy']
choices = ['noble', 'jammy']
choices.remove(ubuntu_distro)
}@
@[for choice in choices]@
Expand Down
15 changes: 8 additions & 7 deletions linux_docker_resources/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ RUN echo "deb http://repo.ros2.org/ubuntu/testing/ `lsb_release -cs` main" > /et
RUN echo "Bust Cache for key update 2021-06-01" && curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key | apt-key add -

# Add the OSRF repositories to the apt sources list.
RUN echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list
RUN if test \( ${UBUNTU_DISTRO} != noble \); then echo "deb http://packages.osrfoundation.org/gazebo/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/gazebo-latest.list; fi
RUN curl --silent http://packages.osrfoundation.org/gazebo.key | apt-key add -

# Install some development tools.
Expand All @@ -51,8 +51,8 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
git \
libbenchmark-dev \
libbullet-dev \
libignition-cmake2-dev \
libignition-math6-dev \
$(if test ${UBUNTU_DISTRO} != noble; then echo libignition-cmake2-dev; fi) \
$(if test ${UBUNTU_DISTRO} != noble; then echo libignition-math6-dev; fi) \
liborocos-kdl-dev \
libspdlog-dev \
libsqlite3-dev \
Expand Down Expand Up @@ -86,22 +86,23 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
yamllint

# Install LTTng-related packages starting from Iron only.
RUN if test \( ${UBUNTU_DISTRO} = jammy -a ${ROS_DISTRO} != humble \); then apt-get update && apt-get install --no-install-recommends -y \
RUN if test \( ${ROS_DISTRO} != humble \); then apt-get update && apt-get install --no-install-recommends -y \
liblttng-ust-dev \
lttng-tools \
python3-babeltrace; fi
# Iron uses python3-lttng, but then starting after Iron we switch to liblttng-ctl-dev.
RUN if test \( ${UBUNTU_DISTRO} = jammy -a ${ROS_DISTRO} = iron \); then apt-get update && apt-get install --no-install-recommends -y \
RUN if test \( ${ROS_DISTRO} = iron \); then apt-get update && apt-get install --no-install-recommends -y \
python3-lttng; fi
RUN if test \( ${UBUNTU_DISTRO} = jammy -a ${ROS_DISTRO} = rolling \); then apt-get update && apt-get install --no-install-recommends -y \
RUN if test \( ${ROS_DISTRO} = rolling \); then apt-get update && apt-get install --no-install-recommends -y \
liblttng-ctl-dev; fi

# Install clang if build arg is true
RUN if test ${COMPILE_WITH_CLANG} = true; then apt-get update && apt-get install --no-install-recommends -y clang libc++-dev libc++abi-dev; fi

# Install coverage build dependencies.
RUN apt-get update && apt-get install --no-install-recommends -y lcov
RUN pip3 install -U lcov_cobertura_fix

RUN pip3 install -U lcov_cobertura_fix $(if test ${UBUNTU_DISTRO} = noble; then echo --break-system-packages; fi)

# Install the Connext binary from the OSRF repositories.
RUN if test \( ${PLATFORM} = x86 -a ${INSTALL_CONNEXT_DEBS} = true -a ${UBUNTU_DISTRO} = jammy \); then apt-get update && RTI_NC_LICENSE_ACCEPTED=yes apt-get install -y rti-connext-dds-6.0.1; fi
Expand Down
7 changes: 3 additions & 4 deletions ros2_batch_job/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,11 +242,10 @@ def create_protocol(*args, **kwargs):
else:
return MyProtocol(cmd, exit_on_error, *args, **kwargs)

@asyncio.coroutine
def run_coroutine(future):
async def run_coroutine(future):
kwargs['emulate_tty'] = True
transport, protocol = yield from async_execute_process(create_protocol, cmd, **kwargs)
returncode = yield from protocol.complete
transport, protocol = await async_execute_process(create_protocol, cmd, **kwargs)
returncode = await protocol.complete
future.set_result(returncode)

future = asyncio.Future()
Expand Down
31 changes: 31 additions & 0 deletions ros2_batch_job/vendor/osrf_pycommon/.github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: osrf_pycommon-ci

on:
push:
branches: [master]
pull_request:

jobs:
build:
strategy:
matrix:
os: [macos-latest, ubuntu-22.04, windows-latest]
python: ['3.7', '3.8', '3.9', '3.10']
include:
- os: ubuntu-20.04
python: '3.6'
name: osrf_pycommon tests
runs-on: ${{matrix.os}}

steps:
- uses: actions/checkout@v3
- name: Set up Python ${{matrix.python}}
uses: actions/setup-python@v4
with:
python-version: ${{matrix.python}}
- name: Install dependencies
run: |
python -m pip install -U -e .[test] pytest-cov
- name: Run tests
run: |
python -m pytest tests --cov
1 change: 1 addition & 0 deletions ros2_batch_job/vendor/osrf_pycommon/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,4 @@ coverage.xml
docs/_build/

deb_dist
.pytest_cache
12 changes: 0 additions & 12 deletions ros2_batch_job/vendor/osrf_pycommon/.travis.yml

This file was deleted.

125 changes: 125 additions & 0 deletions ros2_batch_job/vendor/osrf_pycommon/CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,128 @@
2.1.4 (2023-08-21)
------------------
* Catch all of the spurious warnings from get_event_loop. (`#94 <https://github.com/osrf/osrf_pycommon/issues/94>`_)
* Contributors: Chris Lalancette

2.1.3 (2023-07-11)
------------------
* Add bookworm as a python3 target (`#91 <https://github.com/osrf/osrf_pycommon/issues/91>`_)
* Suppress warning for specifically handled behavior (`#87 <https://github.com/osrf/osrf_pycommon/issues/87>`_)
* Update supported platforms (`#93 <https://github.com/osrf/osrf_pycommon/issues/93>`_)
* Add GitHub Actions CI workflow (`#88 <https://github.com/osrf/osrf_pycommon/issues/88>`_)
* Contributors: Scott K Logan, Tully Foote

2.1.2 (2023-02-14)
------------------
* [master] Update maintainers - 2022-11-07 (`#89 <https://github.com/osrf/osrf_pycommon/issues/89>`_)
* Contributors: Audrow Nash

2.1.1 (2022-11-07)
------------------
* Declare test dependencies in [test] extra (`#86 <https://github.com/osrf/osrf_pycommon/issues/86>`_)
* Contributors: Scott K Logan

2.1.0 (2022-05-10)
------------------

2.0.2 (2022-04-08)
------------------
* Fix an importlib_metadata warning with Python 3.10. (`#84 <https://github.com/osrf/osrf_pycommon/issues/84>`_)
* Contributors: Chris Lalancette

2.0.1 (2022-02-14)
------------------
* Don't release 2.x / master on Debian Buster. (`#83 <https://github.com/osrf/osrf_pycommon/issues/83>`_)
Debian Buster is on Python 3.7: https://packages.debian.org/buster/python3
* Stop using mock in favor of unittest.mock. (`#74 <https://github.com/osrf/osrf_pycommon/issues/74>`_)
Mock has been deprecated since Python 3.3; see
https://pypi.org/project/mock/ . The recommended replacement
is unittest.mock, which seems to be a drop-in replacement.
Co-authored-by: William Woodall <william@osrfoundation.org>
* Fix dependencies (`#81 <https://github.com/osrf/osrf_pycommon/issues/81>`_)
* Remove obsolete setuptools from install_requires
Now that pkg_resources are no longer used, there is no need to depend
on setuptools at runtime.
* Fix version-conditional dependency on importlib-metadata
Use version markers to depend on importlib-metadata correctly. Explicit
conditions mean that wheels built with setup.py will either have the dep
or not depending on what Python version they're built with, rather than
what version they're installed on.
* fix whitespace and date in changelog heading
* Contributors: Chris Lalancette, Michał Górny, Steven! Ragnarök, William Woodall

2.0.0 (2022-02-01)
------------------
* Replace the use of ``pkg_resources`` with the more modern ``importlib-metadata``. (`#66 <https://github.com/osrf/osrf_pycommon/issues/66>`_)
* Note this means that from now on you can only release on >= Ubuntu focal as that was when ``python3-importlib-metadata`` was introduced.
* Used the ``1.0.x`` branch if you need an ealier version that still uses ``pkg_resources``.
Co-authored-by: William Woodall <william@osrfoundation.org>
* Contributors: Chris Lalancette

1.0.1 (2022-01-20)
------------------
* Update release distributions. (`#78 <https://github.com/osrf/osrf_pycommon/issues/78>`_)
* Contributors: Steven! Ragnarök

1.0.0 (2021-01-25)
------------------
* Added missing conflict rules in stdeb.cfg.
* Removed Python 2 support.
* Contributors: Chris Lalancette, Timon Engelke

0.2.1 (2021-01-25)
------------------
* Fix osrf.py_common.process_utils.get_loop() implementation (`#70 <https://github.com/osrf/osrf_pycommon/issues/70>`_)
* Contributors: Michel Hidalgo

0.2.0 (2020-12-07)
------------------
* Python 2/3 version conflict (`#69 <https://github.com/osrf/osrf_pycommon/issues/69>`_)
* remove jessie because we no longer support 3.4 (`#67 <https://github.com/osrf/osrf_pycommon/issues/67>`_)
* Remove deprecated use of asyncio.coroutine decorator. (`#64 <https://github.com/osrf/osrf_pycommon/issues/64>`_)
* Fix the __str_\_ method for windows terminal_color. (`#65 <https://github.com/osrf/osrf_pycommon/issues/65>`_)
* Contributors: Chris Lalancette, Jochen Sprickerhof, William Woodall

0.1.10 (2020-05-08)
-------------------
* fixed simple deprecation warnings (issue `#61 <https://github.com/osrf/osrf_pycommon/issues/61>`_) (`#63 <https://github.com/osrf/osrf_pycommon/issues/63>`_)
* Also run tests with Python 3.7 and 3.8 (`#60 <https://github.com/osrf/osrf_pycommon/issues/60>`_)
* Remove old py2 platforms, add Suite3 option with Ubuntu Focal (`#58 <https://github.com/osrf/osrf_pycommon/issues/58>`_)
* Contributors: Shane Loretz, Zahi Kakish

0.1.9 (2019-10-10 12:55:00 -0800)
---------------------------------
* install resource marker file for package (`#56 <https://github.com/osrf/osrf_pycommon/pull/56>`_)

0.1.8 (2019-09-17 11:30:00 -0800)
---------------------------------
* Install package manifest. (`#55 <https://github.com/osrf/osrf_pycommon/issues/55>`_)
Signed-off-by: Dirk Thomas <dirk-thomas@users.noreply.github.com>
* Rename ansi_escape_senquences to ansi_escape_sequences keeping backwards compatibility. (`#53 <https://github.com/osrf/osrf_pycommon/issues/53>`_)
* Contributors: Chris Lalancette, Dirk Thomas

0.1.7 (2019-04-11 12:45:00 -0800)
---------------------------------
* Use keyword arguments only for protocol_class invocations (`#52 <https://github.com/osrf/osrf_pycommon/issues/52>`_)
* Contributors: Daniel Stonier

0.1.6 (2018-11-15 12:45:00 -0800)
---------------------------------
- Changed package.xml to use python2 or python3 dependencies as appropriate. `#50 <https://github.com/osrf/osrf_pycommon/pull/50>`_

0.1.5 (2018-06-19 21:00:00 -0800)
---------------------------------
- Fixed a try-catch statement to adapt to changes in asyncio's raise behavior in `asyncio.get_event_loop()`.
- Small changes, mostly related to distribution.

0.1.4 (2017-12-08 16:00:00 -0800)
---------------------------------
- Only small test/linter fixes and documentation typos removed.

0.1.3 (2017-03-28 19:30:00 -0800)
---------------------------------
- Fix to support optional arguments in verb pattern `#24 <https://github.com/osrf/osrf_pycommon/pull/24>`_


0.1.2 (2016-03-28 19:30:00 -0800)
---------------------------------
- Started keeping a changelog.
Expand Down
2 changes: 2 additions & 0 deletions ros2_batch_job/vendor/osrf_pycommon/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# This file was generated by https://github.com/audrow/update-ros2-repos
* @wjwwood
6 changes: 6 additions & 0 deletions ros2_batch_job/vendor/osrf_pycommon/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
include CHANGELOG.rst
include LICENSE
include package.xml
include README.md

recursive-include osrf_pycommon *.py
9 changes: 8 additions & 1 deletion ros2_batch_job/vendor/osrf_pycommon/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
osrf_pycommon
=============

Commonly needed Python modules, used by Python software developed at OSRF
Commonly needed Python modules, used by Python software developed at OSRF.

Branches
========

If you are releasing (using ``stdeb`` or on the ROS buildfarm) for any Ubuntu < ``focal``, or for any OS that doesn't have a key for ``python3-importlib-metadata``, then you need to use the ``1.0.x`` branch, or the latest ``1.<something>`` branch, because starting with ``2.0.0``, that dependency will be required.

If you are using Python 2, then you should use the ``python2`` branch.
1 change: 1 addition & 0 deletions ros2_batch_job/vendor/osrf_pycommon/_config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
theme: jekyll-theme-minimal
10 changes: 5 additions & 5 deletions ros2_batch_job/vendor/osrf_pycommon/docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
Things like ansi terminal coloring, capturing colored output from programs using subprocess, or even a simple logging system which provides some nice functionality over the built-in Python logging system.

The functionality provided here should be generic enough to be reused in arbitrary scenarios and should avoid bringing in dependencies which are not part of the standard Python library.
Where possible Windows and Linux/OS X should be supported, and where it cannot it should be gracefully degrading.
Code should be pure Python as well as Python 2 and Python 3 bilingual.
Where possible Windows, Linux, and macOS should be supported, and where it cannot it should be gracefully degrading.
Code should be pure Python 3.

Contents:

Expand Down Expand Up @@ -64,13 +64,13 @@ That will "uninstall" the hooks into the ``PYTHONPATH`` which point to your sour
Testing
-------

In order to run the tests you will need to install `nosetests <https://nose.readthedocs.org/>`_, `flake8 <https://flake8.readthedocs.org/>`_, and `Mock <http://www.voidspace.org.uk/python/mock/>`_.
In order to run the tests you will need to install `flake8 <https://flake8.readthedocs.org/>`_.

Once you have installed those, then run ``nosetest`` in the root of the ``osrf_pycommon`` source directory:
Once you have installed those, then run ``unittest``:

.. code-block:: bash

$ nosetests
$ python3 -m unittest discover -v tests

Building the Documentation
--------------------------
Expand Down
12 changes: 7 additions & 5 deletions ros2_batch_job/vendor/osrf_pycommon/docs/process_utils.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ These are the main sections of this module:
Asynchronous Process Utilities
------------------------------

There is a function and class which can be used together with your custom `Tollius <http://trollius.readthedocs.org/>`_ or `asyncio <https://docs.python.org/3/library/asyncio.html>`_ run loop.
There is a function and class which can be used together with your custom `asyncio <https://docs.python.org/3/library/asyncio.html>`_ run loop.

The :py:func:`osrf_pycommon.process_utils.async_execute_process` function is a `coroutine <https://docs.python.org/3/library/asyncio-task.html#coroutines>`_ which allows you to run a process and get the output back bit by bit in real-time, either with stdout and stderr separated or combined.
This function also allows you to emulate the terminal using a pty simply by toggling a flag in the parameters.

Along side this coroutine is a `Protocol <https://docs.python.org/3/library/asyncio-protocol.html#protocols>`_ class, :py:class:`osrf_pycommon.process_utils.AsyncSubprocessProtocol`, from which you can inherit in order to customize how the yielded output is handled.

Because this coroutine is built on the ``trollius``/``asyncio`` framework's subprocess functions, it is portable and should behave the same on all major OS's. (including on Windows where an IOCP implementation is used)
Because this coroutine is built on the ``asyncio`` framework's subprocess functions, it is portable and should behave the same on all major OS's. (including on Windows where an IOCP implementation is used)

.. autofunction:: osrf_pycommon.process_utils.async_execute_process

Expand All @@ -33,9 +33,11 @@ In addtion to these functions, there is a utility function for getting the corre
Treatment of File Descriptors
-----------------------------

Unlike ``subprocess.Popen``, all of the ``process_utils`` functions behave the same way on Python versions 2.7 through 3.4, and they do not close `inheritable <https://docs.python.org/3.4/library/os.html#fd-inheritance>`. file descriptors before starting subprocesses. This is equivalent to passing ``close_fds=False`` to ``subprocess.Popen`` on all Python versions.
Like Python 3.4's ``subprocess.Popen`` (and newer versions), all of the ``process_utils`` functions do not close `inheritable <https://docs.python.org/3.4/library/os.html#fd-inheritance>` file descriptors before starting subprocesses.
This is equivalent to passing ``close_fds=False`` to ``subprocess.Popen`` on all Python versions.

In Python 3.2, the ``subprocess.Popen`` default for the ``close_fds`` option changed from ``False`` to ``True`` so that file descriptors opened by the parent process were closed before spawning the child process. In Python 3.4, `PEP 0446 <https://www.python.org/dev/peps/pep-0446/>`_ additionally made it so even when ``close_fds=False`` file descriptors which are `non-inheritable <https://docs.python.org/3.4/library/os.html#fd-inheritance>`_ are still closed before spawning the subprocess.
For historical context, in Python 3.2, the ``subprocess.Popen`` default for the ``close_fds`` option changed from ``False`` to ``True`` so that file descriptors opened by the parent process were closed before spawning the child process.
In Python 3.4, `PEP 0446 <https://www.python.org/dev/peps/pep-0446/>`_ additionally made it so even when ``close_fds=False`` file descriptors which are `non-inheritable <https://docs.python.org/3.4/library/os.html#fd-inheritance>`_ are still closed before spawning the subprocess.

If you want to be able to pass file descriptors to subprocesses in Python 3.4 or higher, you will need to make sure they are `inheritable <https://docs.python.org/3.4/library/os.html#fd-inheritance>`.

Expand All @@ -47,7 +49,7 @@ For synchronous execution and output capture of subprocess, there are two functi
- :py:func:`osrf_pycommon.process_utils.execute_process`
- :py:func:`osrf_pycommon.process_utils.execute_process_split`

These functions are not yet using the ``trollius``/``asyncio`` framework as a back-end and therefore on Windows will not stream the data from the subprocess as it does on Unix machines.
These functions are not yet using the ``asyncio`` framework as a back-end and therefore on Windows will not stream the data from the subprocess as it does on Unix machines.
Instead data will not be yielded until the subprocess is finished and all output is buffered (the normal warnings about long running programs with lots of output apply).

The streaming of output does not work on Windows because on Windows the :py:func:`select.select` method only works on sockets and not file-like objects which are used with subprocess pipes.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def extract_argument_group(args, delimiting_option):
extracted_args.extend(tail)
break
else:
# Terminator foud, put args up, but not including terminator
# Terminator found, put args up, but not including terminator
# in extracted_args
extracted_args.extend(tail[:next_terminator])
# And put arguments after the terminator back in trimmed_args
Expand Down
Loading