Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CI tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
EOLE
Infra
CI tools
Commits
1ee7498b
Commit
1ee7498b
authored
2 years ago
by
Daniel Dehennin
Browse files
Options
Downloads
Patches
Plain Diff
feat(python): build source distribution package
parent
4c9f0456
No related branches found
Branches containing commit
No related tags found
Tags containing commit
3 merge requests
!47
Publish new release
,
!46
Prepare new release
,
!45
feat(python): template jobs to build and upload source and wheel packages
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
templates/Python.yaml
+73
-0
73 additions, 0 deletions
templates/Python.yaml
with
73 additions
and
0 deletions
templates/Python.yaml
+
73
−
0
View file @
1ee7498b
...
...
@@ -55,4 +55,77 @@
-
echo -e "\e[0Ksection_start:`date +%s`:python-black\r\e[0KExecute 'black --check ${PYTHON_BLACK_OPTS} ${PYTHON_SOURCE_DIR}'"
-
black --check ${PYTHON_BLACK_OPTS} ${PYTHON_SOURCE_DIR}
-
echo -e "\e[0Ksection_end:`date +%s`:python-black\r\e[0K"
#
# .python:build:sdist
# ===================
#
# Build the python source `.tar.gz`
#
# USAGE
# =====
#
# include:
# - project: EOLE/Infra/ci-tools
# ref: stable
# file: /templates/Python.yaml
#
# stages:
# - build
#
# python:build:source {extends: '.python:build:sdist'}
#
# REQUIREMENTS
# ============
#
# - a `build` stage must be present in your pipeline or it must be
# overriden by the extending job to feet your need
#
# - the `.on-release-tag` rules templates
#
# - a `setup.py` file
#
# OPTIONAL VARIABLES
# ==================
#
# - `PYTHON_DIST_FILES`: files to upload, defaults to `dist/*.tar.gz'
#
# - `PYTHON_SOURCE_DIR`: top level directory of python source where to
# find `setup.py`, defaults to `.'
#
# - `PYTHON_OPTS`: additional options to pass to the python command
# line
#
# - `PYTHON_IMAGE`: name of the python docker image to use
#
.python:build:sdist
:
stage
:
build
extends
:
.python:base
variables
:
PYTHON_DIST_FILES
:
dist/*.tar.gz
artifacts
:
paths
:
-
${PYTHON_SOURCE_DIR}/${PYTHON_DIST_FILES}
script
:
-
echo -e "\e[0Ksection_start:`date +%s`:python-build-sdist\r\e[0KBuild source distribution from '${PYTHON_SOURCE_DIR}'"
-
cd ${PYTHON_SOURCE_DIR}
-
python setup.py sdist ${PYTHON_OPTS}
-
echo -e "\e[0Ksection_end:`date +%s`:python-build-sdist\r\e[0K"
#
# .python:base
# ============
#
# 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"
PYTHON_OPTS
:
'
'
PYTHON_SOURCE_DIR
:
'
.'
PYTHON_DIST_FILES
:
'
dist/*'
...
This diff is collapsed.
Click to expand it.
Ghost User
@ghost
mentioned in commit
1880d428
·
2 years ago
mentioned in commit
1880d428
mentioned in commit 1880d42821c7e091cddf6f2977d9458af0ca4246
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment