Skip to content

Colors rebased#3

Closed
spurnvoj wants to merge 34 commits intotimonegk:colorsfrom
spurnvoj:colors_rebased
Closed

Colors rebased#3
spurnvoj wants to merge 34 commits intotimonegk:colorsfrom
spurnvoj:colors_rebased

Conversation

@spurnvoj
Copy link
Copy Markdown

Hi, I cherry-picked your commit onto the current master branch.

cottsay and others added 30 commits July 25, 2024 15:28
Rather than show an empty verb block when there are no verbs, just hide
the block from the help text entirely.

Follow-up to 6cf24ea
Explicitly support "no verb" in the logging directory setup, as opposed
to treating it as an empty string or raising an exception.
There are no plans to use this feature to allow the 'colcon' executable
to be invoked without a verb, but other tools built on colcon-core's
framework may not want multiple verbs.
This field was removed from setuptools v72.0.0. We'll continue to read
the field in colcon when the underlying setuptools version supports it,
but this change drops the testing for its functionality.
The 'positive' case was previously completely uncovered on Windows, and
there was also no test asserting that the caching mechanism respected
differing input variables.
If the interpreter fails to construct, we don't want to reference it
later. Instead, create a separate try/finally block to deal with
interpreter shutdown.
The previous approach was to re-implement Interpreter.parse() to iterate
over cached tokens where possible. This proved to be a problem when the
implementation changed in EmPy 4.x.

The approach implemented here is to create a shim between the
Interpreter and Scanner API and record/inject the tokens there, which
improves the compatibility by working only at the API boundary and not
duplicating chunks of the upstream implementation.

Co-authored-by: Chris Lalancette <clalancette@gmail.com>
There isn't a clean way to configure EmPy the way we need to which is
compatible with both EmPy 3.x and 4.x. Unfortunately, this means that
we'll need to have separate code paths.

Additionally, EmPy 4.x doesn't take the `name` argument to
Interpreter.string(). From what I can tell, it wasn't used for anything
interesting anyway. In particular, exception traces still contain
`<string>` instead of the file name.
This aligns with our strategy for earlier EmPy versions and avoids an
assertion deep in EmPy v4 if 'output' is unspecified.
This change allows external (non-colcon) CLI implementations to specify
a default for --log-base directory.
I'm not thrilled about using the deprecated 'toml' package, but tomli
isn't available in Focal as a system package. The changes here will only
fall back to 'toml' as a last resort, which should allow us to keep
Focal support alive for a while longer.
Unfortunately, achieving colcon's arbitrary argument parsing involves
reaching into argparse private API. There was recently a change to that
API which was backported to stable Python releases, and this change is
necessary to restore the desired behavior.
Other function groups like augmentation, identification, and discovery,
can be invoked with an explicit list of extensions instances. This
supports scenarios where we want to use extensions other than the ones
registered for colcon_core.
This warning comes up when building ament_python packages
with the --symlink-install option.
The motivation for this change is to mitigate conflicts with debian
packages of colcon extensions provided by the operating system.
At this time, scspell is not available for Python 3.13 due to the
removal of lib2to3. Until we have another solution, we should skip
scspell on Python 3.13 so that we can add that version to the CI matrix
as soon as possible.
These tests require pkg_resources, which was removed in Python 3.13.
We continue to see interference between the deb packages we publish from
the colcon project and efforts to package colcon as part of mainline
Debian and Ubuntu. Using a high Debian-Version value mitigated the
problems in most cases, but was not sufficient to eliminate all of the
conflicts we're currently experiencing.

Using a debian version suffix which falls late alphabetically appears to
give our packages preference by apt. If a user enables a repository
which distributes packages created by the colcon project, it is likely
that they wish to use these packages instead of the ones packaged by
their platform.
The active executor extension already has a private variable holding the
event controller, so it's not difficult to add a method to allow
implementations of the executor extensions to publish events as well.
cottsay and others added 4 commits March 12, 2025 17:58
The current implementation of package discovery follows one of two
paths:
1. None of the extensions were specifically enabled via a command line
   argument, in which case all of the extensions are engaged.
2. Some subset of the extensions were given arguments, in which case the
   others are ignored and their discover() methods are not called.

This change adds support for discovery extensions which do not expose
command line arguments and cannot therefore be specifically enabled, and
ensures that those extensions are always engaged.

This is a non-breaking enhancement of the PackageDiscoveryExtensionPoint
interface.
This approach eliminates the heuristics for handling newlines in
environment variables on platforms where 'env' supports null separation
via the '-0' flag. The 'sh' shell will first attempt to use null
separation and will fall back to the prior behavior.
@spurnvoj
Copy link
Copy Markdown
Author

image

@spurnvoj
Copy link
Copy Markdown
Author

Closing because colorful output is already supported by colcon. See comments here for examples: colcon#487

@spurnvoj spurnvoj closed this Oct 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants