Skip to content

Commit

Permalink
Switch to english
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-cty committed Feb 8, 2022
1 parent 549ffe6 commit cd24655
Showing 1 changed file with 21 additions and 33 deletions.
54 changes: 21 additions & 33 deletions .conda/README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,30 @@
# Publication vers Anaconda
# Publish to conda

Ce readme décrit la partie publication vers conda, pour utiliser le paquet conda résultant, voir [le readme principal](https://github.com/openfisca/openfisca-survey-manager/tree/publish-to-conda#installez-un-environnement-virtuel-avec-conda).
There is two systems to publish to conda:
- A fully automatic CI that publish to an _openfisca_ channel. See below for more information.
- A more complex in Conda-Forge CI, that publish to _Conda-Forge_ channel. See https://www.youtube.com/watch?v=N2XwK9BkJpA for an introduction to Conda-Forge. We do not use it for this project.

Pour envoyer un paquet vers conda il faut obligatoirement un fichier `meta.yaml` qui décrit le package.
## Automatic upload

Nous avons fait le choix d'utiliser le paquet PyPi comme source du paquet Conda, pour s'assurer que l'on publie bien la même chose sur les deux plateformes.
The CI automaticaly build the conda from the PyPi package, and upload it to [anaconda.org](https://anaconda.org/search?q=openfisca) see the `.github/workflow/workflow.yml`, step `publish-to-conda`.

L'upload automatique est fait de la façon suivante par la CI uniquement si l'étape de livraison sur PyPi s'est bien déroulée :
- Installation de Miniconda.
- Récupération par le script `.github/get_pypi_info.py` des informations du package sur PyPi.
- Ecriture de ces informations par ce même script dans le fichier `.conda/meta.yaml`.
- Exécution de `conda build` pour construire et publier le paquet conformément au fichier `.conda/meta.yaml`. Cette étape nécessite la variable de CI ANACONDA_TOKEN.
## Manual actions made to make it works the first time

Pour valider que tout a fonctionné, une étape `test-on-windows` a été ajoutée en fin de CI. Cette étape récupère le paquet conda sur une machine Windows et exécute les tests.
- Create an account on https://anaconda.org.
- Create a token on https://anaconda.org/openfisca/settings/access with _Allow write access to the API site_. Warning, it expire on 2023/01/13.
- Put the token in a CI env variable ANACONDA_TOKEN.

**A noter** : Le paquet OpenFisca-Survey-Manager est aussi publié sur `conda-forge`, pour cela voir [le feedstock](https://github.com/openfisca/openfisca-survey-manager-feedstock/tree/master/recipe)
## Manual actions before CI exist

C'est le channel `conda-forge` qui est le channel stable à conseiller aux utilisateurs. Le channel `openfisca` reçoit les derniers paquets de façon automatique.
To create the package you can do the following in the project root folder:

## Etapes préparatoires pour arriver à cette automatisation
- Edit `.conda/meta.yaml` and update it if needed:
- Version number
- Hash SHA256
- Package URL on PyPi

- Création d'un compte sur https://anaconda.org.
- Création d'un token sur https://anaconda.org/openfisca/settings/access avec le droit _Allow write access to the API site_. Attention il expire le 2023/01/13.

- Mis en place du token dans GitHub Action sous le nom de variable ANACONDA_TOKEN.

### Publication manuelle du package

Les étapes suivantes peuvent être réalisées sous Windows pour tester la publication :

_Cela fonctionne aussi sous macOS et Linux, à condition d'adapter les chemins._

- Editer `.conda/meta.yaml` pour vérifier son contenu.
- Installer [MiniConda](https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html) si vous n'avez pas déjà [AnaConda](https://www.anaconda.com/products/individual).
- Puis dans le terminal saisissez les instructions suivantes :
- `conda install -c anaconda conda-build anaconda-client` Pour installer les outils indispensable.
- `conda build --croot c:\temp .conda` L'option `--croot ` est nécessaire sous Windows à cause des chemins trop long.
- `conda install -c anaconda anaconda-client` Pour installer l'outil en ligne de commande.
- `anaconda login` Pour vous connecter avec le compte _openfisca_, voir le Keepass OpenFisca.
- `anaconda upload c:\temp\noarch\openfisca-survey-manager-<VERSION>-py_0.tar.bz2` pour publier le package.
- Vérifier que tout c'est bien passé sur https://anaconda.org/search?q=openfisca.
- Build & Upload package:
- `conda install -c anaconda conda-build anaconda-client`
- `conda build .conda`
- `anaconda login`
- `anaconda upload openfisca-core-<VERSION>-py_0.tar.bz2`

0 comments on commit cd24655

Please sign in to comment.