| Age | Commit message (Collapse) | Author |
|
Add setuptools package configuration to pyproject.toml so that
u_boot_pylib is installed as a proper Python package without changing
the existing flat directory structure and making sure all modules are
installed.
Signed-off-by: Paul HENRYS <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
The allow_failures parameter in run_test_coverage() is no longer used
by any caller.
Drop it.
Signed-off-by: Simon Glass <[email protected]>
|
|
CVE-2025-47273 describes a path traversal vulnerability.
Signed-off-by: Heinrich Schuchardt <[email protected]>
Reviewed-by: Tom Rini <[email protected]>
|
|
Add functions for checking a branch, showing a commit, etc. to support
the new functionality.
Git version 2.34.1 ignores --stat if --quiet is given, so adjust the
args so that this performs as expected.
Signed-off-by: Simon Glass <[email protected]>
|
|
When running tests where the .git directory is not owned by the current
user, various warnings are produced and the tests fail. This happens in
CI.
For patman itself, modify the gitutil.get_top_level() function to return
None in this case. Ensure that the warning is not shown, since it creates
about 1000 lines of output.
For checkpatch, the same warning is produced even though --no-tree is
given. Suppress that as well.
Signed-off-by: Simon Glass <[email protected]>
|
|
Correct various pylint warnings in this file.
The remaining ones are three functions with too many arguments (R0913
and R0918) and use of global (W0603).
Signed-off-by: Simon Glass <[email protected]>
|
|
The test starts with the HEAD pointing to the wrong place, so that the
created files appear to be deleted. Fix this by resetting the tree
before tests start. Add a check that the tree is clean.
Update pygit2 so that the enums are available.
|
|
Use --decorate to quickly detect the upstream branch, since this is much
faster than using 'git name-rev' on every possible commit.
Signed-off-by: Simon Glass <[email protected]>
|
|
For testing it is useful to be able to set the current directory used
for git operations, as well as the git-repo directory. Update some of
the functions to support this.
Signed-off-by: Simon Glass <[email protected]>
|
|
The current approach to calling 'git send-email' puts double quotes
around each email address to ensure that it will pass the shell
correctly. This is a bit cumbersome and requires using a shell to sort
it all out.
Drop the quotes and use command.run() instead, to simplify things. This
will also make it possible to (later) set the current directory.
Signed-off-by: Simon Glass <[email protected]>
|
|
It is convenient to be able to print a message and exit. Add a new
'fatal' level to support this.
Update some assumptions about the level, so that the tools continue to
work as now.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than accessing the settings module in this function, require the
alias dict to be passed in.
Signed-off-by: Simon Glass <[email protected]>
|
|
Rather than accessing the settings module in this function, require the
alias dict to be passed in.
Signed-off-by: Simon Glass <[email protected]>
|
|
The gitutil module is supposed to be independent from patman but one
piece was missed in the series which separated them.
Move the settings setup out of gitutil
Signed-off-by: Simon Glass <[email protected]>
|
|
Add control of capturing output into u_boot_pylib and the tools which
use it.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
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 <[email protected]>
|
|
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 <[email protected]>
|
|
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 <[email protected]>
|
|
Tests often capture output so they can check it. This means that if the
test fails it is not easy to see what the output actually was.
Add a -N flag which writes out the output after it has been captured.
This is not a perfect solution but it is simple and seems to work well
in practice.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
Using some form of sandbox with Python modules is a long standing best
practice with the language. There are a number of ways to have a Python
sandbox be created. At this point in time, it seems the Python community
is moving towards using the "venv" module provided with Python rather
than a separate tool. To match that we make the following changes:
- Refer to a "Python sandbox" rather than virtualenv in comments, etc.
- Install the python3-venv module in our container and not virtualenv.
- In our CI files, invoke "python -m venv" rather than "virtualenv".
- In documentation, tell users to install python3-venv and not
virtualenv.
Signed-off-by: Tom Rini <[email protected]>
|
|
Simon Glass <[email protected]> says:
This series adds a cover-coverage check to CI for Binman. The iMX8 tests
are still not completed, so a work-around is included for those.
A few fixes are included for some other problems.
Link: https://lore.kernel.org/r/[email protected]
|
|
The iMX8 entry-types don't have proper test coverage. Add a work-around
to skip this for now.
Signed-off-by: Simon Glass <[email protected]>
|
|
Newer versions of the python3-coverage tool require a directory
separator before and after the directory name. Add this so that system
package are not included in the coverage report.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
This file has about 40 pylint warnings, but no errors.
Quite a few of these warnings have been there for a while, but most are
coming from newer versions of pylint, where people come up with new
warnings.
The f-string warning is the most common one:
C0209: Formatting a regular string which could be an f-string
That feature was not available when the code was written, but it is
often more convenient than using % with a list of arguments.
This patches reduces the number of warnings in this file, with 7 left
remaining.
Signed-off-by: Simon Glass <[email protected]>
|
|
Simon Glass <[email protected]> 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/[email protected]
|
|
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 <[email protected]>
|
|
This file has a lot of warnings. Before adding any more features, fix
those which are straightforward to resolve.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
This should be in capitals and defined at the start of the file. Update
it.
Signed-off-by: Simon Glass <[email protected]>
|
|
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 <[email protected]>
|
|
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 <[email protected]>
|
|
append_input_dirs() can be used to append a list of input directories to indir
global list.
Signed-off-by: Paul HENRYS <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
At present run_test_coverage() assumes you want code coverage for the
entire code base. This is the normal situation, but sometimes it is
useful to see the coverage provided by just a single test. Add support
for this.
Signed-off-by: Simon Glass <[email protected]>
|
|
When running within a Python venv we must use the 'coverage' tool (which
is within the venv) so that the venv packages are used in preference to
system packages. Otherwise the coverage tests run in a different
environment from the normal tests and may fail due to missing packages.
Handle this by detecting the venv and changing the tool name.
Signed-off-by: Simon Glass <[email protected]>
|
|
Buildman uses all available CPUs by default, so running more than one or
two concurrent processes is not normally useful.
However in some CI cases we want to be able to run several jobs at once
to save time. For example, in a lab situation we may want to run a test
on 20 boards at a time, since only the build step actually takes much
CPU.
Add an option which allows such a limit. When buildman starts up, it
waits until the number of running processes goes below the limit, then
claims a spot in the list. The list is maintained with a temporary file.
Note that the temp file is user-specific, since it is hard to create a
locked temporary file which can be accessed by any user. In most cases,
only one user is running jobs on a machine, so this should not matter.
Signed-off-by: Simon Glass <[email protected]>
|
|
A new release has been done with this version, so update it. Use the
version numbers in dependencies also.
Signed-off-by: Simon Glass <[email protected]>
|
|
The files list is incorrect and dates from a time when the script was
run from a different directory. Update it to match all the other tools.
Signed-off-by: Simon Glass <[email protected]>
|
|
Correct a heading which is too short in the readme.
Fixes: 75554dfac29 ("patman: Add support for building a u_boot_tools...")
Signed-off-by: Simon Glass <[email protected]>
|
|
Update to use the new docs.u-boot.org URL for documentation.
Signed-off-by: Simon Glass <[email protected]>
|
|
It isn't clear why we need to have two different paths for closing down
the pipe. Unify them and use the Python to avoid this warning:
subprocess.py:1127: ResourceWarning: subprocess 83531 is still running
Note that this code appears to originally have come from [1] and was
committed into the ChromeOS chromiumos/platform/crosutils repo in the
bin/cros_image_to_target.py file. The addition of the extra code path
came later, so that is chosen for the fixes tag.
[1] https://codereview.chromium.org/3391008
Signed-off-by: Simon Glass <[email protected]>
Fixes: a10fd93cbc patman: Make command methods return a CommandResult
|
|
Enable measuring test coverage for buildman so we can see the gaps. It is
currently at 68%.
Signed-off-by: Simon Glass <[email protected]>
|
|
When building from source, setuptools would complain about not finding
package via its auto-discovery mechanism. Manually specify how to
locate the files, relative to the package's directory.
* tools/u_boot_pylib/pyproject.toml: New tool.setuptools.packages.find
section.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
* tools/u_boot_pylib/pyproject.toml (readme): Replace README.md with
README.rst.
Signed-off-by: Maxim Cournoyer <[email protected]>
Reviewed-by: Simon Glass <[email protected]>
|
|
Create the necessary files to build this new package.
Signed-off-by: Simon Glass <[email protected]>
|
|
The patman directory has a number of modules which are used by other tools
in U-Boot. This makes it hard to package the tools using pypi since the
common files must be copied along with the tool that uses them.
To address this, move these files into a new u_boot_pylib library. This
can be packaged separately and listed as a dependency of each tool.
Signed-off-by: Simon Glass <[email protected]>
|