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

Adapte le dépôt à python 3.6 #71

Merged
merged 15 commits into from
Aug 26, 2018
Merged

Adapte le dépôt à python 3.6 #71

merged 15 commits into from
Aug 26, 2018

Conversation

sandcha
Copy link
Contributor

@sandcha sandcha commented Aug 18, 2018

Fixes #69

Adapte openfisca-tunisia à python 3.6.

Etapes de migration :

  • Mise à jour de la dépendance Core à une version compatible python 3.6 (Core v23+)
  • Remplacement des appels à Holder.formula (Core v23)
  • Mise à jour de la configuration CircleCi pour compatibilité python 2.7 et 3.6 (et scripts associés)
  • Mise à jour pour type unicode : ur > r pour regex
  • Mise à jour pour type unicode : unicode(...)> openfisca_core.commons.to_unicode(...)
  • Mise à jour de print "truc" > print("truc")
  • Mise à jour pour type dict : dict.keys() > list(dict.keys())

Mais dict.keys() est suffisant pour tester l'appartenance d'une clef avec in

  • Mise à jour pour type dict : dict.iteritems() > dict.items()
  • Mise à jour pour type dict : dict.values()[0] > next(iter(dict.values()))
  • Emploi d'imports absolus
  • Mise à jour des IOError attributs message > strerror
  • [ ] Suppression des encoding = 'utf-8' de json.dumps(...)

Et :

  • Suppression des scripts/ du module openfisca_tunisia.
  • Mise à jour du tag nb du Makefile pour permettre l'exécution du notebook en place de son test.

@sandcha sandcha requested a review from benjello August 24, 2018 23:24
@sandcha sandcha changed the title [WIP] Adapte le dépôt à python 3.6 Adapte le dépôt à python 3.6 Aug 24, 2018
Copy link
Member

@benjello benjello left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice work !
All clear and neat

@sandcha
Copy link
Contributor Author

sandcha commented Aug 26, 2018

Merci @benjello !
C'était aussi pour avoir une checklist qui nous aiderait dans la mise à jour d'autres dépôts.

En mémo, existent également :

  • cheat sheet sur un code compatible python 2 & 3
  • outils automatiques comme 2to3 (mais rétro-compatibilité à vérifier)
    ou futurize (plus récent ?)

@sandcha sandcha merged commit e1d8370 into master Aug 26, 2018
@sandcha sandcha deleted the to-python3-69 branch August 26, 2018 10:18
@benjello
Copy link
Member

Merci @sandcha ! Pour info, on va faire cette transition à l'IPP après le PLF donc à partir de fin octobre, début novembre.

@sandcha sandcha mentioned this pull request Nov 12, 2019
5 tasks
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.

2 participants