Age | Commit message (Collapse) | Author |
|
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>
|
|
People may put their user name and email in a local config file and
reference it by the include.* directives, however `git config --global`
doesn't look up the included configs by default.
Enable the --includes option explicitly to support such use cases.
Signed-off-by: Fei Shao <fshao@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
There is no "run_patman" procedure in patman's __main__.py file, which
would cause the following error at execution:
"AttributeError: module 'patman.__main__' has no attribute 'run_patman'"
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
importlib.resources became part of 3.7 only. Allow using distros with
3.6 and the importlib_resources backport.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Variable orig_dir cannot be used in the finally block if it has not be
assigned outside of the try block.
tools/patman/func_test.py:523:21:
E0601: Using variable 'orig_dir' before assignment
(used-before-assignment)
tools/patman/func_test.py:691:21:
E0601: Using variable 'orig_dir' before assignment
(used-before-assignment)
Fixes: fd70986a62af ("patman: Add a test that uses gitpython")
Fixes: be051c0c7741 ("patman: Detect missing upstream in CountCommitsToBranch")
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
This member is used in series.MakeCcFile() so should be declared in the
Series class.
Add a declaration to silence the warning.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
For large series this can take a while. Run checkpatch in parallel to
try to reduce the time. The checkpatch information is still reported in
sequential order, so a very slow patch at the start can still slow
things down. But overall this gives good results.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
This script can take ages on some series. Try to limit the time by
using threads. If a few stubborn patches remain, show progress so the
user has some idea what is going on.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
This function is quite long. Moving the handling of a commit into a
separate function. This will make it easier to do the work in parallel.
Update function comments while we are here.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
Patman does not do this anymore, as of this commit:
7428dc14b0f ("patman: Remove the -a option")
Drop the comment.
Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
|
|
These can be installed with 'pip' now. Add the details for those who are
interested.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Create the necessary files to build this new package.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Tests are not packaged with patman so this file will not be accessible
when installing with pip. Move the import later in the file, when we
know the file is present.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
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 <sjg@chromium.org>
|
|
While our version is better, it is tricky to use it when we are trying
to package things with pip. Drop it.
Somewhat reduced functionality is provided by the upstream version[1],
along with a rather annoying message each time it is used[2] [3].
[1] pip install concurrencytest
[2] https://github.com/cgoldberg/concurrencytest/issues/12
[3] https://github.com/cgoldberg/concurrencytest/pull/14
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Unfortunately this adds a new feature to concurrencytest and it has not
made it upstream to the project[1].
Drop it for now so we can use the upstream module. Once it is applied we
can bring this functionality back.
[1] https://github.com/cgoldberg/concurrencytest
This reverts commit ebcaafcded40da8ae6cb4234c2ba9901c7bee644.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
Help ensure that these don't creep into development by adding a check in
checkpatch for them.
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This makes it possible to run the patman test suite simply by invoking
'pytest' from the patman sub-directory:
$ cd tools/patman
$ pytest
Otherwise, the top level .checkpatch.conf would be ignored and
multiple test_checkpatch.py tests would fail.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
This reverts commit 648d8186dd7f9c444fb07f355090d275dcdd4de4, because
it broke usage of patman on Linux, whose check script doesn't know
about '--strict' or '--u-boot'.
Reported-by: Sjoerd Simons <sjoerd@collabora.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
Tested-by: Sjoerd Simons <sjoerd@collabora.com>
|
|
This makes it possible to configure a project to use some other
location or script than the default scripts/get_maintainer.pl one used
in the U-Boot and Linux projects. It can be configured via a .patman
configuration file and accepts arguments, as documented.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
This enables versioning a project specific patman configuration file.
It also makes it possible to declare the project name, which is not a
useful thing to do in $HOME/.patman. A new test is added, along
updated documentation.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Rationale: if the user explicitly provide this argument, they probably
intend for it to be used.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
This better matches Python conventions, allowing to easily test
whether the optional argument is provided.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Instead of propagating it from the module entry point (main script).
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
The SafeConfigParser class has been renamed in Python 3.2 to
ConfigParser, and the old alias has been deprecated since.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Remove extraneous imports, variables and comply to PEP 8 maximum line
width, among other PEP 8 changes suggested by Pyflake.
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
|
|
Document that this command is the default and what it's intended for.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
Pytest offers useful features such as selecting tests by means of a
regular expression, or running the pdb debugger upon encountering a
test failure.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
Some tests would fail when the test data is not available, so it
doesn't make much sense to expose the action when patman is running
outside of the u-boot git checkout.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
With this change, a user can run the patman test suite using Pytest
the same as when using 'patman test':
$ cd tools/patman && pytest
[...]
44 passed, 8 warnings in 8.87s
$ ./patman test
Ran 44 tests in 8.460s
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|
|
This allows running the package as a Python module, like e.g.:
$ python -m patman
It also prevents Pytest from attempting to parse main.py, which
would cause errors.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
Fix up main.py in __init__.py:
Signed-off-by: Simon Glass <sjg@chromium.org>
|
|
This resolves 10 out of 11 test failures seen when running './patman
test' from the 'tools/patman' subdirectory. This was caused by the
.checkpatch.conf configuration file at the root of the project not
being picked up. Make the test suite of patman independent from it by
always invoking the checkpatch.pl script with the minimally required
arguments for the test suite to pass.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@savoirfairelinux.com>
|