Skip to content
Snippets Groups Projects
Commit 320149ea authored by Françoise Conil's avatar Françoise Conil
Browse files

Présentation du versionning de code Python

Cette présentation ne décrit pas toutes les étapes du packaging
d'application mais en couvre un aspect.
parents
No related branches found
No related tags found
No related merge requests found
# Environments
.venv
venv/
# IDE specific
*~
/.quarto/
project:
title: "versionner-un-code-python"
/*-- https://quarto.org/docs/presentations/revealjs/themes.html --*/
/*-- https://quarto.org/docs/presentations/revealjs/themes.html#sass-variables --*/
/*-- scss:defaults --*/
$font-family-sans-serif: "Lucida Grande", sans-serif;
$presentation-font-size-root: 20pt;
/*-- scss:rules --*/
.reveal .slides div.sourceCode {
margin: 0.75em 0;
}
.reveal .slides table {
font-size: 16pt;
}
images/git-tag-cpython.png

160 KiB

images/python-version-identifiers.png

19.9 KiB

#!/bin/bash
quarto render versionner-un-code-python.qmd --output-dir=slides
---
title: "Versionner un code Python"
author: "Françoise CONIL"
format:
revealjs:
theme: [solarized, custom.scss]
slide-number: true
show-slide-number: all
code-line-numbers: false
link-external-newwindow: true
---
## Présentation
Quelles sont les différentes étapes et quels sont les choix possibles pour
versionner son code Python ?
::: {.callout-warning title="ATTENTION"}
Cette présentation ne décrit pas toutes les étapes nécessaires au packaging
d'une application.
:::
## Python package version
La structure d'un **identifiant de version Python**, spécifiée par la PEP 440
^[[PEP 440 - Version Identification and Dependency Specification](https://peps.python.org/pep-0440/)],
est la suivante ^[Informations et illustrations extraites de l'article [What is a Python package version?](https://sethmlarson.dev/pep-440#v-prefixes) de [Seth Michael
Larson](https://sethmlarson.dev/) sous licence [waiting for license choice](https://creativecommons.org/share-your-work/cclicenses/)] :
![](images/python-version-identifiers.png){height="120"}
Les versions ne sont pas de simples chaînes de caractères, elles sont
[normalisées](https://peps.python.org/pep-0440/#normalization) afin de pouvoir
être comparées à l'aide de la [classe Version](https://packaging.pypa.io/en/latest/version.html)
```python
>>> from packaging.version import Version, parse
>>> v1 = parse("1.0a5")
>>> v2 = Version("v1.0")
>>> v1
<Version('1.0a5')>
>>> v2
<Version('1.0')>
>>> v1 < v2
True
```
## Description des éléments de l'identifiant
- un éventuel préfixe
## SemVer : Semantic Versioning
[SemVer : Semantic Versioning](https://semver.org/)
## CalVer : Calendar Versioning
[CalVer : Calendar Versioning](https://calver.org/)
## Logiciel de gestion de version
Un [logiciel de gestion de versions](https://fr.wikipedia.org/wiki/Logiciel_de_gestion_de_versions)
(ou VCS en anglais, pour version control system) est un logiciel qui permet de
stocker un ensemble de fichiers en conservant la chronologie de toutes les
modifications qui ont été effectuées dessus.
[git](http://git-scm.com/book/) est le gestionnaire de version décentralisé le
plus répandu actuellement avec l'utilisation de forges logicielles internes
^[[GitLab CNRS](https://src.koda.cnrs.fr/), [GitLab INRIA](https://gitlab.inria.fr/), ...]
ou externes à nos structures ^[[GitHub](https://github.com/), [GitLab](https://gitlab.com/),
[Framagit](https://framagit.org/public/projects)...].
## git tag
![](images/git-tag-cpython.png){.border .border-thick height="200"}
- [Git Book - Tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging)
- [Git Book - Maintaining a Project](https://git-scm.com/book/en/v2/Distributed-Git-Maintaining-a-Project), Tagging Your Releases
- [git ready - tagging](https://gitready.com/beginner/2009/02/03/tagging.html)
- Annotated Tags
- Lightweight Tags
## GitHub - Managing releases in a repository
[Managing releases in a repository](https://docs.github.com/en/repositories/releasing-projects-on-github/managing-releases-in-a-repository)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment