Closed kloczek closed 1 year ago
Why test suite has hardcodeed build path? 🤔 I seee domething like that first time ever .. (and I've already packaged +800 python modules)
Also it looks like tst suite expect sprobably extension_helpers._utils
which probably is expected that will be DSO module and during the build I dont see used cython to produce DSO.
+ /usr/bin/python3 -sBm build -w --no-isolation
* Getting dependencies for wheel...
running egg_info
creating extension_helpers.egg-info
writing extension_helpers.egg-info/PKG-INFO
writing dependency_links to extension_helpers.egg-info/dependency_links.txt
writing entry points to extension_helpers.egg-info/entry_points.txt
writing requirements to extension_helpers.egg-info/requires.txt
writing top-level names to extension_helpers.egg-info/top_level.txt
writing manifest file 'extension_helpers.egg-info/SOURCES.txt'
listing git files failed - pretending there aren't any
reading manifest file 'extension_helpers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'ah_bootstrap.py'
warning: no previously-included files found matching '*.pyc'
warning: no previously-included files found matching '*.o'
no previously-included directories found matching 'build'
adding license file 'LICENSE.rst'
writing manifest file 'extension_helpers.egg-info/SOURCES.txt'
* Building wheel...
running bdist_wheel
running build
running build_py
creating build
creating build/lib
creating build/lib/extension_helpers
copying extension_helpers/__init__.py -> build/lib/extension_helpers
copying extension_helpers/_openmp_helpers.py -> build/lib/extension_helpers
copying extension_helpers/_setup_helpers.py -> build/lib/extension_helpers
copying extension_helpers/_utils.py -> build/lib/extension_helpers
copying extension_helpers/conftest.py -> build/lib/extension_helpers
copying extension_helpers/version.py -> build/lib/extension_helpers
creating build/lib/extension_helpers/tests
copying extension_helpers/tests/__init__.py -> build/lib/extension_helpers/tests
copying extension_helpers/tests/test_openmp_helpers.py -> build/lib/extension_helpers/tests
copying extension_helpers/tests/test_setup_helpers.py -> build/lib/extension_helpers/tests
copying extension_helpers/tests/test_utils.py -> build/lib/extension_helpers/tests
creating build/lib/extension_helpers/src
copying extension_helpers/src/compiler.c -> build/lib/extension_helpers/src
installing to build/bdist.linux-x86_64/wheel
running install
running install_lib
creating build/bdist.linux-x86_64
creating build/bdist.linux-x86_64/wheel
creating build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/__init__.py -> build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/_openmp_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/_setup_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/_utils.py -> build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/conftest.py -> build/bdist.linux-x86_64/wheel/extension_helpers
copying build/lib/extension_helpers/version.py -> build/bdist.linux-x86_64/wheel/extension_helpers
creating build/bdist.linux-x86_64/wheel/extension_helpers/tests
copying build/lib/extension_helpers/tests/__init__.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests
copying build/lib/extension_helpers/tests/test_openmp_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests
copying build/lib/extension_helpers/tests/test_setup_helpers.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests
copying build/lib/extension_helpers/tests/test_utils.py -> build/bdist.linux-x86_64/wheel/extension_helpers/tests
creating build/bdist.linux-x86_64/wheel/extension_helpers/src
copying build/lib/extension_helpers/src/compiler.c -> build/bdist.linux-x86_64/wheel/extension_helpers/src
running install_egg_info
running egg_info
writing extension_helpers.egg-info/PKG-INFO
writing dependency_links to extension_helpers.egg-info/dependency_links.txt
writing entry points to extension_helpers.egg-info/entry_points.txt
writing requirements to extension_helpers.egg-info/requires.txt
writing top-level names to extension_helpers.egg-info/top_level.txt
listing git files failed - pretending there aren't any
reading manifest file 'extension_helpers.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'ah_bootstrap.py'
warning: no previously-included files found matching '*.pyc'
warning: no previously-included files found matching '*.o'
no previously-included directories found matching 'build'
adding license file 'LICENSE.rst'
writing manifest file 'extension_helpers.egg-info/SOURCES.txt'
Copying extension_helpers.egg-info to build/bdist.linux-x86_64/wheel/extension_helpers-1.0.0-py3.8.egg-info
running install_scripts
creating build/bdist.linux-x86_64/wheel/extension_helpers-1.0.0.dist-info/WHEEL
creating '/home/tkloczko/rpmbuild/BUILD/extension-helpers-1.0.0/dist/tmpna9ic7ne/extension_helpers-1.0.0-py3-none-any.whl' and adding 'build/bdist.linux-x86_64/wheel' to it
adding 'extension_helpers/__init__.py'
adding 'extension_helpers/_openmp_helpers.py'
adding 'extension_helpers/_setup_helpers.py'
adding 'extension_helpers/_utils.py'
adding 'extension_helpers/conftest.py'
adding 'extension_helpers/version.py'
adding 'extension_helpers/src/compiler.c'
adding 'extension_helpers/tests/__init__.py'
adding 'extension_helpers/tests/test_openmp_helpers.py'
adding 'extension_helpers/tests/test_setup_helpers.py'
adding 'extension_helpers/tests/test_utils.py'
adding 'extension_helpers-1.0.0.dist-info/LICENSE.rst'
adding 'extension_helpers-1.0.0.dist-info/METADATA'
adding 'extension_helpers-1.0.0.dist-info/WHEEL'
adding 'extension_helpers-1.0.0.dist-info/entry_points.txt'
adding 'extension_helpers-1.0.0.dist-info/top_level.txt'
adding 'extension_helpers-1.0.0.dist-info/RECORD'
removing build/bdist.linux-x86_64/wheel
Successfully built extension_helpers-1.0.0-py3-none-any.whl
gentle ping 😋
Why test suite has hardcodeed build path? 🤔
Could you clarify what you mean here?
I'm not managing to reproduce this issue - could you perhaps recommend a docker image I could reproduce this in, and the exact commands you are using? (in particular it wasn't clear how exactly you installed the built wheel). Thanks!
Note that also if you run:
/usr/bin/pytest -ra --import-mode=importlib
in the root of the source folder, it will likely try and pick up the tests inside the build
folder and inside the extension_helpers
directory, and in both cases the tests will probably be importing extension_helpers from their parent folders rather than the installed version?
If you want to test the installed version, it would be better to switch to an empty directory and run pytest --pyargs extension_helpers
If you want to test the installed version, it would be better to switch to an empty directory and run
pytest --pyargs extension_helpers
That works. Thx However that param would be goof to add to pytest.ini or to test args in setup.cfg to be able use pytest without args.
I guess we could add testpaths
to the pytest config in setup.cfg (https://github.com/sunpy/sunpy/blob/main/setup.cfg#L114) to make it only pick up the source tree when running without any args.
If you do want to test an installed version of a package though, you are better using --pyargs
if that package has also installed it's tests.
This should be fixed by #54
I'm trying to package your module as an rpm package. So I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.
python3 -sBm build -w --no-isolation
build
with--no-isolation
I'm using during all processes only locally installed modulesHere is pytest output: