Skip to content

Commit

Permalink
Merge pull request #81 from rok4/develop
Browse files Browse the repository at this point in the history
Release 2.1.0
  • Loading branch information
Dolite authored Jan 31, 2024
2 parents b4281db + ccab122 commit 79b5df6
Show file tree
Hide file tree
Showing 23 changed files with 302 additions and 189 deletions.
88 changes: 29 additions & 59 deletions .github/workflows/build-and-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down Expand Up @@ -83,8 +83,8 @@ jobs:
if: "! contains(github.ref_name,'b') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'"
run: |
source .venv/bin/activate
coverage html -d dist/tests/
rm dist/tests/.gitignore
coverage html -d target/docs/tests/
rm target/docs/tests/.gitignore
- name: Build package
if: "matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'"
Expand All @@ -97,18 +97,38 @@ jobs:
run: |
source .venv/bin/activate
pip install -e .[doc]
pdoc3 --html --output-dir dist/ rok4
cp README.md CHANGELOG.md dist/
- name: Upload packages, tests results and documentation
pdoc3 --html --output-dir target/docs/ rok4
cp docs/mkdocs.yml target/mkdocs.yml
cp -r docs/overrides target/
cp docs/unit-tests.md target/docs/unit-tests.md
cp docs/documentation.md target/docs/documentation.md
cp docs/README.hdr.md target/docs/README.md
cp docs/CHANGELOG.hdr.md target/docs/CHANGELOG.md
cp docs/CONTRIBUTING.hdr.md target/docs/CONTRIBUTING.md
sed "s#x.y.z#${{ github.ref_name }}#g" README.md >>target/docs/README.md
cat CHANGELOG.md >>target/docs/CHANGELOG.md
cat CONTRIBUTING.md >>target/docs/CONTRIBUTING.md
- name: Upload packages
if: "matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'"
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: dist-py3
path: dist/
if-no-files-found: error
retention-days: 1

- name: Publish documentation
if: "! contains(github.ref_name,'b') && matrix.os == 'ubuntu-20.04' && matrix.python-version == '3.8'"
run: |
source .venv/bin/activate
pip install -r docs/requirements.txt
git config user.name github-actions
git config user.email [email protected]
cd target/
mike deploy --push --update-aliases --branch gh-pages -t "Version ${{ github.ref_name }}" ${{ github.ref_name }} latest
mike set-default --push --branch gh-pages ${{ github.ref_name }}
publish_artefacts:
name: Add built artefacts to release and PyPI
needs: [create_release, build_and_test]
Expand All @@ -117,7 +137,7 @@ jobs:

steps:

- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: dist-py3
path: dist/
Expand Down Expand Up @@ -155,56 +175,6 @@ jobs:
password: ${{ secrets.PYPI_API_TOKEN }}
packages_dir: to_publish/

commit_documentation:
name: Add documentation and unit tests results into gh-pages branch
needs: build_and_test
if: "always() && ! contains(github.ref_name,'b') && needs.create_release.outputs.job_status == 'success' && needs.build_and_test.outputs.job_status == 'success'"
runs-on: ubuntu-latest

steps:

- name: Checkout project on gh-pages
uses: actions/checkout@v4
with:
ref: 'gh-pages'
token: ${{ secrets.GITHUB_TOKEN }}

- uses: actions/download-artifact@v3
with:
name: dist-py3
path: artifact/

- name: Copy version elements to final location
run: |
mkdir -p docs/versions/${{ github.ref_name }}
cp -r artifact/rok4 docs/versions/${{ github.ref_name }}/
cp -r artifact/tests docs/versions/${{ github.ref_name }}/
- name: Add pages from templates
run: |
sed "s#__version__#${{ github.ref_name }}#" templates/mkdocs.template.yml >mkdocs.yml
sed "s#__version__#${{ github.ref_name }}#" templates/unit-tests.template.md >docs/versions/${{ github.ref_name }}/unit-tests.md
sed "s#__version__#${{ github.ref_name }}#" templates/documentation.template.md >docs/versions/${{ github.ref_name }}/documentation.md
sed "s#__version__#${{ github.ref_name }}#" templates/index-version.template.md >docs/versions/${{ github.ref_name }}/index.md
cat artifact/README.md >>docs/versions/${{ github.ref_name }}/index.md
sed -i "s#x.y.z#${{ github.ref_name }}#g" docs/versions/${{ github.ref_name }}/index.md
cp templates/index-versions.template.md docs/versions/index.md
sed "s/^## \(.*\)$/## \1 \n\n[➔ Lien vers la documentation](\1\/index.md) /" artifact/CHANGELOG.md >>docs/versions/index.md
sed "s#__version__#${{ github.ref_name }}#" templates/latest.template.html >docs/versions/latest/index.html
rm -r artifact
- name: Publish on gh-pages branch
run: |
git config user.name github-actions
git config user.email [email protected]
git add -v docs/versions/${{ github.ref_name }}/ docs/versions/latest/ docs/versions/index.md mkdocs.yml
git commit -m "Add documentation for version ${{ github.ref_name }}"
git push
delete_version:
name: Remove release and tag if error occured
needs: build_and_test
Expand Down
67 changes: 0 additions & 67 deletions .github/workflows/build-docs.yaml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/pr-auto-labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ jobs:
triage:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
- uses: actions/labeler@v5
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
## 2.1.0

### [Added]

* Pyramid
* Ajout de fonctions pour récupérer la tile_limits et le nombre de canaux de cette pyramide
* Ajout de fonctions pour ajouter ou supprimer des niveaux dans une pyramide
* TileMatrixSet
* Ajout de fonctions pour récupérer la hauteur et la largeur de tuiles d'un TileMatrixSet

### [Changed]

* Pyramid
* Ajout d'un paramètre optionnel "mask" pour le constructeur from other afin de pouvoir conserver ou non les masques de la pyramide servant de base à la nouvellle
* Gestion des documentations des différentes versions avec l'outil [mike](https://github.com/jimporter/mike)

## 2.0.1

### [Added]
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ except Exception as exc:

Plus d'exemple dans la documentation développeur.


## Contribuer

* Installer les dépendances de développement :

```sh
python3 -m pip install -e .[dev]
pre-commit install
```

* Consulter les [directives de contribution](./CONTRIBUTING.md)
Expand All @@ -46,7 +48,7 @@ apt install python3-venv python3-rados python3-gdal
python3 -m venv .venv
source .venv/bin/activate
python3 -m pip install --upgrade build bump2version
bump2version --allow-dirty --current-version 0.0.0 --new-version x.y.z patch pyproject.toml src/rok4/__init__.py
bump2version --current-version 0.0.0 --new-version x.y.z patch
# Run unit tests
python3 -m pip install -e .[test]
Expand Down
4 changes: 4 additions & 0 deletions docs/CHANGELOG.hdr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
hide:
- navigation
---
4 changes: 4 additions & 0 deletions docs/CONTRIBUTING.hdr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
hide:
- navigation
---
4 changes: 4 additions & 0 deletions docs/README.hdr.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
hide:
- navigation
---
9 changes: 9 additions & 0 deletions docs/documentation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
hide:
- navigation
- toc
---

# Documentation technique

<iframe src="../rok4/index.html"></iframe>
28 changes: 28 additions & 0 deletions docs/mkdocs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
site_name: "Projet ROK4 - Librairies python"
site_url: https://rok4.github.io/core-python

nav:
- Accueil: README.md
- Documentation technique: documentation.md
- Rapport des tests unitaires: unit-tests.md
- Historique des versions: CHANGELOG.md
- Contribuer: CONTRIBUTING.md

theme:
logo: https://rok4.github.io/assets/images/rok4-carre.png
favicon: https://rok4.github.io/assets/images/rok4-carre.png
name: material
features:
- navigation.tabs
- navigation.tabs.sticky
language: fr
custom_dir: overrides

extra_css:
- https://rok4.github.io/assets/css/commun.css

extra:
homepage: https://rok4.github.io
version:
provider: mike
default: latest
8 changes: 8 additions & 0 deletions docs/overrides/main.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{% extends "base.html" %}

{% block outdated %}
🚨 Vous êtes sur la documentation d'une ancienne version. 🚨
<a href="{{ '../' ~ base_url }}">
<strong>Cliquez ici pour aller sur la dernière version.</strong>
</a>
{% endblock %}
3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
mkdocs
mkdocs-material
mike
9 changes: 9 additions & 0 deletions docs/unit-tests.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
hide:
- navigation
- toc
---

# Rapport des tests unitaires

<iframe src="../tests/index.html"></iframe>
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ test = [
[project.urls]
"Homepage" = "https://rok4.github.io/core-python"
"Bug Reports" = "https://github.com/rok4/core-python/issues"
"Changelog" = "https://rok4.github.io/core-python/versions/"
"Changelog" = "https://rok4.github.io/core-python/latest/CHANGELOG/"
"Source" = "https://github.com/rok4/core-python"

[build-system]
Expand Down
Loading

0 comments on commit 79b5df6

Please sign in to comment.