Skip to content
Snippets Groups Projects
Commit 9b3ba167 authored by Corné Lukken's avatar Corné Lukken
Browse files

Adress review comments

parent cccbd309
No related branches found
No related tags found
1 merge request!10Add pre commit improve tox setup
Pipeline #114820 passed
Pipeline: Python Binary Wheel Package

#114826

    Pipeline: Python Binary Wheel Package

    #114821

      # https://pre-commit.com/
      default_stages: [ pre-commit, pre-push ] default_stages: [ pre-commit, pre-push ]
      default_language_version: default_language_version:
      python: python3 python: python3
      ......
      ...@@ -6,9 +6,6 @@ set( ...@@ -6,9 +6,6 @@ set(
      "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-extra-utils/cmake" "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake-extra-utils/cmake"
      ) )
      set(LARGEFILE_SOURCE)
      set(FILE_OFFSET_BITS 64)
      # Include script # Include script
      include(DynamicVersion) include(DynamicVersion)
      dynamic_version( dynamic_version(
      ......
      FROM python:3.13 FROM python:3.13
      RUN python -m pip install --upgrade cibuildwheel==2.23.0 pip tox twine RUN python -m pip install --upgrade pip
      RUN python -m pip install --upgrade cibuildwheel==2.23.0 tox twine
      RUN curl -sSL https://get.docker.com/ | sh RUN curl -sSL https://get.docker.com/ | sh
      ARG BUILD_ENV=no_copy ARG BUILD_ENV=no_copy
      # Build without copying from host inside docker
      FROM python:3.13 AS build_no_copy FROM python:3.13 AS build_no_copy
      ADD ../../requirements.txt . ADD ../../requirements.txt .
      COPY ../.. /work COPY ../.. /work
      ...@@ -8,11 +9,15 @@ RUN python -m pip install --user tox ...@@ -8,11 +9,15 @@ RUN python -m pip install --user tox
      WORKDIR /work WORKDIR /work
      RUN python -m tox -e build RUN python -m tox -e build
      # Copy build package from host `dist` directory
      FROM python:3.13 AS build_copy FROM python:3.13 AS build_copy
      COPY dist /work/dist COPY dist /work/dist
      # Dynamically set `build` from `build_no_copy` or `build_copy` depending on
      # `BUILD_ENV` argument
      FROM build_${BUILD_ENV} AS build FROM build_${BUILD_ENV} AS build
      # Copy build stage files into final python slim image and install
      FROM python:3.13-slim FROM python:3.13-slim
      COPY --from=build /work/dist /dist COPY --from=build /work/dist /dist
      RUN python -m pip install /dist/*.whl RUN python -m pip install /dist/*.whl
      ...@@ -3,6 +3,10 @@ ...@@ -3,6 +3,10 @@
      # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy) # Copyright (C) 2023 ASTRON (Netherlands Institute for Radio Astronomy)
      # SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
      """
      Remove generated source documentation files except for index.rst
      """
      import os import os
      file_dir = os.path.dirname(os.path.realpath(__file__)) file_dir = os.path.dirname(os.path.realpath(__file__))
      ......
      ...@@ -5,7 +5,9 @@ ...@@ -5,7 +5,9 @@
      # #
      # This file's directory is used to determine the station control directory # This file's directory is used to determine the station control directory
      # location. # location. We substitute BASH_SOURCE if it doesn't get set, this particularly
      # happens when sourcing using the `docker` docker image due to its primitive
      # shell.
      if [ -z ${BASH_SOURCE} ]; then if [ -z ${BASH_SOURCE} ]; then
      BASH_SOURCE=${(%):-%x} BASH_SOURCE=${(%):-%x}
      fi fi
      ......
      0% Loading or .
      You are about to add 0 people to the discussion. Proceed with caution.
      Please register or to comment