Development #40570
Tourner les tests aussi en python3
0%
Description
Dans l'optique de passer bijoe en python3.
Demandes liées
Révisions associées
python3: remove print from setup.py (#40570)
python3: use force_text on subprocess output (#40570)
python3: replace execfile by exec function (#40570)
python3: replace unicode type (#40570)
python3: avoid slots conflicts with class variable (#40570)
python3: import ConfigParser from six (#40570)
python3: import urlparse from six (#40570)
python3: upgrade func_code core object to code (#40570)
python3: replace iteritems by items method (#40570)
python3: adapt relative import (#40570)
python3: encode unicode-objects before hashing (#40570)
python3: decode psycopg mogrified values (#40570)
python3: provide string representations (#40570)
python3: replace floor division operator (#40570)
python3: python3: replace itervalues by values method (#40570)
python3: upgrade signature.py (#40570)
misc: call parent's init in SchemaJSONDimension (#41814)
Broken by:
9a4d84a python3: avoid slots conflicts with class variable (#40570)
Historique
Mis à jour par Nicolas Roche il y a environ 4 ans
Voici la branche avec les 15 patchs : http://git.entrouvert.org/bijoe.git/log/?h=wip/40570-run-python3-tests-too
Mis à jour par Frédéric Péters il y a environ 4 ans
Pour les modifications au setup.py, mieux vaut prendre ce qui se fait ailleurs. (particulièrement, ne pas dépendre de django).
Pour les modifications concernant bijoe/visualization/signature.py, pareil, je regarderais (ex: combo/utils/signature.py) (comme le fichier est juste couvert à 18%, c'est sûr qu'il y a des bugs).
python3: replace execfile by exec function (#40570)
Attention il y a aussi des execfile() sous debian/.
python3: replace unicode type to six.text_type (#40570)
Perso je ne suis pas fan de l'utilisation de six.text_type(...), j'y préfère force_text.
python3: provide string representations (#40570)
J'utiliserais plutôt @python_2_unicode_compatible. (parce que là tu te mets à retourner de l'unicode dans "__str__" et ce n'est pas ce que Python 2 espère).
Mis à jour par Nicolas Roche il y a environ 4 ans
Merci, pour la relecture.
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=4f230b4ad73267f4ef4036af0c25cf36dce83967
En m'inspirant de wcs/setup.py
Et sinon, j'ai laissé les prints, comme dans authentic/setup.py :def run(self): print("creating VERSION file")
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=96d647615163fc50bee198b35955a92b23242953
- Mise en conformité de la fonction
sign_string()
avec combo/utils/signature.py, avec notamment l'appel àsmart_bytes(key)
- J'ai laissé (et comblé un oubli)
force_bytes
dans les appels viahashlib
, ex:- django/contrib/auth/hashers.py:
hash = hashlib.sha1(force_bytes(salt + password)).hexdigest()
- wcs/qommon/templatetags/qommon.py:
return hashlib.md5(force_bytes(get_vc_version())).hexdigest()
- django/contrib/auth/hashers.py:
- Mise en conformité de la fonction
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=b40b0b9be8b97316cf09852b5cb30f1bc597b20b
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=b2796919d38daeaeca9c9d9f13f078f6d6267d65
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=ce85b715fa252b26cf13bfe2a294be0ce4fb74cf
Mis à jour par Nicolas Roche il y a environ 4 ans
- Lié à Development #40699: Tourner en python3 ajouté
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
Nicolas Roche a écrit :
Merci, pour la relecture.
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=4f230b4ad73267f4ef4036af0c25cf36dce83967
En m'inspirant de wcs/setup.py
Et sinon, j'ai laissé les prints, comme dans authentic/setup.py :
Tu peux les virer, ils vont dégager dans authentic aussi.
[...]
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=96d647615163fc50bee198b35955a92b23242953
- Mise en conformité de la fonction
sign_string()
avec combo/utils/signature.py, avec notamment l'appel àsmart_bytes(key)
Je pense que le mieux serait de prendre le fichier tel quel si ce n'est pas déjà le cas.
Mis à jour par Nicolas Roche il y a environ 4 ans
print
du setup.py et ajouté 2 commits concernant la mises à jours mises des signatures (mis en évidence par #40664 : tests ajoutés sur la signature des requêtes).
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=513601d53c1afc32f3afb8d639d01f781d98f1c6
- http://git.entrouvert.org/bijoe.git/commit/?h=wip/40570-run-python3-tests-too&id=4596d26efd4a0f094206e6097e45631e2bce7a16
Je ne l'ai pas fait parce qu'il y a, dans la version actuellement sur bijoe, plus de gestion d'exceptions.Je pense que le mieux serait de prendre le fichier tel quel si ce n'est pas déjà le cas.
Si je devais le faire, tu préférerais que je me base sur laquelle des 4 briques qui le fournissent également ? Hobo, qui n'est pas encore migré en python3 ?
- combo/utils/signature.py
- hobo/signature.py
- passerelle/base/signature.py
- wcs_olap/signature.py
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
Nicolas Roche a écrit :
Je pense que le mieux serait de prendre le fichier tel quel si ce n'est pas déjà le cas.
Je ne l'ai pas fait parce qu'il y a, dans la version actuellement sur bijoe, plus de gestion d'exceptions.
Ok je ne savais pas, oublions, ce sera pour un autre ticket.
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
python3: decode psycopg mogrified values (#40570)
Je préfèrerai que le force_text() soit toujours autour de cursor.mogrify() pour bien voir que ça vient de là.
Mis à jour par Benjamin Dauvergne il y a environ 4 ans
- Statut changé de Solution proposée à Solution validée
Ok pour moi.
Mis à jour par Nicolas Roche il y a environ 4 ans
- Statut changé de Solution validée à Résolu (à déployer)
commit f4e12c2b6e55c790c7af2914607b2fc4e2ed1441 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Fri Mar 13 09:59:25 2020 +0100 python3: upgrade signature.py (#40570) commit 3936d0e4e8d81011cfb078b389ecdb85b493ae68 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Fri Mar 13 09:58:07 2020 +0100 python3: python3: replace itervalues by values method (#40570) commit d2acdfc2e9892190c65e93e914af4a96043310b7 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Tue Mar 10 18:08:50 2020 +0100 python3: replace floor division operator (#40570) commit ca7d09f583a8ee720a5ce09271fa5600beb348be Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Tue Mar 10 15:22:55 2020 +0100 python3: provide string representations (#40570) commit 34685564ad74baf990c023ac5d0a528c8ded05b7 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Tue Mar 10 18:38:28 2020 +0100 python3: decode psycopg mogrified values (#40570) commit f987c27631dc8bbdeae1460338284892044d108c Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Tue Mar 10 11:13:22 2020 +0100 python3: encode unicode-objects before hashing (#40570) commit 3214b296bc3eb7ae040a366fe7943ef37063e76d Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:47:33 2020 +0100 python3: adapt relative import (#40570) commit a6d0bc47a5caea4cfa2c90747dd7ed6c715bcd0e Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:44:33 2020 +0100 python3: replace iteritems by items method (#40570) commit 21484832f288a73eaabf64ea47d50f6b189dd342 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:42:15 2020 +0100 python3: upgrade func_code core object to __code__ (#40570) commit cb22af6cb29ffc23b556cb5217b47996f0de204b Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:37:01 2020 +0100 python3: import urlparse from six (#40570) commit 909cb3f650d5808c6b18b9adf7a6fe5d72ec27de Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:33:26 2020 +0100 python3: import ConfigParser from six (#40570) commit 9a4d84aba0951595a67e8b5742401734229e7b33 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 17:24:41 2020 +0100 python3: avoid __slots__ conflicts with class variable (#40570) commit 8a9769eb4dc3306bdca8d3a1c21736088dfad780 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 16:59:37 2020 +0100 python3: replace unicode type (#40570) commit 45c0a44e89aeb3c9dae894900272d669b609923a Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 16:49:28 2020 +0100 python3: replace execfile by exec function (#40570) commit e43606f8237fb6422581a00a8dd8d99dfe899439 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 16:46:45 2020 +0100 python3: use force_text on subprocess output (#40570) commit 4a795f3186773f5a821a908b573b7c836c335a10 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 16:40:52 2020 +0100 python3: remove print from setup.py (#40570) commit eadd66615b8f30fd5f0854c83c7c857447201c98 Author: Nicolas ROCHE <nroche@entrouvert.com> Date: Mon Mar 9 16:23:37 2020 +0100 tests: adapt tox.ini to run tests in python3 too (#40570)
Mis à jour par Frédéric Péters il y a environ 4 ans
- Statut changé de Résolu (à déployer) à Solution déployée
tests: adapt tox.ini to run tests in python3 too (#40570)