Skip to content
Snippets Groups Projects

feat(python): template jobs to build and upload source and wheel packages

Merged Daniel Dehennin requested to merge feature/python-ci-templates into dev
+ 12
15
@@ -16,7 +16,7 @@
# =====
#
# include:
# - project: baby-gnu/ci-tools
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
@@ -38,7 +38,7 @@
#
# - `PYTHON_BLACK_OPTS`: additional options to pass to `black`
#
# - `PYTHON_BLACK_DIR`: top level directory where to run `black`,
# - `PYTHON_SOURCE_DIR`: top level directory where to run `black`,
# defaults to `.`
#
# - `PYTHON_BLACK_IMAGE`: name of the black docker image to use
@@ -50,7 +50,7 @@
variables:
PYTHON_BLACK_IMAGE: "hub.eole.education/proxyhub/pyfound/black:latest_release"
PYTHON_BLACK_OPTS: ''
PYTHON_BLACK_DIR: '.'
PYTHON_SOURCE_DIR: '.'
script:
- echo -e "\e[0Ksection_start:`date +%s`:python-black\r\e[0KExecute 'black --check ${PYTHON_BLACK_OPTS} ${PYTHON_BLACK_DIR}'"
- black --check ${PYTHON_BLACK_OPTS} ${PYTHON_BLACK_DIR}
@@ -67,7 +67,7 @@
# =====
#
# include:
# - project: baby-gnu/ci-tools
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
@@ -82,7 +82,7 @@
# - a `build` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need
#
# - the `.not-on-stable` rules templates
# - the `.on-release-tag` rules templates
#
# - a `setup.py` file
#
@@ -101,9 +101,7 @@
#
.python:build:sdist:
stage: build
extends:
- .not-on-stable
- .python:base
extends: .python:base
variables:
PYTHON_DIST_FILES: dist/*.tar.gz
artifacts:
@@ -126,7 +124,7 @@
# =====
#
# include:
# - project: baby-gnu/ci-tools
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
@@ -141,7 +139,7 @@
# - a `build` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need
#
# - the `.not-on-stable` rules templates
# - the `.on-release-tag` rules templates
#
# - a `setup.py` file
#
@@ -179,7 +177,7 @@
# =====
#
# include:
# - project: baby-gnu/ci-tools
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
@@ -194,7 +192,7 @@
# - a `build` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need
#
# - the `.not-on-stable` rules templates
# - the `.on-release-tag` rules templates
#
# OPTIONAL VARIABLES
# ==================
@@ -211,9 +209,7 @@
#
.python:upload:
stage: release
extends:
- .not-on-stable
- .python:base
extends: .python:base
variables:
PYTHON_REPOSITORY_URL: ${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/pypi
script:
@@ -235,6 +231,7 @@
# Base template for build and upload
#
.python:base:
extends: .on-release-tag
image: "${PYTHON_IMAGE}"
variables:
PYTHON_IMAGE: "hub.eole.education/proxyhub/library/python:latest"
Loading