Now that we have the new asyncio implementation, drop the unused
ThreadPoolExecutor code.
Series-to: u-boot
Cover-letter:
patman: Move to asyncio and other updates
This series moves patman to use asyncio instead of ThreadPoolExecutor
since it makes it easier to handle requests sent from different parts
of the code.
It also includes some updates to bring patman in line with the other
major Python tools (buildman and binman).
With this series, we have a better basis to add support for syncing more
data from a patchwork server.
After this, the next step it to add a new 'patman series' subcommand, to
track and manage series workflow.
END
Signed-off-by: Simon Glass <sjg@chromium.org>
The pager makes it easier to review large number of comments. Add it
around the output.
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>
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>
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>
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>
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.
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>
When running tests there is no situation in which we want ANSI output as
it makes it much harder to see what is going on in logs, tests, etc.
Provide a way to disable this.
Signed-off-by: Simon Glass <sjg@chromium.org>
There is no point in spinning up multiple processes if there is only one
test to execute. Add a check for this.
Signed-off-by: Simon Glass <sjg@chromium.org>
It is useful to have a pager when outputting a lot of text. Add support
for this in the terminal library, making use of a context manager.
Also add a function to indicate whether the output device is a terminal
or not, while we are here, to avoid duplicating this code.
Signed-off-by: Simon Glass <sjg@chromium.org>
The current implementation does not handle background colours very well:
- It outputs an incorrect code in some cases, leading to wrong colours
- Some functions lack a control for the background
Tidy this up so that background colours can be used in more places.
Signed-off-by: Simon Glass <sjg@chromium.org>
2025-04-29 06:52:19 -06:00
9 changed files with 12 additions and 15 deletions
"License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+)",
"Operating System :: OS Independent",
]
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.