https://bugzilla.redhat.com/show_bug.cgi?id=2196518
Bug ID: 2196518 Summary: python-nbformat fails to build with Python 3.12: DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12 Product: Fedora Version: rawhide Status: NEW Component: python-nbformat Assignee: orion@nwra.com Reporter: thrnciar@redhat.com QA Contact: extras-qa@fedoraproject.org CC: epel-packagers-sig@lists.fedoraproject.org, jonathan@almalinux.org, mhroncok@redhat.com, orion@nwra.com, python-packagers-sig@lists.fedoraproject.org, thrnciar@redhat.com, tomspur@fedoraproject.org Blocks: 2135404 (PYTHON3.12) Target Milestone: --- Classification: Fedora
python-nbformat fails to build with Python 3.12.0a7.
=================================== FAILURES =================================== _______________________ TestNotary.test_check_signature ________________________
self = <tests.test_sign.TestNotary testMethod=test_check_signature>
def test_check_signature(self): nb = self.nb md = nb.metadata notary = self.notary check_signature = notary.check_signature # no signature: md.pop("signature", None) self.assertFalse(check_signature(nb)) # hash only, no algo md.signature = notary.compute_signature(nb) self.assertFalse(check_signature(nb)) # proper signature, algo mismatch notary.algorithm = "sha224"
notary.sign(nb)
tests/test_sign.py:133: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:462: in sign self.store.store_signature(signature, self.algorithm) nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 14214)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning ___________________________ TestNotary.test_cull_db ____________________________
self = <tests.test_sign.TestNotary testMethod=test_cull_db>
def test_cull_db(self): # this test has various sleeps of 2ms # to ensure low resolution timestamps compare as expected dt = 2e-3 nbs = [copy.deepcopy(self.nb) for i in range(10)] for row in self.notary.store.db.execute("SELECT * FROM nbsignatures"): print(row) self.notary.store.cache_size = 8 for i, nb in enumerate(nbs[:8]): nb.metadata.dirty = i
self.notary.sign(nb)
tests/test_sign.py:100: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:462: in sign self.store.store_signature(signature, self.algorithm) nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 40720)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning _______________________ TestNotary.test_invalid_db_file ________________________
self = <tests.test_sign.TestNotary testMethod=test_invalid_db_file>
def test_invalid_db_file(self): invalid_sql_file = os.path.join(self.data_dir, "invalid_db_file.db") with open(invalid_sql_file, "w") as tempfile: tempfile.write("[invalid data]")
invalid_notary = sign.NotebookNotary( db_file=invalid_sql_file, secret=b"secret", )
invalid_notary.sign(self.nb)
tests/test_sign.py:50: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:462: in sign self.store.store_signature(signature, self.algorithm) nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 57603)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning ------------------------------ Captured log call ------------------------------- WARNING traitlets:sign.py:154 The signatures database cannot be opened; maybe it is corrupted or encrypted. You may need to rerun your notebooks to ensure that they are trusted to run Javascript. The old signatures database has been renamed to /tmp/tmp18ip2sda/invalid_db_file.db.bak and a new one has been created. _____________________________ TestNotary.test_sign _____________________________
self = <tests.test_sign.TestNotary testMethod=test_sign>
def test_sign(self): self.assertFalse(self.notary.check_signature(self.nb))
self.notary.sign(self.nb)
tests/test_sign.py:79: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:462: in sign self.store.store_signature(signature, self.algorithm) nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 83773)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning ____________________________ TestNotary.test_unsign ____________________________
self = <tests.test_sign.TestNotary testMethod=test_unsign>
def test_unsign(self):
self.notary.sign(self.nb)
tests/test_sign.py:83: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:462: in sign self.store.store_signature(signature, self.algorithm) nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 558943)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning ____________________ SQLiteSignatureStoreTests.test_basics _____________________
self = <tests.test_sign.SQLiteSignatureStoreTests testMethod=test_basics>
def test_basics(self): digest = "0123457689abcef" algo = "fake_sha" assert not self.store.check_signature(digest, algo)
self.store.store_signature(digest, algo)
tests/test_sign.py:260: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ nbformat/sign.py:205: in store_signature self.db.execute( _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
val = datetime.datetime(2023, 5, 9, 11, 29, 45, 574206)
def adapt_datetime(val):
warn(msg.format(what="datetime adapter"), DeprecationWarning, stacklevel=2)
E DeprecationWarning: The default datetime adapter is deprecated as of Python 3.12; see the sqlite3 documentation for suggested replacement recipes
/usr/lib64/python3.12/sqlite3/dbapi2.py:68: DeprecationWarning =============================== warnings summary =============================== ../../../../usr/lib/python3.12/site-packages/jupyter_core/application.py:21 /usr/lib/python3.12/site-packages/jupyter_core/application.py:21: DeprecationWarning: Jupyter is migrating its paths to use standard platformdirs given by the platformdirs library. To remove this warning and see the appropriate new directories, set the environment variable `JUPYTER_PLATFORM_DIRS=1` and then run `jupyter --paths`. The use of platformdirs will be the default in `jupyter_core` v6 from .paths import (
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html ============================= slowest 10 durations ============================= 0.45s call tests/test_sign.py::TestNotary::test_sign_stdin 0.04s call tests/test_validator.py::test_future[fastjsonschema] 0.03s call tests/test_api.py::TestAPI::test_read 0.03s call tests/test_validator.py::test_nb2[jsonschema] 0.03s call tests/test_api.py::TestAPI::test_capture_validation_error 0.02s call tests/test_validator.py::test_nb4jupyter_metadata_timings[fastjsonschema] 0.02s call tests/test_validator.py::test_nb4custom[fastjsonschema] 0.02s call tests/test_validator.py::test_future[jsonschema] 0.02s call tests/test_validator.py::test_invalid_validator_raises_value_error_after_read 0.01s call tests/test_validator.py::test_nb3[jsonschema] =========================== short test summary info ============================ XPASS tests/test_validator.py::test_should_not_mutate[fastjsonschema] In the future we want to stop warning, and raise an error XPASS tests/test_validator.py::test_should_not_mutate[jsonschema] In the future we want to stop warning, and raise an error FAILED tests/test_sign.py::TestNotary::test_check_signature - DeprecationWarning: The default datetime adapter is deprecated as of Python... FAILED tests/test_sign.py::TestNotary::test_cull_db - DeprecationWarning: The default datetime adapter is deprecated as of Python... FAILED tests/test_sign.py::TestNotary::test_invalid_db_file - DeprecationWarning: The default datetime adapter is deprecated as of Python... FAILED tests/test_sign.py::TestNotary::test_sign - DeprecationWarning: The default datetime adapter is deprecated as of Python... FAILED tests/test_sign.py::TestNotary::test_unsign - DeprecationWarning: The default datetime adapter is deprecated as of Python... FAILED tests/test_sign.py::SQLiteSignatureStoreTests::test_basics - DeprecationWarning: The default datetime adapter is deprecated as of Python... ============= 6 failed, 180 passed, 2 xpassed, 1 warning in 1.37s ==============
https://github.com/python/cpython/issues/90016 https://docs.python.org/3.12/whatsnew/3.12.html
For the build logs, see: https://copr-be.cloud.fedoraproject.org/results/@python/python3.12/fedora-ra...
For all our attempts to build python-nbformat with Python 3.12, see: https://copr.fedorainfracloud.org/coprs/g/python/python3.12/package/python-n...
Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.12: https://copr.fedorainfracloud.org/coprs/g/python/python3.12/
Let us know here if you have any questions.
Python 3.12 is planned to be included in Fedora 39. To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.12. A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon. We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.
Referenced Bugs:
https://bugzilla.redhat.com/show_bug.cgi?id=2135404 [Bug 2135404] Python 3.12
https://bugzilla.redhat.com/show_bug.cgi?id=2196518
Orion Poplawski orion@nwra.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed In Version| |python-nbformat-5.8.0-1.fc3 | |9 Resolution|--- |RAWHIDE Status|NEW |CLOSED Last Closed| |2023-05-29 00:05:25
epel-packagers-sig@lists.fedoraproject.org