deprecations: forbid import of new python expressions (#72093) #1212

Merged
lguerin merged 6 commits from wip/72093-depreciation-python-import into main 2024-03-15 16:34:28 +01:00
Owner
No description provided.
lguerin force-pushed wip/72093-depreciation-python-import from 4f5757d06e to 96bb7badc0 2024-03-04 15:42:41 +01:00 Compare
lguerin force-pushed wip/72093-depreciation-python-import from 96bb7badc0 to d92038ca7f 2024-03-04 15:54:41 +01:00 Compare
lguerin changed title from WIP: deprecations: forbid import of new python expressions (#72093) to deprecations: forbid import of new python expressions (#72093) 2024-03-04 16:48:13 +01:00
lguerin changed title from deprecations: forbid import of new python expressions (#72093) to WIP: deprecations: forbid import of new python expressions (#72093) 2024-03-04 16:50:23 +01:00
lguerin force-pushed wip/72093-depreciation-python-import from 222654daa1 to 95695b477a 2024-03-04 17:02:53 +01:00 Compare
lguerin changed title from WIP: deprecations: forbid import of new python expressions (#72093) to deprecations: forbid import of new python expressions (#72093) 2024-03-04 17:03:29 +01:00
Author
Owner

0001: refacto, une méthode de check par type d'objet
0002: refacto encore, une méthode qui sera aussi utilisée à l'étape d'après
0003: le dev, pouvoir au load d'un objet, détecter les expressions python
0004: des tests en plus pour les imports, gestion des erreurs d'import pour les datasources et les wscalls
0005: rien, du bruit, un test qui échouait d'un coup
0006: renommage de DeprecationsScanAfterJob en DeprecationsScan

0001: refacto, une méthode de check par type d'objet 0002: refacto encore, une méthode qui sera aussi utilisée à l'étape d'après 0003: le dev, pouvoir au load d'un objet, détecter les expressions python 0004: des tests en plus pour les imports, gestion des erreurs d'import pour les datasources et les wscalls 0005: rien, du bruit, un test qui échouait d'un coup 0006: renommage de DeprecationsScanAfterJob en DeprecationsScan
lguerin changed title from deprecations: forbid import of new python expressions (#72093) to WIP: deprecations: forbid import of new python expressions (#72093) 2024-03-04 17:09:01 +01:00
lguerin force-pushed wip/72093-depreciation-python-import from 95695b477a to 0e97ed446f 2024-03-04 17:24:02 +01:00 Compare
lguerin force-pushed wip/72093-depreciation-python-import from 0e97ed446f to 90239faf44 2024-03-04 17:30:05 +01:00 Compare
lguerin reviewed 2024-03-04 17:31:39 +01:00
@ -429,0 +442,4 @@
if error:
self.status = 'failed'
self.failure_label = str(_('Error: %s') % error)
Author
Owner

ce label n'est pas renvoyé actuellement par le endpoint json (et donc non exploité par hobo)

ce label n'est pas renvoyé actuellement par le endpoint json (et donc non exploité par hobo)
@ -402,1 +416,4 @@
)
def check_deprecated_elements_in_object(self, obj):
if not get_publisher().has_site_option('forbid-new-python-expressions'):
Author
Owner

si pas d'option, return, pas la peine de perdre du temps à parcourir l'objet

si pas d'option, return, pas la peine de perdre du temps à parcourir l'objet
wcs/publisher.py Outdated
@ -337,0 +350,4 @@
with z.open(f) as fd:
wscall = NamedWsCall.import_from_xml(fd, include_id=True)
wscall.store()
results['wscalls'] += 1
Author
Owner

pour passer sur les dépréciations, sinon on faisait juste une bête copie du fichier

pour passer sur les dépréciations, sinon on faisait juste une bête copie du fichier
@ -32,3 +32,3 @@
fd.seek(0)
if first_byte == b'<':
return cls.import_from_xml(fd, include_id=True)
return cls.import_from_xml(fd, include_id=True, check_deprecated=False)
Author
Owner

ne pas checker les dépréciations lorsqu'on charge un objet depuis sa définition xml stockée sur l'instance

ne pas checker les dépréciations lorsqu'on charge un objet depuis sa définition xml stockée sur l'instance
lguerin force-pushed wip/72093-depreciation-python-import from 90239faf44 to f2d7e13fec 2024-03-04 17:34:55 +01:00 Compare
lguerin force-pushed wip/72093-depreciation-python-import from f2d7e13fec to 17e6323f0e 2024-03-04 17:46:09 +01:00 Compare
lguerin changed title from WIP: deprecations: forbid import of new python expressions (#72093) to deprecations: forbid import of new python expressions (#72093) 2024-03-04 17:52:33 +01:00
fpeters approved these changes 2024-03-15 15:24:31 +01:00
fpeters left a comment
Owner

Il y a le rebase après toute l'indentation de api_export_import.py qui a changé mais je note déjà que c'est ok.

Il y a le rebase après toute l'indentation de api_export_import.py qui a changé mais je note déjà que c'est ok.
lguerin force-pushed wip/72093-depreciation-python-import from 17e6323f0e to 0f1afa505e 2024-03-15 16:10:08 +01:00 Compare
lguerin merged commit 3477ee2f29 into main 2024-03-15 16:34:28 +01:00
lguerin deleted branch wip/72093-depreciation-python-import 2024-03-15 16:34:29 +01:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: entrouvert/wcs#1212
No description provided.