ZODB icon indicating copy to clipboard operation
ZODB copied to clipboard

5.7.0: pytest warning and ZODB/tests should not be installed

Open kloczek opened this issue 3 years ago • 3 comments

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
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-zodb-5.7.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-zodb-5.7.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
==================================================================== test session starts =====================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/ZODB-5.7.0
collected 96 items

src/ZODB/scripts/tests/test_doc.py .                                                                                                                   [  1%]
src/ZODB/scripts/tests/test_fsdump_fsstats.py ..                                                                                                       [  3%]
src/ZODB/scripts/tests/test_fstest.py ..                                                                                                               [  5%]
src/ZODB/scripts/tests/test_repozo.py ........................................................................                                         [ 80%]
src/ZODB/tests/testConnectionSavepoint.txt .                                                                                                           [ 81%]
src/ZODB/tests/test_TransactionMetaData.py .......                                                                                                     [ 88%]
src/ZODB/tests/test_cache.py .                                                                                                                         [ 89%]
src/ZODB/tests/test_doctest_files.py .                                                                                                                 [ 90%]
src/ZODB/tests/test_fsdump.py .                                                                                                                        [ 91%]
src/ZODB/tests/test_mvccadapter.py ...                                                                                                                 [ 94%]
src/ZODB/tests/test_prefetch.py ....                                                                                                                   [ 98%]
src/ZODB/tests/test_storage.py .                                                                                                                       [100%]

====================================================================== warnings summary ======================================================================
src/ZODB/scripts/tests/test_fsdump_fsstats.py::FsdumpFsstatsTests::test_fsstats
  /usr/lib64/python3.8/runpy.py:127: RuntimeWarning: 'ZODB.scripts.fsstats' found in sys.modules after import of package 'ZODB.scripts', but prior to execution of 'ZODB.scripts.fsstats'; this may result in unpredictable behaviour
    warn(RuntimeWarning(msg))

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=============================================================== 96 passed, 1 warning in 1.19s ================================================================

Also looks like ZODB/test/ content is installed. I think that this warning may be related to fact that ZODB/tests is installed.

kloczek avatar Jun 15 '22 19:06 kloczek

Here is fix to not install ZODB/tests

--- a/MANIFEST.in~      2022-03-17 09:29:00.000000000 +0000
+++ b/MANIFEST.in       2022-06-15 19:12:33.681993377 +0000
@@ -20,3 +20,4 @@
 recursive-include src *.test
 recursive-include src *.txt
 recursive-include src *.xml
+recursive-exclude ZODB/tests

kloczek avatar Jun 15 '22 19:06 kloczek

And not installing ZODB/tests doid not fix that warning.

kloczek avatar Jun 15 '22 19:06 kloczek

Use zope.testrunner to run the tests.

icemac avatar Jun 24 '22 15:06 icemac

BTW would you accept PR dropping six and python<=3.7 support? 🤔

kloczek avatar Mar 23 '24 06:03 kloczek

Requests to drop Python 3.7 support will have to wait until Zope itself drops it.

dataflake avatar Mar 23 '24 07:03 dataflake

What about drop use six? 🤔

kloczek avatar Mar 23 '24 08:03 kloczek

Feel free to create a PR. Have you signed the contributor agreement? -> https://www.zope.dev/developer/becoming-a-committer.html

dataflake avatar Mar 23 '24 08:03 dataflake

Searching for six in ZODB does not show any hits regarding that library: https://github.com/search?q=repo%3Azopefoundation%2FZODB%20six&type=code

icemac avatar Mar 26 '24 07:03 icemac

Searching for six in ZODB does not show any hits regarding that library: https://github.com/search?q=repo%3Azopefoundation%2FZODB%20six&type=code

Because that part new version with already merged https://github.com/zopefoundation/ZODB/pull/386 still is not released. Is it possible to make such release? 🤔

kloczek avatar Mar 26 '24 14:03 kloczek

No, it is currently not possible, see https://status.python.org/incidents/dc9zsqzrs0bv Trying to upload the release I got:

Response status code: 403
Reason: New uploads are temporarily disabled. See https://pypi.org/help/#admin-intervention for more information.

Sorry.

icemac avatar Mar 28 '24 06:03 icemac

ZODB 6.0 is now released.

dataflake avatar Mar 30 '24 11:03 dataflake

Thank you looks like new version is OK now 👍

BTW would accept PR which drops python<=3.7 support? 🤔 (3.7 has been EOSed in June 2023).

kloczek avatar Mar 31 '24 12:03 kloczek

No. See my previous comment.

dataflake avatar Mar 31 '24 14:03 dataflake