I added a Build-Depend on "python3-pytest <!nocheck>” and added “Testsuite:
autopkgtest-pkg-pybuild” to debian/control. This enables the tests during build time, but I receive the following error during autopkgtest:
E ModuleNotFoundError: No module named ‘electrum.gui.qml’
https://salsa.debian.org/cryptocoin-team/electrum/-/jobs/6505015#L677
I believe I could fix this problem by adding the following to debian/rules:
export PYBUILD_NAME=electrum
My question is, what is the canonical way to handle this?
I added a Build-Depend on "python3-pytest <!nocheck>” and added “Testsuite:
autopkgtest-pkg-pybuild” to debian/control. This enables the tests during
build time, but I receive the following error during autopkgtest:
E ModuleNotFoundError: No module named ‘electrum.gui.qml’
The same happens when I install the package manually and try that import.
https://salsa.debian.org/cryptocoin-team/electrum/-/jobs/6505015#L677
I believe I could fix this problem by adding the following to debian/rules:
export PYBUILD_NAME=electrum
Why would this fix this problem?
My question is, what is the canonical way to handle this?
Fixing the package so that it provides that module or patching the tests
so that they don't require it.
The tests run successfully during build.
However, I should note that there are a significant number of warnings that various
modules are importable packages but missing from setuptools' `packages` configuration.
It is very possible that I am missing some important plumbing in the packaging to expose
these properly,
as I am fairly new to using Python tests or Python at all (my programming background is in other languages). I would imagine upstream only runs these tests at
build time, so the upstream developers might not have included the plumbing for them to
be imported in other environments.
On Tue, Oct 29, 2024 at 01:43:50PM -0700, Soren Stoutner wrote:
I added a Build-Depend on "python3-pytest <!nocheck>” and added “Testsuite:
autopkgtest-pkg-pybuild” to debian/control. This enables the tests during
build time, but I receive the following error during autopkgtest:
E ModuleNotFoundError: No module named ‘electrum.gui.qml’
The same happens when I install the package manually and try that import.
https://salsa.debian.org/cryptocoin-team/electrum/-/jobs/6505015#L677
I believe I could fix this problem by adding the following to debian/rules:
export PYBUILD_NAME=electrum
Why would this fix this problem?
My question is, what is the canonical way to handle this?
Fixing the package so that it provides that module or patching the tests
so that they don't require it.
My question is, what is the canonical way to handle this?
Fixing the package so that it provides that module or patching the tests
so that they don't require it.
The tests run successfully during build.
"688 passed, 3 skipped, 3 warnings in 98.99s (0:01:38)”
https://salsa.debian.org/cryptocoin-team/electrum/-/jobs/6505007#L1548
If I disable it in debian/rules using the following command the test no longer
runs during build.
export PYBUILD_TEST_ARGS=-k 'not test_qml_types.py’
On Wed, Oct 30, 2024 at 12:06:32AM -0700, Soren Stoutner wrote:
If I disable it in debian/rules using the following command the test no longer runs during build.
export PYBUILD_TEST_ARGS=-k 'not test_qml_types.py’
The correct way is --ignore tests/test_qml_types.py
If I disable it in debian/rules using the following command the test no longer runs during build.
export PYBUILD_TEST_ARGS=-k 'not test_qml_types.py’
The correct way is --ignore tests/test_qml_types.py
Thank you. That works perfectly.
Do you think it would be helpful to add that to the wiki at:
https://wiki.debian.org/Python/Pybuild#CUSTOMIZATION
Should it replace the information about the -k command or are they complimentary, with each having advantages in different scenarios?
I recently requested the upstream maintainers add the tests directory to their
signed tarball releases. I am now in the process of trying to enable those tests in the Debian package.
I added a Build-Depend on "python3-pytest <!nocheck>” and added “Testsuite:
autopkgtest-pkg-pybuild” to debian/control. This enables the tests during build time, but I receive the following error during autopkgtest:
E ModuleNotFoundError: No module named ‘electrum.gui.qml’
https://salsa.debian.org/cryptocoin-team/electrum/-/jobs/6505015#L677
I believe I could fix this problem by adding the following to debian/rules:
export PYBUILD_NAME=electrum
However, this breaks the current splitting of the files into two binary packages, electrum and python3-electrum, using .install files.
My question is, what is the canonical way to handle this? Is there some variation of the “export PYBUILD_NAME” command that preserves the contents of
the two binary packages? Or, is there some other command I am missing that will allow autopkgtest to import the built modules?
Looking at things more deeply, the underlying cause is that the upstream source contains GUI environments for both Linux (Qt) and Android (QML). In the build environment, all these files are present (this was the key I was missing). But, in the Debian package, the QML files have been removed (because they aren’t needed).
Hey,In
Looking at things more deeply, the underlying cause is that the upstream source contains GUI environments for both Linux (Qt) and Android (QML).
the build environment, all these files are present (this was the key I was missing). But, in the Debian package, the QML files have been removed (because they aren’t needed).
I'm wondering, if the QML GUI is really only usable on Android. Did you checked, that it is really not usable on a Desktop? If the QML GUI is optimized for phones, that may still be interesting for Mobian ( Debian for mobile devices).
Do you think it would be helpful to add that to the wiki at:
https://wiki.debian.org/Python/Pybuild#CUSTOMIZATION
Yes.
Should it replace the information about the -k command or are they complimentary, with each having advantages in different scenarios?
They are complimentary, --ignore skips the file at the test collection
step (https://docs.pytest.org/en/stable/example/pythoncollection.html), -k and -m select/deselect specific tests (https://docs.pytest.org/en/stable/example/markers.html).
Hi,
this is not entirely correct as while '-k' can be used to skip specific tests with 'not <test>' it can also be used to only include tests matching a specific pattern (in both cases it is just matching the pattern given). It is probably better to rephrase it to something like "The `-k not <test>` flag can be used to skip running specific tests, but they are still collected.....".
On 31 October 2024 7:43:42 pm UTC, Soren Stoutner <soren@debian.org> wrote: >*The `'-k $exp'` command skips running the test, but the tests are still >included in the collection. This will cause failures if the tests have >includes that cannot be satisfied. In that case, the `--ignore` command can >be used instead, which skips adding the test to the collection.
{{{
export PYBUILD_TEST_ARGS=--ignore path/to/test.py
}}}
used instead, which skips adding the test to the collection.
{{{
export PYBUILD_TEST_ARGS=--ignore path/to/test.py
}}}
On Thursday, October 31, 2024 1:37:22 PM MST weepingclown wrote:
That makes sense. I would recommend you update the Wiki with that wording.
Hi,and
Sure, I can do that later. The time here now is late and I am quite tired,
given it is me, I would probably forget to do it later. That is the only reason why I haven't done it already and left a note here so that at least someone will remember it xD
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 481 |
Nodes: | 16 (2 / 14) |
Uptime: | 08:06:51 |
Calls: | 9,538 |
Calls today: | 6 |
Files: | 13,653 |
Messages: | 6,138,953 |
Posted today: | 1 |