-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (41 loc) · 1.61 KB
/
python-package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: Build Python Package
on:
push:
branches: [ "**" ]
tags-ignore: [ "**" ]
jobs:
build-package:
runs-on: ubuntu-latest
steps:
# 1. Initialize the build
# -------------------------------------------------------------------------------------------
- name: Checkout
uses: actions/checkout@v4
# Without this option, we don't get the tag information
with:
fetch-depth: 0
- name: Initialise the build system
run: |
chmod u+x $GITHUB_WORKSPACE/build/bin/*.sh
$GITHUB_WORKSPACE/build/bin/initbuild.sh
source $GITHUB_WORKSPACE/build/bin/.functions.sh
# 2. Python Package Build
# -------------------------------------------------------------------------------------------
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Build the Python package
run: |
sed -i "s#__version__ = \"100.0.0\"#__version__ = \"${{ env.VERSION_NOPREREL }}\"#g" ${GITHUB_WORKSPACE}/src/mas/devops/__init__.py
cat ${GITHUB_WORKSPACE}/src/mas/devops/__init__.py
python -m pip install --upgrade pip
pip install .[dev]
# There are no tests yet
# pytest
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 src --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings.
flake8 src --count --exit-zero --max-complexity=10 --max-line-length=200 --statistics