Age | Commit message (Collapse) | Author |
|
Patman normally sends multiple concurrent requests to the patchwork
server, as this is faster. Provide an option to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Now that all the pieces are in place, switch over from using an executor
to using asyncio.
While we are here, import defaultdict to avoid needing to specify its
module.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Import defaultdict to avoid needing to specify its module in multiple
places. Fix an extra blank line while here.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The cover letter has some information on each patch, so allow this to be
stored in the Patch object.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
When comments are shown below patches it can be hard to see the patch
subject. Use yellow instead of blue, since it stands out better.
Pass the colour object into show_responses() rather than creating a new
one, since that is tidier.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This test uses the find_new_responses() function which combines
accessing patchwork and processing the results.
Since the test is aimed at testing processing, adjust it to call
process_reviews() instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Instead of passing the URL and function to each call, put the fake
into the Patchwork object instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This function does patchwork calls and then processes the results. Move
the processing out so we can (later) test it separately.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This function has three phases:
- collecting things from patchwork
- doing some processing
- showing the results to the user / creating a branch
Refactor into two functions so we can eventually have the patchwork part
fully separated out.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This function actually shows the status and does some other things.
Rename it to better reflect its purpose.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Expand the patchwork module so that it can match the current
requirements of the 'patman status' command, i.e. reading the state of a
series and the patches associated with it.
Since the format of each patchwork response is a little tricky to
understand, add examples in comments at the top of each function.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
These relate to information obtained from the patchwork server, so move
their definition into the new patchwork module.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
At present the patchwork implementation is very simple, just consisting
of a function which calls the REST API.
We want to create a fake patchwork for use in tests. So start a new
module to encapsulate communication with the patchwork server.
Use asyncio since it is easier to handle lots of concurrent requests
from different parts of the code.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Now that patman has an unusual dependency, add a requirements.txt file
and use it in CI
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The control module includes much of the implementation of patman's
'send' feature. As a first step to separating this out, move the sending
code into its own file.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Provide support for the -X flag, which preserves the working directory
used by tests. Also support -N which shows captured output for tests.
Finally, allow selection of a particular test to run.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Much of this was written before the other Python tools and they have
evolved. Make a few updates:
- Rather than calling sys.exit(), return the exit code from the control
module and use it in __main__
- Set up tout as it is used in some places
- We now have quite a few tests, so update the comment about that
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This currently has the same name as a test in func_test.py so it isn't
possible to select one or the other with 'patman test test_basic': both
are executed.
Rename this one to avoid confusion.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
A quote character was added a few years ago, but was not intended. Drop
it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add control of capturing output into u_boot_pylib and the tools which
use it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This function is sometimes useful outside tests. Also it can affect how
terminal output is done, e.g. whether ANSI characters should be emitted
or not.
Move it out of the test_util package and into terminal.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
It is easier for tests if the top-level control logic is all in one
module. Create a new do_patman() function to handle this. Move the
existing code into it.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
If a series is sent without a cover letter, there is no indication of
the base commit. Add support for this, since single patches of small
series may not always have a cover letter.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
It is helpful to know which commit patches are based on, even if that
commit might not be available to readers. Add a tag for this in the
cover letter.
Also add the local-branch name since that may be useful to the writer.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Simon Glass <sjg@chromium.org> says:
This series adds comments and fixes pylint warnings in the command
library. It also introduces a new, simpler way of running a single
command.
Link: https://lore.kernel.org/r/20250203162704.627469-1-sjg@chromium.org
|
|
Add a helper to avoid needing to use a list within a list for this
simple case.
Update existing users of runpipe() to use this where possible.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Throwing an Exception is not very friendly since it is the top-level
class of all exceptions. Declare a new class instead.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
With a newer pylint we get a warning that gitutil.RunTests does not
exist, so remove the line.
Signed-off-by: Tom Rini <trini@konsulko.com>
|
|
Move this file into U-Boot's Python library, so that it is no-longer
part of patman.
This makes a start on:
https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/35
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Rather than have a requirements.txt file that's shared between multiple
python projects within U-Boot, create one for each using "pipreqs".
Signed-off-by: Tom Rini <trini@konsulko.com>
|
|
Python strings have their own notion of backslash-escaping, and that can
conflict with the intentions for strings passed to the 're' module. In
particular, I get warnings like this:
tools/patman/../patman/commit.py:9: SyntaxWarning: invalid escape sequence '\s'
re_subject_tag = re.compile('([^:\s]*):\s*(.*)')
We should use a raw string (r'...') so that all escaping is passed into
the regex module, not interpreted within the string itself.
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Installing patman with `cd ./tools/patman && pip install -e .` fails
with the error below.
As described in the error output below, the license line is not allowed
to be only defined in the setup.py. We remove the 'license' field
entirely, as the Python Packaging User Guide recommends using projects
classifiers instead[1] and we already set the GPL-2.0+ classifier.
> $ cd ./tools/patman && pip install -e .
> Obtaining file:///.../u-boot/tools/patman
> Installing build dependencies ... done
> Checking if build backend supports build_editable ... done
> Getting requirements to build editable ... error
> error: subprocess-exited-with-error
>
> × Getting requirements to build editable did not run successfully.
> │ exit code: 1
> ╰─> [61 lines of output]
> /tmp/pip-build-env-mqjvnmz8/overlay/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:76:
> _MissingDynamic: `license` defined outside of `pyproject.toml` is ignored.
> !!
>
> ********************************************************************************
> The following seems to be defined outside of `pyproject.toml`:
>
> `license = 'GPL-2.0+'`
>
> According to the spec (see the link below), however, setuptools CANNOT
> consider this value unless `license` is listed as `dynamic`.
>
> https://packaging.python.org/en/latest/specifications/pyproject-toml/#declaring-project-metadata-the-project-table
>
> To prevent this problem, you can list `license` under `dynamic` or alternatively
> remove the `[project]` table from your file and rely entirely on other means of
> configuration.
> ********************************************************************************
>
> !!
[1] https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
The method `ConfigParser.readfp()` is marked deprecated[1].
In Python 3.12 this method have been removed, so replace it with
`ConfigParser.read_file()`.
[1] https://docs.python.org/3.11/library/configparser.html#configparser.ConfigParser.readfp
Signed-off-by: Brandon Maier <brandon.maier@collins.com>
CC: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
When a patch is added to a series after the initial version, there are no
changes to note except that it is new. This is typically done to suppress
the "(no changes in vN)" message. It's also nice to add a change to the
cover letter so reviewers know there is an additional patch. Add a tag to
automate this process a bit.
There are two nits with the current approach:
- It favors '-' as a bullet point, but some people may prefer '*' (or
something else)
- Tags (e.g. 'patman: ' in 'patman: foo bar') are not stripped. They are
probably just noise in most series, but they may be useful for treewide
series to distinguish 'gpio: frobnicate' from 'reset: frobnicate', so
I've left them in.
Suggestions for the above appreciated.
Suggested-by: Douglas Anderson <dianders@chromium.org>
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Most tags referring to commits (or patches) are named Commit-something. The
exception is Patch-cc. Add a Commit-cc alias so we can use whichever one is
convenient.
Signed-off-by: Sean Anderson <seanga2@gmail.com>
|
|
If add_maintainers is set to False in the user's ~/.patman config, it will
cause the custom_get_maintainer_script to fail since that test expects
maintainers to be added. Set add_maintainer to True in the .patman config
to prevent this.
Fixes: 8c042fb7f9f ("patman: add '--get-maintainer-script' argument")
Signed-off-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
The "Series-patchwork-url:" tag description says that it overrides the
settings file but doesn't specify the name of the setting. Elsewhere
in the documentation about the "useful" settings we see a setting that
sounds promising called "patchwork_server" that's actually not a valid
setting. It should be "patchwork_url".
Fix these problems so the doc is right and more useful.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
|
|
The "Sending patches" and "Patman patch manager" documents refer to the
three-dash, "---", that separates patch parts. The symbol is written in
the documentation in the same form as it is in actual patches: as three
U+002D HYPHEN-MINUS characters. When building the documentation, Sphinx
converts this symbol to a U+2014 EM DASH, that is invalid in this case.
Make the three-dash symbol a reStructuredText inline literal to prevent
its conversion; that is, enclose it in a pair of double backquotes (`).
Signed-off-by: Grzegorz Szymaszek <gszymaszek@short.pl>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
|
|
A new release has been done with this version, so update it. Use the
version numbers in dependencies also.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Patman now has its main program in a function, so update the toml file
to match.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Update to use the new docs.u-boot.org URL for documentation.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
The importlib_resources import is not actually used. Fix this so that
patman can run on Python 3.6 to some extent, once
'pip3 install importlib-resources' has been run.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Import this only when it is needed, since it is not present when
installed via 'pip install'.
Signed-off-by: Simon Glass <sjg@chromium.org>
Fixes: https://source.denx.de/u-boot/u-boot/-/issues/26
|
|
Tidy up the code a little to reduce the number of pylint warnings.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Add a new run_patman() function to hold the main logic.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Move this code into a separate cmdline module, as is done with the
other tools.
Use the same HAS_TESTS check as buildman
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Buildman assumes that branch names do not have a slash in them, since
slash is used to delimit remotes, etc. This means that a branch called
'WIP/tryme' in remote dm ends up being 'tryme'.
Adjust the logic a little, to try to accommodate this.
For now, no tests are added for this behaviour.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@konsulko.com>
|
|
A Change-Id can be useful for traceability purposes, and some projects
may wish to have them preserved. This change makes it configurable
via a new 'keep_change_id' setting.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
These texts lack comments. Add some so that it is clearer what is going
on.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
At this point in time we should not add common.h to any new files, so
make checkpatch.pl complain.
Signed-off-by: Tom Rini <trini@konsulko.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
|