diff --git a/.github/actions/install-subpackage/action.yml b/.github/actions/install-subpackage/action.yml new file mode 100644 index 0000000..b784a71 --- /dev/null +++ b/.github/actions/install-subpackage/action.yml @@ -0,0 +1,48 @@ +name: Install subpackage + +description: Set up a conda environment and install a package with its selected extras + +inputs: + subproject: + description: Repository-relative package directory + required: true + conda-dependencies: + description: Space-separated additional conda package specifications + required: false + default: biomass-bps::arepyextras-runner + local-dependencies: + description: Space-separated editable dependency paths relative to the subproject + required: false + default: "" + package-extras: + description: Package extras to install + required: true + +runs: + using: composite + steps: + - uses: conda-incubator/setup-miniconda@v4 + with: + miniforge-version: latest + activate-environment: bps-software + python-version: "3.14" + - name: Install dependencies and package + shell: bash -el {0} + working-directory: ${{ inputs.subproject }} + env: + CONDA_DEPENDENCIES: ${{ inputs.conda-dependencies }} + LOCAL_DEPENDENCIES: ${{ inputs.local-dependencies }} + PACKAGE_EXTRAS: ${{ inputs.package-extras }} + run: | + set -eo pipefail + read -r -a conda_deps <<< "$CONDA_DEPENDENCIES" + conda install --yes -c conda-forge gdal=3.13.3 "${conda_deps[@]}" + read -r -a local_deps <<< "$LOCAL_DEPENDENCIES" + pip_args=() + for dependency in "${local_deps[@]}"; do + pip_args+=(-e "$dependency") + done + if (( ${#pip_args[@]} )); then + python -m pip install "${pip_args[@]}" + fi + python -m pip install -e ".[${PACKAGE_EXTRAS}]" diff --git a/.github/workflows/bps-common.yml b/.github/workflows/bps-common.yml new file mode 100644 index 0000000..afae39b --- /dev/null +++ b/.github/workflows/bps-common.yml @@ -0,0 +1,34 @@ +name: bps-common CI + +on: + push: + branches: + - "**" + tags: + - "bps-v*" + paths: + - "bps-common/**" + - ".github/workflows/bps-common.yml" + - ".github/workflows/python-package-reusable.yml" + - ".github/actions/install-subpackage/action.yml" + - "ruff.toml" + - "scripts/fawltydeps.toml" + pull_request: + paths: + - "bps-common/**" + - ".github/workflows/bps-common.yml" + - ".github/workflows/python-package-reusable.yml" + - ".github/actions/install-subpackage/action.yml" + - "ruff.toml" + - "scripts/fawltydeps.toml" + workflow_dispatch: + +permissions: + contents: read + +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-common + source-path: bps/common diff --git a/.github/workflows/bps-l1_core_processor.yml b/.github/workflows/bps-l1_core_processor.yml new file mode 100644 index 0000000..2d3e7d8 --- /dev/null +++ b/.github/workflows/bps-l1_core_processor.yml @@ -0,0 +1,36 @@ +name: bps-l1_core_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l1_core_processor/**", + "bps-common/**", + ".github/workflows/bps-l1_core_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l1_core_processor/**", + "bps-common/**", + ".github/workflows/bps-l1_core_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l1_core_processor + source-path: bps/l1_core_processor + local-dependencies: ../bps-common diff --git a/.github/workflows/bps-l1_framing_processor.yml b/.github/workflows/bps-l1_framing_processor.yml new file mode 100644 index 0000000..1f532e8 --- /dev/null +++ b/.github/workflows/bps-l1_framing_processor.yml @@ -0,0 +1,35 @@ +name: bps-l1_framing_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l1_framing_processor/**", + ".github/workflows/bps-l1_framing_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l1_framing_processor/**", + ".github/workflows/bps-l1_framing_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l1_framing_processor + source-path: bps/l1_framing_processor + local-dependencies: ../bps-common ../bps-transcoder + run-tests: false diff --git a/.github/workflows/bps-l1_geocoding_tool.yml b/.github/workflows/bps-l1_geocoding_tool.yml new file mode 100644 index 0000000..88da7af --- /dev/null +++ b/.github/workflows/bps-l1_geocoding_tool.yml @@ -0,0 +1,39 @@ +name: bps-l1_geocoding_tool CI +on: + push: + branches: ["**"] + tags: ["l1_geocoding_tool-v*"] + paths: + [ + "bps-l1_geocoding_tool/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l1_geocoding_tool.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l1_geocoding_tool/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l1_geocoding_tool.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l1_geocoding_tool + source-path: bps/l1_geocoding_tool + local-dependencies: ../bps-common ../bps-transcoder + conda-dependencies: biomass-bps::arepyextras-runner biomass-bps::arepyextras-copernicus_dem_extractor diff --git a/.github/workflows/bps-l1_pre_processor.yml b/.github/workflows/bps-l1_pre_processor.yml new file mode 100644 index 0000000..4a4d706 --- /dev/null +++ b/.github/workflows/bps-l1_pre_processor.yml @@ -0,0 +1,38 @@ +name: bps-l1_pre_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l1_pre_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l1_pre_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l1_pre_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l1_pre_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l1_pre_processor + source-path: bps/l1_pre_processor + local-dependencies: ../bps-common ../bps-transcoder diff --git a/.github/workflows/bps-l1_processor.yml b/.github/workflows/bps-l1_processor.yml new file mode 100644 index 0000000..72db473 --- /dev/null +++ b/.github/workflows/bps-l1_processor.yml @@ -0,0 +1,42 @@ +name: bps-l1_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l1_processor/**", + "bps-common/**", + "bps-transcoder/**", + "bps-l1_pre_processor/**", + "bps-l1_core_processor/**", + ".github/workflows/bps-l1_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l1_processor/**", + "bps-common/**", + "bps-transcoder/**", + "bps-l1_pre_processor/**", + "bps-l1_core_processor/**", + ".github/workflows/bps-l1_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l1_processor + source-path: bps/l1_processor + local-dependencies: ../bps-common ../bps-l1_pre_processor ../bps-l1_core_processor ../bps-transcoder diff --git a/.github/workflows/bps-l2a_processor.yml b/.github/workflows/bps-l2a_processor.yml new file mode 100644 index 0000000..32c6ba6 --- /dev/null +++ b/.github/workflows/bps-l2a_processor.yml @@ -0,0 +1,38 @@ +name: bps-l2a_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l2a_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2a_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l2a_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2a_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l2a_processor + source-path: bps/l2a_processor + local-dependencies: ../bps-common ../bps-transcoder diff --git a/.github/workflows/bps-l2b_agb_processor.yml b/.github/workflows/bps-l2b_agb_processor.yml new file mode 100644 index 0000000..0a1d755 --- /dev/null +++ b/.github/workflows/bps-l2b_agb_processor.yml @@ -0,0 +1,38 @@ +name: bps-l2b_agb_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l2b_agb_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_agb_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l2b_agb_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_agb_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l2b_agb_processor + source-path: bps/l2b_agb_processor + local-dependencies: ../bps-common ../bps-transcoder diff --git a/.github/workflows/bps-l2b_fd_processor.yml b/.github/workflows/bps-l2b_fd_processor.yml new file mode 100644 index 0000000..6bd5fdd --- /dev/null +++ b/.github/workflows/bps-l2b_fd_processor.yml @@ -0,0 +1,38 @@ +name: bps-l2b_fd_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l2b_fd_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_fd_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l2b_fd_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_fd_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l2b_fd_processor + source-path: bps/l2b_fd_processor + local-dependencies: ../bps-common ../bps-transcoder diff --git a/.github/workflows/bps-l2b_fh_processor.yml b/.github/workflows/bps-l2b_fh_processor.yml new file mode 100644 index 0000000..f88a791 --- /dev/null +++ b/.github/workflows/bps-l2b_fh_processor.yml @@ -0,0 +1,38 @@ +name: bps-l2b_fh_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-l2b_fh_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_fh_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-l2b_fh_processor/**", + "bps-common/**", + "bps-transcoder/**", + ".github/workflows/bps-l2b_fh_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-l2b_fh_processor + source-path: bps/l2b_fh_processor + local-dependencies: ../bps-common ../bps-transcoder diff --git a/.github/workflows/bps-stack_cal_processor.yml b/.github/workflows/bps-stack_cal_processor.yml new file mode 100644 index 0000000..2ac63d3 --- /dev/null +++ b/.github/workflows/bps-stack_cal_processor.yml @@ -0,0 +1,36 @@ +name: bps-stack_cal_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-stack_cal_processor/**", + "bps-common/**", + ".github/workflows/bps-stack_cal_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-stack_cal_processor/**", + "bps-common/**", + ".github/workflows/bps-stack_cal_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-stack_cal_processor + source-path: bps/stack_cal_processor + local-dependencies: ../bps-common diff --git a/.github/workflows/bps-stack_coreg_processor.yml b/.github/workflows/bps-stack_coreg_processor.yml new file mode 100644 index 0000000..09684f4 --- /dev/null +++ b/.github/workflows/bps-stack_coreg_processor.yml @@ -0,0 +1,38 @@ +name: bps-stack_coreg_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-stack_coreg_processor/**", + "bps-common/**", + "bps-stack_pre_processor/**", + ".github/workflows/bps-stack_coreg_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-stack_coreg_processor/**", + "bps-common/**", + "bps-stack_pre_processor/**", + ".github/workflows/bps-stack_coreg_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-stack_coreg_processor + source-path: bps/stack_coreg_processor + local-dependencies: ../bps-common ../bps-stack_pre_processor diff --git a/.github/workflows/bps-stack_pre_processor.yml b/.github/workflows/bps-stack_pre_processor.yml new file mode 100644 index 0000000..9de6d5f --- /dev/null +++ b/.github/workflows/bps-stack_pre_processor.yml @@ -0,0 +1,36 @@ +name: bps-stack_pre_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-stack_pre_processor/**", + "bps-common/**", + ".github/workflows/bps-stack_pre_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-stack_pre_processor/**", + "bps-common/**", + ".github/workflows/bps-stack_pre_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-stack_pre_processor + source-path: bps/stack_pre_processor + local-dependencies: ../bps-common diff --git a/.github/workflows/bps-stack_processor.yml b/.github/workflows/bps-stack_processor.yml new file mode 100644 index 0000000..75831a5 --- /dev/null +++ b/.github/workflows/bps-stack_processor.yml @@ -0,0 +1,35 @@ +name: bps-stack_processor CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-stack_processor/**", + ".github/workflows/bps-stack_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-stack_processor/**", + ".github/workflows/bps-stack_processor.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-stack_processor + source-path: bps/stack_processor + local-dependencies: ../bps-common ../bps-stack_pre_processor ../bps-stack_coreg_processor ../bps-stack_cal_processor ../bps-transcoder + run-tests: false diff --git a/.github/workflows/bps-transcoder.yml b/.github/workflows/bps-transcoder.yml new file mode 100644 index 0000000..f488f6a --- /dev/null +++ b/.github/workflows/bps-transcoder.yml @@ -0,0 +1,36 @@ +name: bps-transcoder CI +on: + push: + branches: ["**"] + tags: ["bps-v*"] + paths: + [ + "bps-transcoder/**", + "bps-common/**", + ".github/workflows/bps-transcoder.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + pull_request: + paths: + [ + "bps-transcoder/**", + "bps-common/**", + ".github/workflows/bps-transcoder.yml", + ".github/workflows/python-package-reusable.yml", + ".github/actions/install-subpackage/action.yml", + "ruff.toml", + "scripts/fawltydeps.toml", + ] + workflow_dispatch: +permissions: + contents: read +jobs: + ci: + uses: ./.github/workflows/python-package-reusable.yml + with: + subproject: bps-transcoder + source-path: bps/transcoder + local-dependencies: ../bps-common diff --git a/.github/workflows/python-package-reusable.yml b/.github/workflows/python-package-reusable.yml new file mode 100644 index 0000000..a21a775 --- /dev/null +++ b/.github/workflows/python-package-reusable.yml @@ -0,0 +1,127 @@ +name: Python package CI + +on: + workflow_call: + inputs: + subproject: + description: Repository-relative package directory + required: true + type: string + source-path: + description: Package source path relative to the subproject + required: true + type: string + conda-dependencies: + description: Space-separated additional conda package specifications + default: biomass-bps::arepyextras-runner + type: string + local-dependencies: + description: Space-separated editable dependency paths relative to the subproject + default: "" + type: string + run-tests: + description: Run the Linux unit tests + default: true + type: boolean + +permissions: + contents: read + +jobs: + ruff: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + - run: python -m pip install ruff==0.17.4 + - name: Check formatting and lint + working-directory: ${{ inputs.subproject }} + run: | + python -m ruff format --check . + python -m ruff check . + + pyrefly: + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/install-subpackage + with: + subproject: ${{ inputs.subproject }} + conda-dependencies: ${{ inputs.conda-dependencies }} + local-dependencies: ${{ inputs.local-dependencies }} + package-extras: dev + - name: Check types + working-directory: ${{ inputs.subproject }} + run: python -m pyrefly check + + fawlty-deps: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + - run: python -m pip install FawltyDeps + - name: Check dependencies + working-directory: ${{ inputs.subproject }} + run: python -m fawltydeps --code bps --detailed --config-file ../scripts/fawltydeps.toml + + unittest-linux: + if: inputs.run-tests + runs-on: ubuntu-latest + defaults: + run: + shell: bash -el {0} + steps: + - uses: actions/checkout@v6 + - uses: ./.github/actions/install-subpackage + with: + subproject: ${{ inputs.subproject }} + conda-dependencies: ${{ inputs.conda-dependencies }} + local-dependencies: ${{ inputs.local-dependencies }} + package-extras: test + - name: Run tests with coverage + working-directory: ${{ inputs.subproject }} + env: + SOURCE_PATH: ${{ inputs.source-path }} + run: | + set -eo pipefail + mkdir -p _build + python -m coverage run "--source=$SOURCE_PATH" -m xmlrunner --output-file _build/unittest-report-linux-py3.14.xml discover + python -m coverage report -m + python -m coverage xml -o _build/unittest-coverage-linux-py3.14.xml + - name: Upload test reports + if: always() + uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.subproject }}-test-reports + path: | + ${{ inputs.subproject }}/_build/unittest-report-*.xml + ${{ inputs.subproject }}/_build/unittest-coverage-*.xml + if-no-files-found: ignore + retention-days: 14 + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v6 + - uses: actions/setup-python@v6 + with: + python-version: "3.14" + - run: python -m pip install build + - name: Build distributions + working-directory: ${{ inputs.subproject }} + run: python -m build + - uses: actions/upload-artifact@v4 + with: + name: ${{ inputs.subproject }}-distributions + path: | + ${{ inputs.subproject }}/dist/*.tar.gz + ${{ inputs.subproject }}/dist/*.whl + if-no-files-found: error + retention-days: 14 \ No newline at end of file diff --git a/.gitlab-ci-common.yml b/.gitlab-ci-common.yml new file mode 100644 index 0000000..e79d190 --- /dev/null +++ b/.gitlab-ci-common.yml @@ -0,0 +1,127 @@ +variables: + GIT_DEPTH: 1 + PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" + +.tags_win10_conda: + tags: ["eo", "win10", "conda"] + +.tags_eo_deploy: + tags: ["eo", "deploy"] + +.enable_win10_unittest: + rules: + - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' + +.xsd_alignment: + stage: analysis + needs: [] + image: python:3.14-slim-bookworm + script: + - cd $SUBPROJECT + - python3.14 -m pip install nox + - python3.14 -m nox -s check_xsd + +.ruff: + stage: analysis + needs: [] + image: python:3.14-slim-bookworm + script: + - cd $SUBPROJECT + - python3.14 -m pip install ruff==0.17.4 + - python3.14 -m ruff format --check . + - python3.14 -m ruff check . + +.install_subpackage: + image: condaforge/miniforge3 + variables: + PYTHON: "3.14" + CONDA_ENV: env-$SUBPROJECT + before_script: + - cd $SUBPROJECT + - conda create --yes --name $CONDA_ENV python=${PYTHON} gdal=3.13.3 -c conda-forge + - set --; for dependency in ${LOCAL_DEPENDENCIES:-}; do set -- "$@" -e "$dependency"; done; if [ "$#" -gt 0 ]; then conda run --name $CONDA_ENV python -m pip install "$@"; fi + - conda run --name $CONDA_ENV python -m pip install -e ".[${PACKAGE_EXTRAS}]" + +.pyrefly: + stage: analysis + needs: [] + extends: .install_subpackage + variables: + PACKAGE_EXTRAS: dev + script: + - conda run --name $CONDA_ENV python -m pyrefly check + +.fawlty_deps: + stage: analysis + needs: [] + image: python:3.14-slim-bookworm + script: + - cd $SUBPROJECT + - python3.14 -m pip install FawltyDeps + - python3.14 -m fawltydeps --code bps --detailed --config-file ../scripts/fawltydeps.toml + +.build: + stage: build + needs: [] + image: python:3.14-slim-bookworm + script: + - cd $SUBPROJECT + - python3.14 -m pip install build + - python3.14 -m build + artifacts: + expire_in: 2 weeks + paths: + - $SUBPROJECT/dist/*.tar.gz + - $SUBPROJECT/dist/*.whl + +.deploy: + stage: deploy + extends: + - .tags_eo_deploy + rules: + - if: "$CI_COMMIT_TAG" + script: + - eval "$(ssh-agent -s)" + - for file in ${SUBPROJECT}/dist/*; do + eo_pgp-signme ${file} > ${file}.asc && + ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/${SUBPROJECT}/archive && + ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/${SUBPROJECT}/archive; + done + +.unittest_linux: + stage: test + needs: [] + extends: .install_subpackage + variables: + PACKAGE_EXTRAS: test + script: + - mkdir -p _build + - conda run --name $CONDA_ENV python -m coverage run "--source=$SOURCE_RELATIVE_PATH" -m xmlrunner --output-file _build/unittest-report-linux-py${PYTHON}.xml discover + - conda run --name $CONDA_ENV python -m coverage report -m + - conda run --name $CONDA_ENV python -m coverage xml -o _build/unittest-coverage-linux-py${PYTHON}.xml + artifacts: + reports: + junit: + - $SUBPROJECT/_build/unittest-report-*.xml + +.unittest_win10: + stage: test + needs: [] + extends: + - .tags_win10_conda + - .enable_win10_unittest + script: + - cd $SUBPROJECT + - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } + - conda create --yes --name unittest python=${PYTHON} gdal=3.13.3 -c conda-forge + - if ($env:LOCAL_DEPENDENCIES) { $pipArgs = @(); foreach ($dependency in ($env:LOCAL_DEPENDENCIES -split '\s+' | Where-Object { $_ })) { $pipArgs += '-e', $dependency }; if ($pipArgs.Count -gt 0) { conda run --name unittest python -m pip install @pipArgs; if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } } } + - conda run --name unittest python -m pip install -e '.[test]' + - New-Item -ItemType Directory -Force -Path _build | Out-Null + - conda run --name unittest python -m coverage run "--source=$env:SOURCE_RELATIVE_PATH" -m xmlrunner --output-file _build/unittest-report-win-py${PYTHON}.xml discover + - conda run --name unittest python -m coverage report -m + - conda run --name unittest python -m coverage xml -o _build/unittest-coverage-win-py${PYTHON}.xml + retry: 2 + artifacts: + reports: + junit: + - $SUBPROJECT/_build/unittest-report-*.xml diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index e66eaad..3042dbe 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -21,7 +21,6 @@ spec: default: false description: Propagate Windows unit test enablement to downstream project pipelines. --- - stages: - subproject - integration_tests @@ -44,7 +43,7 @@ variables: include: - project: "biomass/bps/ci-variables" ref: main - file: '/variables.yml' + file: "/variables.yml" - local: ".conda-packaging-ci.yml" - local: ".docker-ci.yml" - local: ".testplan-ci.yml" @@ -89,7 +88,7 @@ include: stage: subproject variables: SUBPROJECT: $CI_JOB_NAME - BPS_ENABLE_WIN10_UNITTEST: '$[[ inputs.bps-enable-win10-unittest ]]' + BPS_ENABLE_WIN10_UNITTEST: "$[[ inputs.bps-enable-win10-unittest ]]" trigger: strategy: mirror @@ -104,6 +103,7 @@ bps-common: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-common/* - bps-common/**/* @@ -118,6 +118,7 @@ bps-transcoder: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-transcoder/* - bps-transcoder/**/* @@ -132,6 +133,7 @@ bps-l1_framing_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l1_framing_processor/* - bps-l1_framing_processor/**/* @@ -146,6 +148,7 @@ bps-l1_pre_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l1_pre_processor/* - bps-l1_pre_processor/**/* @@ -160,6 +163,7 @@ bps-l1_core_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l1_core_processor/* - bps-l1_core_processor/**/* @@ -174,6 +178,7 @@ bps-l1_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l1_processor/* - bps-l1_processor/**/* @@ -188,6 +193,7 @@ bps-stack_pre_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-stack_pre_processor/* - bps-stack_pre_processor/**/* @@ -202,6 +208,7 @@ bps-stack_coreg_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-stack_coreg_processor/* - bps-stack_coreg_processor/**/* @@ -216,6 +223,7 @@ bps-stack_cal_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-stack_cal_processor/* - bps-stack_cal_processor/**/* @@ -230,6 +238,7 @@ bps-stack_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-stack_processor/* - bps-stack_processor/**/* @@ -244,6 +253,7 @@ bps-l2a_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l2a_processor/* - bps-l2a_processor/**/* @@ -258,6 +268,7 @@ bps-l2b_fd_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l2b_fd_processor/* - bps-l2b_fd_processor/**/* @@ -272,6 +283,7 @@ bps-l2b_fh_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l2b_fh_processor/* - bps-l2b_fh_processor/**/* @@ -286,6 +298,7 @@ bps-l2b_agb_processor: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l2b_agb_processor/* - bps-l2b_agb_processor/**/* @@ -300,6 +313,7 @@ bps-l1_geocoding_tool: - if: "$CI_COMMIT_TAG == null" changes: - .gitlab-ci.yml + - .gitlab-ci-common.yml - bps-l1_geocoding_tool/* - bps-l1_geocoding_tool/**/* diff --git a/bps-common/.gitlab-ci.yml b/bps-common/.gitlab-ci.yml index d4e8a85..956dfed 100644 --- a/bps-common/.gitlab-ci.yml +++ b/bps-common/.gitlab-ci.yml @@ -8,65 +8,20 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/common" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +29,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +36,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-common/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-common/archive; - done + extends: .deploy diff --git a/bps-common/noxfile.py b/bps-common/noxfile.py index c2572b5..61ace1c 100644 --- a/bps-common/noxfile.py +++ b/bps-common/noxfile.py @@ -2,15 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-common/pyproject.toml b/bps-common/pyproject.toml index 85d9655..3be6ecd 100644 --- a/bps-common/pyproject.toml +++ b/bps-common/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -45,3 +45,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l1_core_processor/.gitlab-ci.yml b/bps-l1_core_processor/.gitlab-ci.yml index b8858f6..785b6c1 100644 --- a/bps-l1_core_processor/.gitlab-ci.yml +++ b/bps-l1_core_processor/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l1_core_processor" + LOCAL_DEPENDENCIES: "../bps-common" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l1_core_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l1_core_processor/archive; - done + extends: .deploy diff --git a/bps-l1_core_processor/noxfile.py b/bps-l1_core_processor/noxfile.py index 9cc3e8b..61ace1c 100644 --- a/bps-l1_core_processor/noxfile.py +++ b/bps-l1_core_processor/noxfile.py @@ -2,17 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-l1_core_processor/pyproject.toml b/bps-l1_core_processor/pyproject.toml index beea354..2e5c933 100644 --- a/bps-l1_core_processor/pyproject.toml +++ b/bps-l1_core_processor/pyproject.toml @@ -22,7 +22,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -37,3 +37,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l1_framing_processor/.gitlab-ci.yml b/bps-l1_framing_processor/.gitlab-ci.yml index ef73e0d..6ea654e 100644 --- a/bps-l1_framing_processor/.gitlab-ci.yml +++ b/bps-l1_framing_processor/.gitlab-ci.yml @@ -8,70 +8,23 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - -.tags_manylinux2014: - tags: ["manylinux2014"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] +variables: + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +fawlty_deps: + extends: .fawlty_deps build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l1_framing_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l1_framing_processor/archive; - done + extends: .deploy diff --git a/bps-l1_framing_processor/noxfile.py b/bps-l1_framing_processor/noxfile.py index 521db43..61ace1c 100644 --- a/bps-l1_framing_processor/noxfile.py +++ b/bps-l1_framing_processor/noxfile.py @@ -2,20 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-transcoder", - ) - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-l1_framing_processor/pyproject.toml b/bps-l1_framing_processor/pyproject.toml index c10b159..6fe4531 100644 --- a/bps-l1_framing_processor/pyproject.toml +++ b/bps-l1_framing_processor/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ bps_l1_framing_processor = "bps.l1_framing_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -49,3 +49,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l1_geocoding_tool/.gitlab-ci.yml b/bps-l1_geocoding_tool/.gitlab-ci.yml index 2f69497..260ecb7 100644 --- a/bps-l1_geocoding_tool/.gitlab-ci.yml +++ b/bps-l1_geocoding_tool/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l1_geocoding_tool" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l1_geocoding_tool/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l1_geocoding_tool/archive; - done + extends: .deploy diff --git a/bps-l1_geocoding_tool/noxfile.py b/bps-l1_geocoding_tool/noxfile.py index 3810cf3..61ace1c 100644 --- a/bps-l1_geocoding_tool/noxfile.py +++ b/bps-l1_geocoding_tool/noxfile.py @@ -2,18 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common # pylint: disable=wrong-import-position - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend="mamba") -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common") - session.install("-e", "../bps-transcoder") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-l1_geocoding_tool/pyproject.toml b/bps-l1_geocoding_tool/pyproject.toml index dfc119f..1fca969 100644 --- a/bps-l1_geocoding_tool/pyproject.toml +++ b/bps-l1_geocoding_tool/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ bps_l1_geocoding_tool = "bps.l1_geocoding_tool.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -48,3 +48,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l1_pre_processor/.gitlab-ci.yml b/bps-l1_pre_processor/.gitlab-ci.yml index 46c8fe0..bb9b58f 100644 --- a/bps-l1_pre_processor/.gitlab-ci.yml +++ b/bps-l1_pre_processor/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l1_pre_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l1_pre_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l1_pre_processor/archive; - done + extends: .deploy diff --git a/bps-l1_pre_processor/noxfile.py b/bps-l1_pre_processor/noxfile.py index efffe28..61ace1c 100644 --- a/bps-l1_pre_processor/noxfile.py +++ b/bps-l1_pre_processor/noxfile.py @@ -2,17 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common", "-e", "../bps-transcoder") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-l1_pre_processor/pyproject.toml b/bps-l1_pre_processor/pyproject.toml index e579163..e5323a3 100644 --- a/bps-l1_pre_processor/pyproject.toml +++ b/bps-l1_pre_processor/pyproject.toml @@ -30,7 +30,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -45,3 +45,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l1_processor/.gitlab-ci.yml b/bps-l1_processor/.gitlab-ci.yml index 25398e5..a2a55f2 100644 --- a/bps-l1_processor/.gitlab-ci.yml +++ b/bps-l1_processor/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l1_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-l1_pre_processor ../bps-l1_core_processor ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l1_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l1_processor/archive; - done + extends: .deploy diff --git a/bps-l1_processor/noxfile.py b/bps-l1_processor/noxfile.py index bc4d9ce..4497971 100644 --- a/bps-l1_processor/noxfile.py +++ b/bps-l1_processor/noxfile.py @@ -8,25 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -def install_bps_dependencies(session: nox.Session): - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-l1_pre_processor", - "../bps-l1_core_processor", - "../bps-transcoder", - ) - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - install_bps_dependencies(session) - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pp1.xsd", "bio-common-types.xsd", diff --git a/bps-l1_processor/pyproject.toml b/bps-l1_processor/pyproject.toml index 56cbb14..3cae53f 100644 --- a/bps-l1_processor/pyproject.toml +++ b/bps-l1_processor/pyproject.toml @@ -40,7 +40,7 @@ classifiers = [ bps_l1_processor = "bps.l1_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -55,3 +55,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l2a_processor/.gitlab-ci.yml b/bps-l2a_processor/.gitlab-ci.yml index c6c5ff7..6de7e8f 100644 --- a/bps-l2a_processor/.gitlab-ci.yml +++ b/bps-l2a_processor/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l2a_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l2a_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l2a_processor/archive; - done + extends: .deploy diff --git a/bps-l2a_processor/noxfile.py b/bps-l2a_processor/noxfile.py index 5d4f162..5f336cd 100644 --- a/bps-l2a_processor/noxfile.py +++ b/bps-l2a_processor/noxfile.py @@ -8,23 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -def install_bps_dependencies(session: nox.Session): - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-transcoder", - ) - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - install_bps_dependencies(session) - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pp2_2a.xsd", "bio-common-types.xsd", diff --git a/bps-l2a_processor/pyproject.toml b/bps-l2a_processor/pyproject.toml index 3b90c35..405192b 100644 --- a/bps-l2a_processor/pyproject.toml +++ b/bps-l2a_processor/pyproject.toml @@ -38,7 +38,7 @@ classifiers = [ bps_l2a_processor = "bps.l2a_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -53,3 +53,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l2b_agb_processor/.gitlab-ci.yml b/bps-l2b_agb_processor/.gitlab-ci.yml index 2c2978a..87c122f 100644 --- a/bps-l2b_agb_processor/.gitlab-ci.yml +++ b/bps-l2b_agb_processor/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l2b_agb_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l2b_agb_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l2b_agb_processor/archive; - done + extends: .deploy diff --git a/bps-l2b_agb_processor/noxfile.py b/bps-l2b_agb_processor/noxfile.py index 6fc167f..be2f840 100644 --- a/bps-l2b_agb_processor/noxfile.py +++ b/bps-l2b_agb_processor/noxfile.py @@ -8,23 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -def install_bps_dependencies(session: nox.Session): - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-transcoder", - ) - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - install_bps_dependencies(session) - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pp2_ab.xsd", "bio-common-types.xsd", diff --git a/bps-l2b_agb_processor/pyproject.toml b/bps-l2b_agb_processor/pyproject.toml index 9d09419..6e0ccf7 100644 --- a/bps-l2b_agb_processor/pyproject.toml +++ b/bps-l2b_agb_processor/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ bps_l2b_agb_processor = "bps.l2b_agb_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -49,3 +49,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l2b_fd_processor/.gitlab-ci.yml b/bps-l2b_fd_processor/.gitlab-ci.yml index 963e470..d0ba53a 100644 --- a/bps-l2b_fd_processor/.gitlab-ci.yml +++ b/bps-l2b_fd_processor/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l2b_fd_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l2b_fd_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l2b_fd_processor/archive; - done + extends: .deploy diff --git a/bps-l2b_fd_processor/noxfile.py b/bps-l2b_fd_processor/noxfile.py index d649c99..a32552a 100644 --- a/bps-l2b_fd_processor/noxfile.py +++ b/bps-l2b_fd_processor/noxfile.py @@ -8,23 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -def install_bps_dependencies(session: nox.Session): - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-transcoder", - ) - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - install_bps_dependencies(session) - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pp2_fd.xsd", "bio-common-types.xsd", diff --git a/bps-l2b_fd_processor/pyproject.toml b/bps-l2b_fd_processor/pyproject.toml index 05804dd..bdb75ad 100644 --- a/bps-l2b_fd_processor/pyproject.toml +++ b/bps-l2b_fd_processor/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ bps_l2b_fd_processor = "bps.l2b_fd_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -48,3 +48,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-l2b_fh_processor/.gitlab-ci.yml b/bps-l2b_fh_processor/.gitlab-ci.yml index bb36fcd..bbab8af 100644 --- a/bps-l2b_fh_processor/.gitlab-ci.yml +++ b/bps-l2b_fh_processor/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/l2b_fh_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-l2b_fh_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-l2b_fh_processor/archive; - done + extends: .deploy diff --git a/bps-l2b_fh_processor/noxfile.py b/bps-l2b_fh_processor/noxfile.py index 5501eab..2835700 100644 --- a/bps-l2b_fh_processor/noxfile.py +++ b/bps-l2b_fh_processor/noxfile.py @@ -8,23 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -def install_bps_dependencies(session: nox.Session): - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-transcoder", - ) - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - install_bps_dependencies(session) - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pp2_fh.xsd", "bio-common-types.xsd", diff --git a/bps-l2b_fh_processor/pyproject.toml b/bps-l2b_fh_processor/pyproject.toml index 2a39868..bedb9d7 100644 --- a/bps-l2b_fh_processor/pyproject.toml +++ b/bps-l2b_fh_processor/pyproject.toml @@ -33,7 +33,7 @@ classifiers = [ bps_l2b_fh_processor = "bps.l2b_fh_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -48,3 +48,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-stack_cal_processor/.gitlab-ci.yml b/bps-stack_cal_processor/.gitlab-ci.yml index 0e233b5..ea8d201 100644 --- a/bps-stack_cal_processor/.gitlab-ci.yml +++ b/bps-stack_cal_processor/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/stack_cal_processor" + LOCAL_DEPENDENCIES: "../bps-common" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-stack_cal_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-stack_cal_processor/archive; - done + extends: .deploy diff --git a/bps-stack_cal_processor/noxfile.py b/bps-stack_cal_processor/noxfile.py index 9cc3e8b..61ace1c 100644 --- a/bps-stack_cal_processor/noxfile.py +++ b/bps-stack_cal_processor/noxfile.py @@ -2,17 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-stack_cal_processor/pyproject.toml b/bps-stack_cal_processor/pyproject.toml index 574c11f..96c9006 100644 --- a/bps-stack_cal_processor/pyproject.toml +++ b/bps-stack_cal_processor/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -46,3 +46,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-stack_coreg_processor/.gitlab-ci.yml b/bps-stack_coreg_processor/.gitlab-ci.yml index 26a7ed8..e5fb049 100644 --- a/bps-stack_coreg_processor/.gitlab-ci.yml +++ b/bps-stack_coreg_processor/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/stack_coreg_processor" + LOCAL_DEPENDENCIES: "../bps-common ../bps-stack_pre_processor" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-stack_coreg_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-stack_coreg_processor/archive; - done + extends: .deploy diff --git a/bps-stack_coreg_processor/noxfile.py b/bps-stack_coreg_processor/noxfile.py index 5bd5e3a..61ace1c 100644 --- a/bps-stack_coreg_processor/noxfile.py +++ b/bps-stack_coreg_processor/noxfile.py @@ -2,17 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common", "../bps-stack_pre_processor") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-stack_coreg_processor/pyproject.toml b/bps-stack_coreg_processor/pyproject.toml index e76622a..320b1f1 100644 --- a/bps-stack_coreg_processor/pyproject.toml +++ b/bps-stack_coreg_processor/pyproject.toml @@ -29,7 +29,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -44,3 +44,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-stack_pre_processor/.gitlab-ci.yml b/bps-stack_pre_processor/.gitlab-ci.yml index d7b2696..a976574 100644 --- a/bps-stack_pre_processor/.gitlab-ci.yml +++ b/bps-stack_pre_processor/.gitlab-ci.yml @@ -8,65 +8,21 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/stack_pre_processor" + LOCAL_DEPENDENCIES: "../bps-common" ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check - -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python3 -m pip install nox - - python3 -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -74,23 +30,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -98,30 +37,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-stack_pre_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-stack_pre_processor/archive; - done + extends: .deploy diff --git a/bps-stack_pre_processor/noxfile.py b/bps-stack_pre_processor/noxfile.py index 9cc3e8b..61ace1c 100644 --- a/bps-stack_pre_processor/noxfile.py +++ b/bps-stack_pre_processor/noxfile.py @@ -2,17 +2,6 @@ import sys -import nox - # Import common utilities from scripts folder sys.path.append("../scripts") -import noxfile_common - - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common") - - noxfile_common.run_unittest(session) +import noxfile_common # noqa: F401 diff --git a/bps-stack_pre_processor/pyproject.toml b/bps-stack_pre_processor/pyproject.toml index 5389243..ee4e4c5 100644 --- a/bps-stack_pre_processor/pyproject.toml +++ b/bps-stack_pre_processor/pyproject.toml @@ -28,7 +28,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -43,3 +43,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-stack_processor/.gitlab-ci.yml b/bps-stack_processor/.gitlab-ci.yml index 6bab3f3..740444a 100644 --- a/bps-stack_processor/.gitlab-ci.yml +++ b/bps-stack_processor/.gitlab-ci.yml @@ -8,80 +8,26 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - -.tags_manylinux2014: - tags: ["manylinux2014"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] +variables: + LOCAL_DEPENDENCIES: "../bps-common ../bps-stack_pre_processor ../bps-stack_coreg_processor ../bps-stack_cal_processor ../bps-transcoder" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff + extends: .ruff -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps +pyrefly: + extends: .pyrefly -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +fawlty_deps: + extends: .fawlty_deps build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-stack_processor/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-stack_processor/archive; - done + extends: .deploy diff --git a/bps-stack_processor/noxfile.py b/bps-stack_processor/noxfile.py index bb0ec26..334cdf2 100644 --- a/bps-stack_processor/noxfile.py +++ b/bps-stack_processor/noxfile.py @@ -8,23 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install( - "-e", - "../bps-common", - "../bps-stack_pre_processor", - "../bps-stack_coreg_processor", - "../bps-stack_cal_processor", - "../bps-transcoder", - ) - - noxfile_common.run_unittest(session) - - XSD_FILES = [ "bio-aux-pps.xsd", "bio-common-types.xsd", diff --git a/bps-stack_processor/pyproject.toml b/bps-stack_processor/pyproject.toml index 8366cc0..53765a2 100644 --- a/bps-stack_processor/pyproject.toml +++ b/bps-stack_processor/pyproject.toml @@ -38,7 +38,7 @@ classifiers = [ bps_stack_processor = "bps.stack_processor.__main__:main" [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -53,3 +53,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/bps-task-tables/.gitlab-ci.yml b/bps-task-tables/.gitlab-ci.yml index a84ee95..24c06da 100644 --- a/bps-task-tables/.gitlab-ci.yml +++ b/bps-task-tables/.gitlab-ci.yml @@ -6,21 +6,18 @@ workflow: rules: - when: always -.tags_manylinux2014: - tags: ["manylinux2014"] - .tags_deploy: tags: ["eo", "deploy"] - TaskTable_and_PMM_xml_validation: stage: validation - extends: - - .tags_manylinux2014 + image: python:3.14-slim-bookworm + before_script: + - apt-get update && apt-get install -y --no-install-recommends libxml2-utils script: - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s validate_task_tables validate_product_metadata_mapping + - python3.14 -m pip install nox + - python3.14 -m nox -s validate_task_tables validate_product_metadata_mapping deploy: stage: deploy diff --git a/bps-transcoder/.gitlab-ci.yml b/bps-transcoder/.gitlab-ci.yml index 0f3c7e1..82765f8 100644 --- a/bps-transcoder/.gitlab-ci.yml +++ b/bps-transcoder/.gitlab-ci.yml @@ -8,75 +8,24 @@ workflow: rules: - when: always -variables: - GIT_DEPTH: 1 - PIP_EXTRA_INDEX_URL: "$INTERNAL_PYPI_URL" - -.tags_manylinux2014: - tags: ["manylinux2014"] - -.tags_win10_conda: - tags: ["eo", "win10", "conda"] +include: + - local: "/.gitlab-ci-common.yml" -.tags_eo_deploy: - tags: ["eo", "deploy"] - -.enable_win10_unittest: - rules: - - if: '$BPS_ENABLE_WIN10_UNITTEST == "true"' +variables: + SOURCE_RELATIVE_PATH: "bps/transcoder" + LOCAL_DEPENDENCIES: "../bps-common" xsd_alignment: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s check_xsd + extends: .xsd_alignment ruff: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s ruff - -fawlty_deps: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s fawlty_deps + extends: .ruff -format: - stage: analysis - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install nox - - python3.12 -m nox -s format_check +pyrefly: + extends: .pyrefly -.unittest_linux: - stage: test - needs: [] - image: condaforge/miniforge3 - script: - - cd $SUBPROJECT - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml +fawlty_deps: + extends: .fawlty_deps unittest_linux_py314: extends: @@ -84,23 +33,6 @@ unittest_linux_py314: variables: PYTHON: "3.14" -.unittest_win10: - stage: test - needs: [] - extends: - - .tags_win10_conda - - .enable_win10_unittest - script: - - cd $SUBPROJECT - - $legacyProfile = Join-Path $HOME 'Documents\WindowsPowerShell\profile.ps1'; if (Test-Path $legacyProfile) { . $legacyProfile } elseif (Test-Path $PROFILE) { . $PROFILE } - - python -m pip install nox - - python -m nox -s unittest -p ${PYTHON} - retry: 2 - artifacts: - reports: - junit: - - $SUBPROJECT/_build/unittest-report-*.xml - unittest_win10_py314: extends: - .unittest_win10 @@ -108,30 +40,7 @@ unittest_win10_py314: PYTHON: "3.14" build: - stage: build - needs: [] - extends: - - .tags_manylinux2014 - script: - - cd $SUBPROJECT - - python3.12 -m pip install build - - python3.12 -m build - artifacts: - expire_in: 2 weeks - paths: - - $SUBPROJECT/dist/*.tar.gz - - $SUBPROJECT/dist/*.whl + extends: .build deploy: - stage: deploy - extends: - - .tags_eo_deploy - rules: - - if: "$CI_COMMIT_TAG" - script: - - eval "$(ssh-agent -s)" - - for file in ${SUBPROJECT}/dist/*; do - eo_pgp-signme ${file} > ${file}.asc && - ./.gitlab/ci/dashboard-copy.sh ${file} develop/bps/bps-transcoder/archive && - ./.gitlab/ci/dashboard-copy.sh ${file}.asc develop/bps/bps-transcoder/archive; - done + extends: .deploy diff --git a/bps-transcoder/noxfile.py b/bps-transcoder/noxfile.py index 5ca1a66..36c4b38 100644 --- a/bps-transcoder/noxfile.py +++ b/bps-transcoder/noxfile.py @@ -8,16 +8,6 @@ sys.path.append("../scripts") import noxfile_common - -@nox.session(python=noxfile_common.UNITTEST_PYVERSIONS, venv_backend=noxfile_common.CONDABUILD_BACKEND) -def unittest(session: nox.Session): - """Run unittest for current package""" - session.conda_install(f"gdal={noxfile_common.GDAL_VERSION}", channel="conda-forge") - session.install("-e", "../bps-common") - - noxfile_common.run_unittest(session) - - annotation_dir = "annotation/v4.5.0/" XSD_FILES = [ annotation_dir + "bio-l1ab-main-annotation.xsd", diff --git a/bps-transcoder/pyproject.toml b/bps-transcoder/pyproject.toml index 6baf154..785dc2e 100644 --- a/bps-transcoder/pyproject.toml +++ b/bps-transcoder/pyproject.toml @@ -34,7 +34,7 @@ classifiers = [ ] [project.optional-dependencies] -dev = ["nox", "ruff==0.17.4"] +dev = ["nox", "ruff==0.17.4", "pyrefly==1.4.1"] test = ["unittest-xml-reporting", "coverage"] [build-system] @@ -49,3 +49,7 @@ only-include = ["bps"] [tool.hatch.build.targets.wheel] only-include = ["bps"] + +[tool.pyrefly] +extends = "../pyrefly.toml" +project-includes = ["**/*.py*"] diff --git a/pyrefly.toml b/pyrefly.toml new file mode 100644 index 0000000..55dfb8b --- /dev/null +++ b/pyrefly.toml @@ -0,0 +1,188 @@ +project-includes = ["**/*.py*"] + +# Baseline of files with existing errors. Remove entries as they +# are fixed. Run `pyrefly check` without a path: passing `.` bypasses exclusions. +project-excludes = [ + "bps-common/bps/common/io/parsing.py", + "bps-common/bps/common/io/translate_common.py", + "bps-common/bps/common/mask_io.py", + "bps-common/bps/common/toi_utils.py", + "bps-common/bps/common/utils.py", + "bps-common/noxfile.py", + "bps-common/test/test_roi_utils.py", + "bps-common/test/test_toi_utils.py", + "bps-l1_core_processor/noxfile.py", + "bps-l1_framing_processor/bps/l1_framing_processor/commands.py", + "bps-l1_framing_processor/bps/l1_framing_processor/l1_framer/l1_framer.py", + "bps-l1_framing_processor/bps/l1_framing_processor/l1_vfra_product/l1_vfra_product.py", + "bps-l1_framing_processor/bps/l1_framing_processor/orbit/eoorbit.py", + "bps-l1_framing_processor/bps/l1_framing_processor/orbit/orbit.py", + "bps-l1_framing_processor/bps/l1_framing_processor/orbit/xl.py", + "bps-l1_framing_processor/bps/l1_framing_processor/orbit/xorb.py", + "bps-l1_framing_processor/bps/l1_framing_processor/utils/time_conversions.py", + "bps-l1_framing_processor/noxfile.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/__main__.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/biomass_l1geoproduct_writer.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/biomass_l1product_reader.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/cli.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/geocoding_utils.py", + "bps-l1_geocoding_tool/bps/l1_geocoding_tool/main.py", + "bps-l1_geocoding_tool/noxfile.py", + "bps-l1_geocoding_tool/test/test_cli.py", + "bps-l1_pre_processor/bps/l1_pre_processor/aux_ins/estimated_noise.py", + "bps-l1_pre_processor/bps/l1_pre_processor/aux_ins/netcdf_utils.py", + "bps-l1_pre_processor/bps/l1_pre_processor/aux_ins/pattern.py", + "bps-l1_pre_processor/bps/l1_pre_processor/translate.py", + "bps-l1_pre_processor/noxfile.py", + "bps-l1_processor/bps/l1_processor/autofocus/af_lib.py", + "bps-l1_processor/bps/l1_processor/autofocus/signalproclib.py", + "bps-l1_processor/bps/l1_processor/cli.py", + "bps-l1_processor/bps/l1_processor/core/chirp_replica_utils.py", + "bps-l1_processor/bps/l1_processor/core/iobpr_utils.py", + "bps-l1_processor/bps/l1_processor/core/wgs84_fallback_utils.py", + "bps-l1_processor/bps/l1_processor/parc/parc_processing_utils.py", + "bps-l1_processor/bps/l1_processor/parc/run.py", + "bps-l1_processor/bps/l1_processor/post/interface.py", + "bps-l1_processor/bps/l1_processor/post/run.py", + "bps-l1_processor/bps/l1_processor/processor_interface/xsd_validation.py", + "bps-l1_processor/bps/l1_processor/scene_center.py", + "bps-l1_processor/noxfile.py", + "bps-l1_processor/tests/test_rfi_activation_mask.py", + "bps-l2a_processor/bps/l2a_processor/commands.py", + "bps-l2a_processor/bps/l2a_processor/core/translate_aux_pp2_2a.py", + "bps-l2a_processor/bps/l2a_processor/fd/fd_commands.py", + "bps-l2a_processor/bps/l2a_processor/fh/fh_commands.py", + "bps-l2a_processor/bps/l2a_processor/gn/gn_commands.py", + "bps-l2a_processor/bps/l2a_processor/ground_cancellation.py", + "bps-l2a_processor/bps/l2a_processor/l2a_common_functionalities.py", + "bps-l2a_processor/bps/l2a_processor/processor_interface/xsd_validation.py", + "bps-l2a_processor/bps/l2a_processor/tomo_fh/tomo_fh_commands.py", + "bps-l2a_processor/noxfile.py", + "bps-l2b_agb_processor/bps/l2b_agb_processor/agb/agb_commands.py", + "bps-l2b_agb_processor/bps/l2b_agb_processor/commands.py", + "bps-l2b_agb_processor/bps/l2b_agb_processor/l2b_common_functionalities.py", + "bps-l2b_agb_processor/bps/l2b_agb_processor/processor_interface/xsd_validation.py", + "bps-l2b_agb_processor/noxfile.py", + "bps-l2b_fd_processor/bps/l2b_fd_processor/commands.py", + "bps-l2b_fd_processor/bps/l2b_fd_processor/fd/fd_commands.py", + "bps-l2b_fd_processor/bps/l2b_fd_processor/l2b_common_functionalities.py", + "bps-l2b_fd_processor/bps/l2b_fd_processor/processor_interface/xsd_validation.py", + "bps-l2b_fd_processor/noxfile.py", + "bps-l2b_fh_processor/bps/l2b_fh_processor/commands.py", + "bps-l2b_fh_processor/bps/l2b_fh_processor/fh/fh_commands.py", + "bps-l2b_fh_processor/bps/l2b_fh_processor/l2b_common_functionalities.py", + "bps-l2b_fh_processor/bps/l2b_fh_processor/processor_interface/xsd_validation.py", + "bps-l2b_fh_processor/noxfile.py", + "bps-stack_cal_processor/bps/stack_cal_processor/configuration.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/azf/azimuthfilter.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/azf/utils.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/azf/windowing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/filtering.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/floating_precision.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/interferometric_pairing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/backgroundiono.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/estimation.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/ionocorrection.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/preprocessing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/splitspectrum.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/iob/utils.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/flattening.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/ionocorrection.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/ionoestimation.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/mscalibration.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/mscoherence.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/msshifts.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/phaseplane.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/utils.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/msc/warping.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/signal_processing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/mpmb.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/postprocessing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/preprocessing.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/skpcalibration.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/skpcorrection.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/skpdecomposition.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/skpquality.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/skp/utils.py", + "bps-stack_cal_processor/bps/stack_cal_processor/core/utils.py", + "bps-stack_cal_processor/bps/stack_cal_processor/input_manager.py", + "bps-stack_cal_processor/noxfile.py", + "bps-stack_cal_processor/test/test_input_manager.py", + "bps-stack_cal_processor/test/test_mpmb.py", + "bps-stack_cal_processor/test/test_signal_processing.py", + "bps-stack_cal_processor/test/test_skp_utils.py", + "bps-stack_cal_processor/test/test_skpdecomposition.py", + "bps-stack_cal_processor/test/test_utils.py", + "bps-stack_coreg_processor/bps/stack_coreg_processor/core/geometry.py", + "bps-stack_coreg_processor/bps/stack_coreg_processor/core/interpolation.py", + "bps-stack_coreg_processor/bps/stack_coreg_processor/core/shifting.py", + "bps-stack_coreg_processor/bps/stack_coreg_processor/translate.py", + "bps-stack_coreg_processor/noxfile.py", + "bps-stack_coreg_processor/test/test_shifting.py", + "bps-stack_pre_processor/bps/stack_pre_processor/core/geometry.py", + "bps-stack_pre_processor/bps/stack_pre_processor/core/preprocessing.py", + "bps-stack_pre_processor/bps/stack_pre_processor/core/utils.py", + "bps-stack_pre_processor/bps/stack_pre_processor/interface.py", + "bps-stack_pre_processor/noxfile.py", + "bps-stack_pre_processor/test/test_geometry.py", + "bps-stack_pre_processor/test/test_preprocessing.py", + "bps-stack_pre_processor/test/test_utils.py", + "bps-stack_processor/bps/stack_processor/execution/fnf.py", + "bps-stack_processor/bps/stack_processor/execution/stack_cal_execution_manager.py", + "bps-stack_processor/bps/stack_processor/execution/stack_coreg_execution_manager.py", + "bps-stack_processor/bps/stack_processor/execution/stack_preproc_execution_manager.py", + "bps-stack_processor/bps/stack_processor/interface/external/aux_pps.py", + "bps-stack_processor/bps/stack_processor/interface/external/l1c_export.py", + "bps-stack_processor/bps/stack_processor/interface/external/translate_aux_pps.py", + "bps-stack_processor/bps/stack_processor/interface/external/utils.py", + "bps-stack_processor/bps/stack_processor/interface/internal/working_directory.py", + "bps-stack_processor/bps/stack_processor/run_stack_processor.py", + "bps-stack_processor/bps/stack_processor/utils/memorycheck.py", + "bps-stack_processor/bps/stack_processor/utils/numba_utils.py", + "bps-stack_processor/noxfile.py", + "bps-transcoder/bps/transcoder/orbit/eoorbit.py", + "bps-transcoder/bps/transcoder/orbit/orbit.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l1product_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l1product_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l1product.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2aproduct_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2aproduct_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bagbproduct_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bagbproduct_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bfdproduct_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bfdproduct_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bfhproduct_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_l2bfhproduct_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_stackproduct_reader.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_stackproduct_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/biomass_stackproduct.py", + "bps-transcoder/bps/transcoder/sarproduct/generic_product.py", + "bps-transcoder/bps/transcoder/sarproduct/l1_annotations.py", + "bps-transcoder/bps/transcoder/sarproduct/l1_lut_writer.py", + "bps-transcoder/bps/transcoder/sarproduct/overlay.py", + "bps-transcoder/bps/transcoder/sarproduct/sarproduct.py", + "bps-transcoder/bps/transcoder/sarproduct/sta/product_content.py", + "bps-transcoder/bps/transcoder/sarproduct/vrt.py", + "bps-transcoder/bps/transcoder/utils/dgg_utils.py", + "bps-transcoder/bps/transcoder/utils/quality_index.py", + "bps-transcoder/bps/transcoder/utils/quicklook_utils.py", + "bps-transcoder/bps/transcoder/utils/xsd_schema_attacher.py", + "bps-transcoder/noxfile.py", + "bps-transcoder/test/io_/test_translate_common_annotations_l1.py", + "bps-transcoder/test/io_/test_translate_common.py", + "bps-transcoder/test/test_product_name.py", + "bps-transcoder/test/test_quality_index_utils.py", + "noxfile.py", + "test/integration/suite/base/bps-l1-iri.py", + "test/integration/suite/e2e/bps-e2e.py", + "test/integration/suite/l1/l1p/bps-l1p.py", + "test/integration/suite/stack/basic/bps_stack_config_test.py", + "test/integration/suite/stack/basic/bps_stack_normal.py", + "test/integration/suite/stack/basic/bps_stack_stop_and_resume.py", +] + +[[sub-config]] +matches = "**/models.py" + +[sub-config.errors] +bad-override = "ignore" diff --git a/ruff.toml b/ruff.toml index 17e620f..a5cb2f8 100644 --- a/ruff.toml +++ b/ruff.toml @@ -3,6 +3,12 @@ output-format = "concise" target-version = "py312" required-version = "0.17.4" +[lint] +extend-select = ["CPY"] + +[lint.flake8-copyright] +notice-rgx = '\A# Project: BIOMASS Processing Suite \(BPS\)\n#\n# Copyright \(c\) 2025, ARESYS S\.r\.l\.(?:, DLR, Deimos Space)?\n# Developed under contract with the European Space Agency \(ESA\)\n#\n# SPDX-License-Identifier: MIT\n\n' + [format] docstring-code-format = true line-ending = "lf" @@ -12,3 +18,7 @@ line-ending = "lf" "*l1_framing_processor/*/models.py" = ["UP"] "__init__.py" = ["F401"] "__main__.py" = ["BLE001"] +"test/*.py" = ["CPY"] +"*/test/*.py" = ["CPY"] +"*/tests/*.py" = ["CPY"] +"noxfile.py" = ["CPY"] diff --git a/scripts/fawltydeps.toml b/scripts/fawltydeps.toml index f21fc41..fc9c951 100644 --- a/scripts/fawltydeps.toml +++ b/scripts/fawltydeps.toml @@ -12,6 +12,7 @@ ignore_unused = [ 'bps-stack_coreg_processor', 'coverage', # dev dependency 'ruff', # dev dependency + 'pyrefly', # dev dependency 'nox', # dev dependency 'unittest-xml-reporting', # dev dependency ] diff --git a/scripts/noxfile_common.py b/scripts/noxfile_common.py index c535265..2e2584b 100644 --- a/scripts/noxfile_common.py +++ b/scripts/noxfile_common.py @@ -11,74 +11,12 @@ """ import shutil -import sys from pathlib import Path import nox -UNITTEST_PYVERSIONS = ["3.12", "3.13", "3.14"] -CONDABUILD_BACKEND = "mamba" -WIN32 = sys.platform == "win32" -PLATFORM = "win" if WIN32 else "linux" -GDAL_VERSION = "3.13.3" RUFF_VERSION = "0.17.4" -_LICENSE_HEADER_ARESYS = """# Project: BIOMASS Processing Suite (BPS) -# -# Copyright (c) 2025, ARESYS S.r.l. -# Developed under contract with the European Space Agency (ESA) -# -# SPDX-License-Identifier: MIT - -""" - -_GPP_FILES = ["main_autofocus_bps.py", "af_lib.py", "signalproclib.py", "save_aresys.py"] - -_LICENSE_HEADER_GPP = """# Project: BIOMASS Processing Suite (BPS) -# -# Copyright (c) 2025, ARESYS S.r.l., DLR, Deimos Space -# Developed under contract with the European Space Agency (ESA) -# -# SPDX-License-Identifier: MIT - -""" - - -def run_format_check(session: nox.Session): - """Check files are: formatted, with license header and import sorted""" - session.install(f"ruff=={RUFF_VERSION}") - session.run("python", "-m", "ruff", "format", ".", "--check") - session.run("python", "-m", "ruff", "check", ".", "--select", "I") - - def is_gpp_file(file: Path) -> bool: - return file.name in _GPP_FILES - - def wrong_license_header(file: Path, license_header: str) -> bool: - num_header_lines = len(license_header.splitlines()) - with file.open("r", encoding="utf-8") as f: - header = "".join(next(f) for _ in range(num_header_lines)) - return header != license_header - - source_files = list(Path("bps").rglob("*.py")) - no_licensed_files = list( - filter( - lambda x: wrong_license_header(x, _LICENSE_HEADER_ARESYS), - filter(lambda x: not is_gpp_file(x), source_files), - ) - ) + list( - filter( - lambda x: wrong_license_header(x, _LICENSE_HEADER_GPP), - filter(lambda x: is_gpp_file(x), source_files), - ) - ) - - if len(no_licensed_files) > 0: - for file in no_licensed_files: - session.warn(f"{file} has no license header") - session.error() - else: - session.log("All files have proper license header") - def run_format_fix(session: nox.Session): """Fix files: format and sort import""" @@ -87,63 +25,6 @@ def run_format_fix(session: nox.Session): session.run("python", "-m", "ruff", "check", ".", "--select", "I", "--fix") -def run_ruff(session: nox.Session): - """Assess code quality with ruff""" - session.install(f"ruff=={RUFF_VERSION}") - session.run("python", "-m", "ruff", "check", ".") - - -def run_fawlty_deps(session: nox.Session): - """Check dependencies with fawlty deps""" - if not Path("bps").exists(): - session.error("run fawlty_deps session inside package folder: e.g. 'cd bps-common; nox -s fawlty_deps'") - - session.install("FawltyDeps") - session.run( - "python", - "-m", - "fawltydeps", - "--code", - "bps", - "--detailed", - "--config-file", - "../scripts/fawltydeps.toml", - ) - - -def run_unittest(session: nox.Session): - """Run package unittest""" - - package_name = Path.cwd().name - package_module = package_name.replace("-", ".") - - Path("_build").mkdir(exist_ok=True) - session.install("-e", ".") - - session.install("unittest-xml-reporting", "coverage") - session.run( - "python", - "-m", - "coverage", - "run", - f"--source={package_module}", - "-m", - "xmlrunner", - "--output-file", - f"_build/unittest-report-{PLATFORM}-py{session.python}.xml", - "discover", - ) - session.run("python", "-m", "coverage", "report", "-m") - session.run( - "python", - "-m", - "coverage", - "xml", - "-o", - f"_build/unittest-coverage-{PLATFORM}-py{session.python}.xml", - ) - - def run_check_xsd(session: nox.Session, package: str, file_list: list[str]): """Check that XSD inside package are aligned with those main folder""" @@ -186,25 +67,7 @@ def run_align_xsd(session: nox.Session, package: str, file_list: list[str]): # Default sessions -@nox.session() -def format_check(session: nox.Session): - """Check files are: formatted, with license header and import sorted""" - run_format_check(session) - - @nox.session() def format_fix(session: nox.Session): """Fix files: format and sort import""" run_format_fix(session) - - -@nox.session() -def ruff(session: nox.Session): - """Assess code quality with ruff""" - run_ruff(session) - - -@nox.session() -def fawlty_deps(session: nox.Session): - """Check dependencies with fawlty deps""" - run_fawlty_deps(session)