| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
And provide a Makefile to generate the test data from gentoo.git.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
To facilitate unit testing.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
Makes unit testing easier.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
| |
Fixes: a667d93 ("bin/merge-driver-ekeyword: Look for KEYWORDS changes in upstream commit")
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
| |
Has been dead since commit c819d14 in 2009.
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Previously we only looked for changes to the KEYWORDS= line in our local
commit being rebased. If it contained no changes to KEYWORDS= then the
merge-driver gave up.
However our local patch may conflict with an upstream patch that changed
KEYWORDS.
In that case, we can look for changes to the KEYWORDS= line in the other
patch and try to apply its change to ours.
This happened in gentoo.git commits
2c5cd6c4e004 ("sys-fs/squashfs-tools-ng: Stabilize 1.3.0 amd64, #930693")
7129c2e4e5f3 ("sys-fs/squashfs-tools-ng: run elibtoolize in non-live ebuild")
leading to a rebase mistake in the latter (later fixed by commit
7579afbd4aa1 ("sys-fs/squashfs-tools-ng: stabilize 1.3.0 for amd64")).
With this patch applied, the merge conflicts are automatically resolved
between the two commits regardless of which is "ours" vs "theirs".
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
|
| |
Fixes: 1a2c70d ("Run `pyupgrade --py39-plus`")
Signed-off-by: Matt Turner <mattst88@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The man page clearly says that without --deep, users can expect eclean-dist
to be conservative in cleaning up, and not consider the VDB, just the repo
state.
Honour that promise by making VCS cleaning dependent on --deep, given it
involves VDB inspection to see what's installed.
Bug: https://bugs.gentoo.org/923369
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/923369
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/915055
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/928951
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
Zac pointed out that not all return paths had been updated.
Bug: https://bugs.gentoo.org/928138
Fixes: 87912b460c533f8b010617018fdad42246db85f0
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/877485
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Closes: https://github.com/gentoo/gentoolkit/pull/47
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Signed-off-by: Ulrich Müller <ulm@gentoo.org>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/926427
Signed-off-by: Greg Kubaryk <greg.kubaryk@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
(cherry picked from commit 988e47557368df49035eeba94beca893f7b267c1)
|
|
|
|
|
|
| |
This reverts commit 988e47557368df49035eeba94beca893f7b267c1.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
| |
See 988e47557368df49035eeba94beca893f7b267c1.
Bug: https://bugs.gentoo.org/926427
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
| |
Closes: https://bugs.gentoo.org/926427
Signed-off-by: Greg Kubaryk <greg.kubaryk@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Pytest is a testing framework that is backwards compatible with
"unittest" tests, but provides new styles of tests that are more
ergonomic.
Pytest tests do not require wrapping the test in a class, just a top
level python function will be automatically picked up. Assertions use
the regular python assert built-in and provide greatly enhanced debug
output. These features reduce friction in writing new unit tests, and being
backwards compatible allows preserving the existing gentoolkit unit
tests.
Changing the meson test command and installing the pytest package in CI are the
only changes required to start using it!
Signed-off-by: John Turner <jturner.usa@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/45
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
| |
The DependPrinter class name and documentation indicated that it was
meant to be part of the gentoolkit.dependencies API, to print
Dependencies objects. This Printer class is used exclusively for
printering equery depends output and is not a public API outside of
the depends.py module
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The depends module can now iterate over the results of the
graph_reverse_depends function and print the items as they are
yielded.
Before, it passed in a callback printer function, and expected the
Dependencies class to call it correctly.
This setup is nicer because it does not tie together this module and
the Dependencies class, and the old setup most likely existed due to
performance and interactivity concerns which are now fixed by turning
graph_reverse_depends into an iterator.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The graph_reverse_depends method was not able to pass the unit tests
introduced in the previous commits. It has been rewritten to pass them.
This also has adding types to the method, and yields the results as an
iterator rather than collecting them into a list in one shot.
The printer callback parameter has been removed. This callback most
likely existed so that results would be shown to the user as soon as
they were available instead of delaying printing until the method
completed, which could take seconds or minutes depending on the
parameters. By making this method an iterator, the same effect is
acheived by having the caller print every item as its yielded
from the method.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit introduces a new file with a basic unit test for the
graph_reverse_depends method on the Dependencies class.
Only 1 test exists right now, but various setup code and the general
pattern of the tests are valuable for creating more advanced tests,
and more tests for the Dependencies class in general.
Pytest is used to run all of the functions in the file that start with
test_, and a monkeypatch object is passed into test cases and allows
us to mock out methods on the Dependencies class, specifically the
"environment" method, which is used to query for packages variables
like DEPEND and RDEPEND. We are able to test against a small fake
denendency graph by patching the method!
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
StrEnum is only supported in Python versions 3.11 and
newer. Gentoolkit should not require >=3.11, so DependencyKind will
use the regular Enum feature instead.
The difference between StrEnum and Enum is that StrEnum members are
strings and can generally be used in place of strings in APIs
expecting string input. Non-StrEnum members are not strings, but you
can get members values by accessing their value field (DependencyKind.DEPEND.value).
Fixes: 78464ec40bad9a0f824b063506f58296cc3ed9f3
Signed-off-by: John Turner <jturner.usa@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/46
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
| |
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add try/except pair to _deps_equal() to output relavent details
causing the exception in order to aid the user to fix the issue.
Mark binpkg dep failures as a non match for possible deletion.
Make the ebuild dep failure a warning only, return True to save
the binpkg.
Add parameter docstring info
Bug: https://bugs.gentoo.org/923439
Signed-off-by: Brian Dolbec <dolsen@gentoo.org>
|
|
|
|
|
|
|
| |
pym/gentoolkit/dependencies.py:24:1: F401 'gentoolkit.helpers.uniqify' imported but unused
Fixes: c0300517671076db453204c796637e206bf977e5
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functools.cache caches the output of functions "automatically" without
requiring any manual management of a cache value. When used on class
methods, the cache is associated with each class instance and only
lives as long as the instance does.
The Dependencies.graph_reverse_depends method used a dict to cache
the output from pkg.get_all_depends. The get_all_depends method involves calling
portage's aux_get and parsing the DEPEND string that is returned by
it. This dict has been removed and replaced with functools.cache.
The graph_reverse_depends method did not cache the output of the
"raw=True" get_all_depends calls. This "raw" output is the literal string value for
the pkgdeps *DEPEND variables as returned by aux_get. Searching this for a
category/package sub-string allows quickly ruling out non-matching
pkgdeps, which allows skipping parsing the DEPEND string into a list
of Atoms.
Using functools cache the method that fetches the raw DEPEND string
massively improves performance for graph_reverse_depends when
searching for indirect reverse dependencies. "equery depends --indirect emacs"
runtime is ~2s with the raw value being cached, and ~60s
without. Searching for only direct reverse dependencies does not
utilize the cache and does not see any chance in runtime for me.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/44
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of having separate functions for each DEPEND kind, the unified
method returns a dict with all of the packages *DEPEND values inside
of it. The dict can be indexed with a string or a field of the
DependencyKind enum.
This will be espeically useful for a future change that adds the
ability to filter out specific DEPEND kinds from the query.
The Dependencies class did not search IDEPEND dependencies, the
unified method searches all dependency kinds defined in the
DependencyKind enum, which includes IDEPEND!
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
The DependencyKind enum allows iterating over the different dependency
kinds and represents each dependency kind as a type. This could later
be used in APIs for selecting specific dependency kinds in queries.
Signed-off-by: John Turner <jturner.usa@gmail.com>
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
|
| |
Followup to c584d83705a2ca08961e4f0b541442fdf9a75947.
Bug: https://bugs.gentoo.org/922455
Signed-off-by: Siddhanth Rathod <xsiddhanthrathod@gmail.com>
Closes: https://github.com/gentoo/gentoolkit/pull/41
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
| |
Bug: https://bugs.gentoo.org/922455
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
|
|
|
|
| |
This reverts commit e0dc707cc7a37336c175faf463666e5f531a338f.
Didn't mean to push this.
Signed-off-by: Sam James <sam@gentoo.org>
|
|
|
|
| |
Signed-off-by: Sam James <sam@gentoo.org>
|