mvt-project / mvt

MVT (Mobile Verification Toolkit) helps with conducting forensics of mobile devices in order to find signs of a potential compromise.
https://mvt.re
Other
10.15k stars 933 forks source link

Install error: "The following unexpected files/directories were found top-level in the site-packages directory: /usr/lib/python3.11/site-packages/tests" #382

Open vitaly-zdanevich opened 1 year ago

vitaly-zdanevich commented 1 year ago

On Linux.

Related documentation about how to resolve it https://projects.gentoo.org/python/guide/qawarn.html#example-for-test-packages-installed-by-setuptools

kpcyrd commented 1 year ago

On which Linux? Using which command?

Could you paste the full terminal output including what you executed?

vitaly-zdanevich commented 1 year ago

Gentoo Linux, trying to make this ebuild work.

This is the beginning of the logs:

# emerge -a mvt

These are the packages that would be merged, in order:

Calculating dependencies... done!
Dependency resolution took 0.96 s.

[ebuild  N    ~] app-forensics/mvt-2.4.1  PYTHON_TARGETS="python3_11" 

Would you like to merge these packages? [Yes/No] 

>>> Verifying ebuild manifests

>>> Emerging (1 of 1) app-forensics/mvt-2.4.1::guru
 * mvt-2.4.1.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                                                                                                            [ ok ]
>>> Unpacking source...
>>> Unpacking mvt-2.4.1.tar.gz to /var/tmp/portage/app-forensics/mvt-2.4.1/work
>>> Source unpacked in /var/tmp/portage/app-forensics/mvt-2.4.1/work
>>> Preparing source in /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1 ...
 * Build system packages:
 *   dev-python/gpep517            : 13
 *   dev-python/installer          : 0.7.0
 *   dev-python/setuptools         : 67.8.0-r1
 *   dev-python/setuptools-rust    : 1.6.0
 *   dev-python/setuptools-scm     : 7.1.0
 *   dev-python/wheel              : 0.40.0
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1 ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1 ...
 * python3_11: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for mvt-2.4.1 via setuptools.build_meta:__legacy__
gpep517 build-wheel --backend setuptools.build_meta:__legacy__ --output-fd 3 --wheel-dir /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/wheel
2023-08-13 23:10:43,508 gpep517 INFO Building wheel via backend setuptools.build_meta:__legacy__
2023-08-13 23:10:43,528 root INFO running bdist_wheel
2023-08-13 23:10:43,552 root INFO running build
2023-08-13 23:10:43,552 root INFO running build_py
2023-08-13 23:10:43,554 root INFO creating build
2023-08-13 23:10:43,554 root INFO creating build/lib
2023-08-13 23:10:43,554 root INFO creating build/lib/mvt
2023-08-13 23:10:43,554 root INFO copying ./mvt/__init__.py -> build/lib/mvt
2023-08-13 23:10:43,554 root INFO creating build/lib/tests
2023-08-13 23:10:43,554 root INFO copying ./tests/utils.py -> build/lib/tests
2023-08-13 23:10:43,555 root INFO copying ./tests/__init__.py -> build/lib/tests
2023-08-13 23:10:43,555 root INFO copying ./tests/test_check_android_androidqf.py -> build/lib/tests
2023-08-13 23:10:43,555 root INFO copying ./tests/conftest.py -> build/lib/tests
vitaly-zdanevich commented 1 year ago

...end of logs:

2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_dumpsysappops.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_dumpsyspackages.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_dumpsysreceivers.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_getprop.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_processes.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_settings.py'
2023-08-13 23:10:43,628 wheel INFO adding 'tests/android_androidqf/test_sms.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/android_bugreport/__init__.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/android_bugreport/test_bugreport.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/common/__init__.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/common/test_indicators.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/common/test_utils.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/__init__.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_backup_info.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_calendar.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_datausage.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_manifest.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_safari_browserstate.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_sms.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_tcc.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_backup/test_webkit_resource_load_statistics.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_fs/__init__.py'
2023-08-13 23:10:43,629 wheel INFO adding 'tests/ios_fs/test_filesystem.py'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/LICENSE'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/METADATA'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/WHEEL'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/entry_points.txt'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/top_level.txt'
2023-08-13 23:10:43,630 wheel INFO adding 'mvt-2.4.1.dist-info/RECORD'
2023-08-13 23:10:43,630 wheel INFO removing build/bdist.linux-x86_64/wheel
2023-08-13 23:10:43,633 gpep517 INFO The backend produced /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/wheel/mvt-2.4.1-py3-none-any.whl
 *   Installing mvt-2.4.1-py3-none-any.whl to /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/install
gpep517 install-wheel --destdir=/var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/install --interpreter=/usr/bin/python3.11 --prefix=/usr --optimize=all /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/wheel/mvt-2.4.1-py3-none-any.whl
2023-08-13 23:10:43,679 gpep517 INFO Installing /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/wheel/mvt-2.4.1-py3-none-any.whl into /var/tmp/portage/app-forensics/mvt-2.4.1/work/mvt-2.4.1-python3_11/install
2023-08-13 23:10:43,841 gpep517 INFO Installation complete
>>> Source compiled.
>>> Test phase [not enabled]: app-forensics/mvt-2.4.1

>>> Install app-forensics/mvt-2.4.1 into /var/tmp/portage/app-forensics/mvt-2.4.1/image
 * python3_11: running distutils-r1_run_phase distutils-r1_python_install
 * The following unexpected files/directories were found top-level
 * in the site-packages directory:
 * 
 *   /usr/lib/python3.11/site-packages/tests
 * 
 * This is most likely a bug in the build system.  More information
 * can be found in the Python Guide:
 * https://projects.gentoo.org/python/guide/qawarn.html#stray-top-level-files-in-site-packages
 * ERROR: app-forensics/mvt-2.4.1::guru failed (install phase):
 *   Failing install because of stray top-level files in site-packages
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_install
 *   environment, line 3934:  Called distutils-r1_src_install
 *   environment, line 1974:  Called _distutils-r1_run_foreach_impl 'distutils-r1_python_install'
 *   environment, line  796:  Called python_foreach_impl 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 3550:  Called multibuild_foreach_variant '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 3107:  Called _multibuild_run '_python_multibuild_wrapper' 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 3105:  Called _python_multibuild_wrapper 'distutils-r1_run_phase' 'distutils-r1_python_install'
 *   environment, line 1228:  Called distutils-r1_run_phase 'distutils-r1_python_install'
 *   environment, line 1937:  Called _distutils-r1_post_python_install
 *   environment, line  685:  Called die
 * The specific snippet of code:
 *               die "Failing install because of stray top-level files in site-packages";
kpcyrd commented 1 year ago

I don't know neither python nor gentoo well enough to tell if this is a "bug" in setup.cfg or how gentoo packages mvt.

There are other projects that also complain if tests are excluded from the pypi upload, so it should be excluded from the wheel, but not from whatever pypi is using.

vitaly-zdanevich commented 1 year ago

how gentoo packages mvt

Its me, trying to package it.

Te-k commented 1 year ago

I am not sure I understand the problem here, is it that the tests folder is included in the pip package?