From 9469588c37c0a5e3bb09d94e2d66f6a67597662a Mon Sep 17 00:00:00 2001 From: Matthew Feickert Date: Fri, 8 Nov 2024 01:21:09 -0700 Subject: [PATCH 1/2] FIX: Set python_min of Python 3.8 * Use 'python {{ python_min }}' syntax for the python requirements for noarch python recipes. - c.f. https://conda-forge.org/docs/maintainer/knowledge_base/#noarch-python * Add recipe/conda_build_config.yaml to override the global python_min with hatchling's python_min of 3.8. * Install with recommended --no-deps --no-build-isolation options to ensure build dependencies are correct. * Update to 'pypi.org'. * Bump build number. --- recipe/conda_build_config.yaml | 2 ++ recipe/meta.yaml | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 recipe/conda_build_config.yaml diff --git a/recipe/conda_build_config.yaml b/recipe/conda_build_config.yaml new file mode 100644 index 0000000..cca9151 --- /dev/null +++ b/recipe/conda_build_config.yaml @@ -0,0 +1,2 @@ +python_min: +- '3.8' diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 98d6d4b..c81520b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -6,20 +6,20 @@ package: version: {{ version }} source: - url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/hatchling-{{ version }}.tar.gz + url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/hatchling-{{ version }}.tar.gz sha256: 7064631a512610b52250a4d3ff1bd81551d6d1431c4eb7b72e734df6c74f4262 build: noarch: python - script: {{ PYTHON }} -m pip install . -vv - number: 0 + script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation + number: 1 entry_points: - hatchling = hatchling.cli:hatchling requirements: host: - pip - - python >=3.7 + - python {{ python_min }} # bootstrapping - packaging >=21.3 - pathspec >=0.10.1 @@ -27,6 +27,7 @@ requirements: - tomli >=2.0 - trove-classifiers run: + - python >={{ python_min }} - editables >=0.3 - importlib-metadata - packaging >=21.3 @@ -43,6 +44,7 @@ test: - pip check - hatchling --help requires: + - python {{ python_min }} - pip about: From 9fffef8f8a1e4fc48a1f8b5c08c480c9dd6c50de Mon Sep 17 00:00:00 2001 From: "conda-forge-webservices[bot]" <91080706+conda-forge-webservices[bot]@users.noreply.github.com> Date: Fri, 8 Nov 2024 08:28:26 +0000 Subject: [PATCH 2/2] MNT: Re-rendered with conda-build 24.9.0, conda-smithy 3.44.2, and conda-forge-pinning 2024.11.07.16.38.57 --- .ci_support/linux_64_.yaml | 10 +++++++++- .scripts/build_steps.sh | 17 +++++++++-------- azure-pipelines.yml | 29 +++++++++++++++++++++++++++-- build-locally.py | 9 ++++++--- 4 files changed, 51 insertions(+), 14 deletions(-) diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 6c59082..d8ca4f4 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,8 +1,16 @@ cdt_name: -- cos6 +- cos7 channel_sources: - conda-forge channel_targets: - conda-forge main docker_image: - quay.io/condaforge/linux-anvil-cos7-x86_64 +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +python_min: +- '3.8' diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index 97dc8d9..f8051ab 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -31,18 +31,20 @@ pkgs_dirs: solver: libmamba CONDARC +mv /opt/conda/conda-meta/history /opt/conda/conda-meta/history.$(date +%Y-%m-%d-%H-%M-%S) +echo > /opt/conda/conda-meta/history +micromamba install --root-prefix ~/.conda --prefix /opt/conda \ + --yes --override-channels --channel conda-forge --strict-channel-priority \ + pip python=3.12 conda-build conda-forge-ci-setup=4 "conda-build>=24.1" export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 -mamba install --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -mamba update --update-specs --yes --quiet --channel conda-forge --strict-channel-priority \ - pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" - # set up the condarc setup_conda_rc "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" source run_conda_forge_build_setup + + # make the build number clobber make_build_number "${FEEDSTOCK_ROOT}" "${RECIPE_ROOT}" "${CONFIG_FILE}" @@ -69,11 +71,10 @@ else --suppress-variables ${EXTRA_CB_OPTIONS:-} \ --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" \ --extra-meta flow_run_id="${flow_run_id:-}" remote_url="${remote_url:-}" sha="${sha:-}" - ( startgroup "Inspecting artifacts" ) 2> /dev/null - # inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 - command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" + # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 + command -v inspect_artifacts >/dev/null 2>&1 && inspect_artifacts --recipe-dir "${RECIPE_ROOT}" -m "${CONFIG_FILE}" || echo "inspect_artifacts needs conda-forge-ci-setup >=4.9.4" ( endgroup "Inspecting artifacts" ) 2> /dev/null ( startgroup "Validating outputs" ) 2> /dev/null diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ad85a2c..d309e84 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,5 +2,30 @@ # update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- -jobs: - - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file +stages: +- stage: Check + jobs: + - job: Skip + pool: + vmImage: 'ubuntu-22.04' + variables: + DECODE_PERCENTS: 'false' + RET: 'true' + steps: + - checkout: self + fetchDepth: '2' + - bash: | + git_log=`git log --max-count=1 --skip=1 --pretty=format:"%B" | tr "\n" " "` + echo "##vso[task.setvariable variable=log]$git_log" + displayName: Obtain commit message + - bash: echo "##vso[task.setvariable variable=RET]false" + condition: and(eq(variables['Build.Reason'], 'PullRequest'), or(contains(variables.log, '[skip azp]'), contains(variables.log, '[azp skip]'), contains(variables.log, '[skip ci]'), contains(variables.log, '[ci skip]'))) + displayName: Skip build? + - bash: echo "##vso[task.setvariable variable=start_main;isOutput=true]$RET" + name: result + displayName: Export result +- stage: Build + condition: and(succeeded(), eq(dependencies.Check.outputs['Skip.result.start_main'], 'true')) + dependsOn: Check + jobs: + - template: ./.azure-pipelines/azure-pipelines-linux.yml \ No newline at end of file diff --git a/build-locally.py b/build-locally.py index e0d408d..6788aea 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,13 +1,16 @@ -#!/usr/bin/env python3 +#!/bin/sh +"""exec" "python3" "$0" "$@" #""" # fmt: off # fmt: on # # This file has been generated by conda-smithy in order to build the recipe # locally. # -import os +# The line above this comment is a bash / sh / zsh guard +# to stop people from running it with the wrong interpreter import glob +import os +import platform import subprocess from argparse import ArgumentParser -import platform def setup_environment(ns):