From 6a699a481ca2c6861fc67db0a5cd88ed33bbb0a1 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 19 Nov 2024 20:04:36 +0100 Subject: [PATCH] Setup python and make --- .forgejo/workflows/check.yml | 19 ++++++++++++------- Makefile | 10 ++++++++-- config/master.cfg | 3 --- config/setup.py | 2 +- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/.forgejo/workflows/check.yml b/.forgejo/workflows/check.yml index 8f68941..ad1950e 100644 --- a/.forgejo/workflows/check.yml +++ b/.forgejo/workflows/check.yml @@ -1,14 +1,19 @@ name: Run checks -on: [ push, pull_request ] +on: + pull_request: + branches: + - main jobs: checks: - runs-on: docker + runs-on: ubuntu-24.04 env: DIRECTORY: config steps: - uses: actions/checkout@v4 - - run: cd ${{ env.DIRECTORY }} - - run: pip install -r requirements-dev.txt - - run: ruff check - - run: ruff format - - run: myp \ No newline at end of file + - run: lsb_release -a + - run: uname -srm + - uses: actions/setup-python@v5 + with: + python-version: '3.13' + - run: pip install -r requirements.txt + - run: make check \ No newline at end of file diff --git a/Makefile b/Makefile index cc95b6a..4d8df3d 100644 --- a/Makefile +++ b/Makefile @@ -12,5 +12,11 @@ setup: ## Create Python virtualenv and install dependencies @if [ ! -d .venv ]; then python3 -m venv .venv; fi @if [ -d .venv ]; then . .venv/bin/activate && pip3 install -r requirements.txt; fi -check: ## Run linter, formatter and typechecks - ruff check && ruff format && mypy config/master.cfg \ No newline at end of file +check: ## Check linting, formatting and types + ruff check + ruff format --check + mypy config/master.cfg + +format: ## Autofix linting and formatting issues + ruff check --fix + ruff format \ No newline at end of file diff --git a/config/master.cfg b/config/master.cfg index 8d4475a..b1e1d40 100644 --- a/config/master.cfg +++ b/config/master.cfg @@ -3,9 +3,6 @@ import importlib import os import sys - -sys.path.insert(0, os.path.expanduser("~/git/blender-devops/buildbot")) - import setup importlib.reload(setup) BuildmasterConfig = setup.setup() diff --git a/config/setup.py b/config/setup.py index a4fdb9e..661c973 100644 --- a/config/setup.py +++ b/config/setup.py @@ -36,7 +36,7 @@ devops_host_id = os.environ.get("DEVOPS_HOST_ID", default="localhost") def setup() -> Dict[str, Any]: - ####### MAIN CONFIGURATION + ####### MAIN - configuration c = {} # Change Source