Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3-Babel: update to 2.12.1. #43497

Merged
merged 1 commit into from Apr 28, 2023
Merged

Conversation

tornaria
Copy link
Contributor

Testing the changes

  • I tested the changes in this PR: briefly

Using sphinx with current version of python3-Babel gives the following deprecation warning :

$ python -Wonce -c 'import sphinx.application'
/usr/lib/python3.11/site-packages/babel/messages/catalog.py:13: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  from cgi import parse_header

The update fixes this. I had to include python-babel/babel#998 so tests pass, since it only touches test code I think its safe to include.

I found this while doctesting sagemath. A bunch of tests fail because of this deprecation warning, and after this update everything passes.

Cc: @sgn, since this affects python3-Sphinx.

@tornaria
Copy link
Contributor Author

ping @sgn @ahesford

@tornaria
Copy link
Contributor Author

For the record: pytz is no longer a dependency, if not installed zoneinfo will be used. However, there is some subtle discrepancy in behaviour between the two which causes a couple of test failures (reported upstream: python-babel/babel#988 (comment)).

Since this is not just test failures but an actual change of behaviour, I'd propose to keep pytz as a dependency for consistent behaviour while this is sorted out upstream.

@sgn
Copy link
Member

sgn commented Apr 25, 2023

I would argue that the new behaviour is more correct :D

Anyway, this could fix the test:

diff --git a/srcpkgs/python3-Babel/template b/srcpkgs/python3-Babel/template
index 46530ba596e..9255e8537f4 100644
--- a/srcpkgs/python3-Babel/template
+++ b/srcpkgs/python3-Babel/template
@@ -4,8 +4,7 @@ version=2.12.1
 revision=1
 build_style=python3-module
 hostmakedepends="python3-setuptools"
-depends="python3-pytz"
-checkdepends="python3-pytest python3-pytz python3-freezegun"
+checkdepends="python3-pytest python3-freezegun faketime"
 short_desc="Tools for internationalizing Python applications (Python3)"
 maintainer="Orphaned <orphan@voidlinux.org>"
 license="BSD-3-Clause"
@@ -14,6 +13,14 @@ changelog="https://raw.githubusercontent.com/python-babel/babel/master/CHANGES.r
 distfiles="${PYPI_SITE}/B/Babel/Babel-${version}.tar.gz"
 checksum=cc2d99999cd01d44420ae725a21c9e3711b3aadc7976d6147f622d8581963455
 
+do_check() {
+	# If you see this is hanging, remove faketime
+	# it has problem with python's time.sleep
+	LD_PRELOAD=/usr/lib/faketime/libfaketime.so.1 \
+		FAKETIME="@2023-01-01 00:00:00" \
+		python3 -m pytest
+}
+
 post_install() {
 	vlicense LICENSE
 	# for compatibility

The 998 patch is no longer needed, too.
http://ix.io/4ugi

@tornaria
Copy link
Contributor Author

Done, thanks.

@tornaria
Copy link
Contributor Author

@sgn: anything in particular holding this back?

I would like to merge #43225 which needs (and includes) this PR.

@sgn sgn merged commit cc324cc into void-linux:master Apr 28, 2023
8 checks passed
@tornaria tornaria deleted the python3-Babel branch April 28, 2023 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants