Skip to content

Commit

Permalink
Merge branch 'prusa3d:master' into m27_autoreport
Browse files Browse the repository at this point in the history
  • Loading branch information
bkerler authored Apr 28, 2024
2 parents 2c7b318 + 2425c11 commit ad61522
Show file tree
Hide file tree
Showing 11 changed files with 84 additions and 70 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@ repos:
entry: python utils/logging/generate_overview.py
language: python
language_version: python3
- id: python3-requirements
name: python3-requirements
description: Check if requirements.txt matches the buildsystem.
entry: 'utils/check-requirements.py'
language: script
files: requirements\.txt$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: 'v2.4.0'
hooks:
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ include(ExternalProject)
include(cmake/Utilities.cmake)
include(cmake/GetGitRevisionDescription.cmake)
include(cmake/ProjectVersion.cmake)
include(cmake/CheckRemotes.cmake)
include(cmake/Littlefs.cmake)
include(cmake/Options.cmake)

Expand Down
6 changes: 0 additions & 6 deletions Dockerfile

This file was deleted.

47 changes: 0 additions & 47 deletions cmake/CheckRemotes.cmake

This file was deleted.

18 changes: 9 additions & 9 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
pip~=23.0
aiohttp~=3.8
click~=8.1.3
easyocr~=1.7
ecdsa~=0.18
polib~=1.2
pyyaml~=6.0
littlefs-python==0.8
numpy~=1.26.4
pillow~=9.5
qoi~=0.5.0
click~=8.1.3
pytest~=7.3.2
pytest-asyncio~=0.21
easyocr~=1.7
aiohttp~=3.8
pip~=23.0
polib~=1.2
pre-commit
pytest-asyncio~=0.21
pytest~=7.3.2
pyyaml~=6.0
qoi~=0.5.0
10 changes: 8 additions & 2 deletions utils/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,11 @@ def main():
action='store_true',
help='Do not build, configure the build only.'
)
parser.add_argument(
'--skip-bootstrap',
action='store_true',
help='Skip bootstrap, useful if dependencies are already installed.'
)
parser.add_argument(
'--no-store-output',
dest='store_output',
Expand Down Expand Up @@ -789,8 +794,9 @@ def main():
CMakePresetsGenerator.generate(configurations)
sys.exit(0)

# check all dependencis are installed
bootstrap.bootstrap()
if not args.skip_bootstrap:
# check all dependencis are installed
bootstrap.bootstrap()

# build everything
results: Dict[BuildConfiguration, BuildResult] = dict()
Expand Down
32 changes: 32 additions & 0 deletions utils/check-requirements.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#!/usr/bin/env python3

import sys
import itertools


def get_lines(path):
with open(path, 'r') as file:
return file.readlines()


def main():
try:
expected_lines = sorted(
itertools.chain(get_lines('utils/holly/build-requirements.txt'),
get_lines('utils/holly/heavy-requirements.txt')))
actual_lines = get_lines('requirements.txt')

if actual_lines == expected_lines:
return 0
else:
with open('requirements.txt', 'w') as file:
file.writelines(expected_lines)
return 1

except Exception as ex:
print(ex)
return 1


if __name__ == '__main__':
sys.exit(main())
5 changes: 2 additions & 3 deletions utils/holly/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
FROM ubuntu:22.04
RUN apt-get clean && \
apt-get update -qq -y && \
apt-get install git curl python3 python3-pip python3-venv libncurses5 g++-multilib -y
apt-get install git python3 python3-pip python3-venv -y
WORKDIR /work
ADD utils/bootstrap.py utils/bootstrap.py
ADD utils/debug/10_custom_config_template.cfg utils/debug/10_custom_config_template.cfg
ADD requirements.txt requirements.txt
ADD utils/debug utils/debug
ADD utils/holly/build-requirements.txt requirements.txt
RUN python3 utils/bootstrap.py && (cd .dependencies && find . -type f -executable | xargs chmod +x) && rm -rf utils
15 changes: 13 additions & 2 deletions utils/holly/build-pr.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ pipeline {

stages {
stage('Create Git Tag') {
when {
expression {
return env.GIT_URL == '[email protected]:prusa3d/Prusa-Firmware-Buddy-Private.git';
}
}
agent any
steps {
script {
Expand Down Expand Up @@ -94,10 +99,9 @@ pipeline {
sh """
ln -fs /work/.dependencies
ln -fs /work/.venv
. .venv/bin/activate

export XDG_CACHE_HOME=\$PWD/.precommit
. .venv/bin/activate
python3 utils/bootstrap.py
git config --unset-all core.hooksPath
pre-commit install
pre-commit run \
Expand Down Expand Up @@ -176,6 +180,7 @@ pipeline {
export GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no"
ln -fs /work/.dependencies
ln -fs /work/.venv
. .venv/bin/activate
rm -rf build
python3 utils/build.py \
--preset ${config.preset} \
Expand All @@ -184,6 +189,7 @@ pipeline {
--generate-bbf \
--generate-dfu \
--no-store-output \
--skip-bootstrap \
--version-suffix=${version.suffix_full} \
--version-suffix-short=${version.suffix_short} \
-DCUSTOM_COMPILE_OPTIONS:STRING="-Werror" \
Expand Down Expand Up @@ -245,6 +251,11 @@ pipeline {
}

stage('Integration Tests') {
when {
expression {
return env.GIT_URL == '[email protected]:prusa3d/Prusa-Firmware-Buddy-Private.git';
}
}
agent {
dockerfile {
label 'integrationtests'
Expand Down
9 changes: 9 additions & 0 deletions utils/holly/build-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
ecdsa~=0.18
littlefs-python==0.8
pillow~=9.5
pip~=23.0
polib~=1.2
pre-commit
pytest~=7.3.2
pyyaml~=6.0
qoi~=0.5.0
5 changes: 5 additions & 0 deletions utils/holly/heavy-requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
aiohttp~=3.8
click~=8.1.3
easyocr~=1.7
numpy~=1.26.4
pytest-asyncio~=0.21

0 comments on commit ad61522

Please sign in to comment.