diff --git a/.azure-pipelines/azure-pipelines-linux.yml b/.azure-pipelines/azure-pipelines-linux.yml deleted file mode 100755 index 1741648..0000000 --- a/.azure-pipelines/azure-pipelines-linux.yml +++ /dev/null @@ -1,44 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -jobs: -- job: linux - pool: - vmImage: ubuntu-latest - strategy: - matrix: - linux_64_: - CONFIG: linux_64_ - UPLOAD_PACKAGES: 'True' - DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma9 - timeoutInMinutes: 360 - variables: {} - - steps: - # configure qemu binfmt-misc running. This allows us to run docker containers - # embedded qemu-static - - script: | - docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes - ls /proc/sys/fs/binfmt_misc/ - condition: not(startsWith(variables['CONFIG'], 'linux_64')) - displayName: Configure binfmt_misc - - - script: | - export CI=azure - export flow_run_id=azure_$(Build.BuildNumber).$(System.JobAttempt) - export remote_url=$(Build.Repository.Uri) - export sha=$(Build.SourceVersion) - export GIT_BRANCH=$BUILD_SOURCEBRANCHNAME - export FEEDSTOCK_NAME=$(basename ${BUILD_REPOSITORY_NAME}) - if [[ "${BUILD_REASON:-}" == "PullRequest" ]]; then - export IS_PR_BUILD="True" - else - export IS_PR_BUILD="False" - fi - .scripts/run_docker_build.sh - displayName: Run docker build - env: - BINSTAR_TOKEN: $(BINSTAR_TOKEN) - FEEDSTOCK_TOKEN: $(FEEDSTOCK_TOKEN) - STAGING_BINSTAR_TOKEN: $(STAGING_BINSTAR_TOKEN) \ No newline at end of file diff --git a/.ci_support/linux_64_.yaml b/.ci_support/linux_64_.yaml index 493b486..11719cd 100644 --- a/.ci_support/linux_64_.yaml +++ b/.ci_support/linux_64_.yaml @@ -1,16 +1,8 @@ -cdt_name: -- conda channel_sources: - conda-forge channel_targets: - conda-forge main docker_image: -- quay.io/condaforge/linux-anvil-x86_64:alma9 -pin_run_as_build: - python: - min_pin: x.x - max_pin: x.x -python: -- 3.12.* *_cpython +- quay.io/condaforge/linux-anvil-x86_64:alma10 python_min: -- '3.9' +- '3.11' diff --git a/.gitattributes b/.gitattributes index 18f114a..85ccb8f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -24,4 +24,5 @@ bld.bat text eol=crlf /README.md linguist-generated=true azure-pipelines.yml linguist-generated=true build-locally.py linguist-generated=true +pixi.toml linguist-generated=true shippable.yml linguist-generated=true diff --git a/.github/workflows/conda-build.yml b/.github/workflows/conda-build.yml index a948c6c..ef38c48 100644 --- a/.github/workflows/conda-build.yml +++ b/.github/workflows/conda-build.yml @@ -1,15 +1,132 @@ -# This file was added automatically by admin-migrations. Do not modify. -# It ensures that Github Actions can run once rerendered for the first time. +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. # -*- mode: yaml -*- name: Build conda package on: - workflow_dispatch: + push: + + pull_request: + +concurrency: + group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} + cancel-in-progress: true jobs: build: - name: Disabled build - runs-on: ubuntu-slim - if: false + name: ${{ matrix.CONFIG }} + runs-on: ${{ matrix.runs_on }} + timeout-minutes: 360 + strategy: + fail-fast: false + max-parallel: 50 + matrix: + include: + - CONFIG: linux_64_ + DOCKER_IMAGE: quay.io/condaforge/linux-anvil-x86_64:alma10 + STORE_BUILD_ARTIFACTS: False + UPLOAD_PACKAGES: True + build_workspace_dir: build_artifacts + docker_run_args: + free_disk_space: skip + os: ubuntu + pagefile_size: 0 + resize_partitions: False + runs_on: ['ubuntu-latest'] + tools_install_dir: ~/miniforge3 steps: - - run: exit 0 + + - name: Checkout code + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Configure binfmt_misc + if: matrix.os == 'ubuntu' + shell: bash + run: | + if [[ "$(uname -m)" == "x86_64" ]]; then + docker run --rm --privileged multiarch/qemu-user-static:register --reset --credential yes + fi + + - name: Build on Linux + id: build-linux + if: matrix.os == 'ubuntu' + env: + CI: github_actions + CONDA_BLD_PATH: ${{ matrix.build_workspace_dir }} + CONDA_FORGE_DOCKER_RUN_ARGS: ${{ matrix.docker_run_args }} + CONFIG: ${{ matrix.CONFIG }} + MINIFORGE_HOME: ${{ matrix.tools_install_dir }} + DOCKER_IMAGE: ${{ matrix.DOCKER_IMAGE }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + RATTLER_BUILD_COLOR: always + RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + export CONDA_BLD_PATH="${CONDA_BLD_PATH/#~/${HOME}}" + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="${GITHUB_REF_NAME}" + export MINIFORGE_HOME="${MINIFORGE_HOME/#~/${HOME}}" + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_docker_build.sh + + - name: Build on macOS + id: build-macos + if: matrix.os == 'macos' + env: + CI: github_actions + CONDA_BLD_PATH: ${{ matrix.build_workspace_dir }} + CONFIG: ${{ matrix.CONFIG }} + MINIFORGE_HOME: ${{ matrix.tools_install_dir }} + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + RATTLER_BUILD_COLOR: always + RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} + shell: bash + run: | + export CONDA_BLD_PATH="${CONDA_BLD_PATH/#~/${HOME}}" + export FEEDSTOCK_NAME="$(basename $GITHUB_REPOSITORY)" + export GIT_BRANCH="${GITHUB_REF_NAME}" + export MINIFORGE_HOME="${MINIFORGE_HOME/#~/${HOME}}" + export flow_run_id="github_$GITHUB_RUN_ID" + export remote_url="https://github.com/$GITHUB_REPOSITORY" + export sha="$GITHUB_SHA" + if [[ "${GITHUB_EVENT_NAME}" == "pull_request" ]]; then + export IS_PR_BUILD="True" + else + export IS_PR_BUILD="False" + fi + ./.scripts/run_osx_build.sh + + - name: Build on windows + id: build-windows + if: matrix.os == 'windows' + shell: cmd + run: | + set "flow_run_id=github_%GITHUB_RUN_ID%" + set "remote_url=https://github.com/%GITHUB_REPOSITORY%" + set "sha=%GITHUB_SHA%" + call ".scripts\run_win_build.bat" + env: + BUILD_PLATFORM: ${{ matrix.build_platform }} + CI: github_actions + CONDA_BLD_PATH: ${{ matrix.build_workspace_dir }} + CONFIG: ${{ matrix.CONFIG }} + MINIFORGE_HOME: ${{ matrix.tools_install_dir }} + PYTHONUNBUFFERED: 1 + UPLOAD_PACKAGES: ${{ matrix.UPLOAD_PACKAGES }} + RATTLER_BUILD_COLOR: always + RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION: 'true' + BINSTAR_TOKEN: ${{ secrets.BINSTAR_TOKEN }} + FEEDSTOCK_TOKEN: ${{ secrets.FEEDSTOCK_TOKEN }} + STAGING_BINSTAR_TOKEN: ${{ secrets.STAGING_BINSTAR_TOKEN }} \ No newline at end of file diff --git a/.gitignore b/.gitignore index 179afe5..86a9c55 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,7 @@ # Ignore all files and folders in root * !/conda-forge.yml +!.recipe_maintainers.json # Don't ignore any files/folders if the parent folder is 'un-ignored' # This also avoids warnings when adding an already-checked file with an ignored parent. @@ -22,3 +23,8 @@ /build_artifacts *.pyc + +# Rattler-build's artifacts are in `output` when not specifying anything. +/output +# Pixi's configuration +.pixi diff --git a/.scripts/build_steps.sh b/.scripts/build_steps.sh index f8051ab..bea14da 100755 --- a/.scripts/build_steps.sh +++ b/.scripts/build_steps.sh @@ -20,6 +20,7 @@ export PYTHONUNBUFFERED=1 export RECIPE_ROOT="${RECIPE_ROOT:-/home/conda/recipe_root}" export CI_SUPPORT="${FEEDSTOCK_ROOT}/.ci_support" export CONFIG_FILE="${CI_SUPPORT}/${CONFIG}.yaml" +export RATTLER_CACHE_DIR="${FEEDSTOCK_ROOT}/build_artifacts/pkg_cache" cat >~/.condarc < /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" +pushd "${FEEDSTOCK_ROOT}" +arch=$(uname -m) +if [[ "$arch" == "x86_64" ]]; then + arch="64" +fi +sed -i.bak -e "s/platforms = .*/platforms = [\"linux-${arch}\"]/" -e "s/# __PLATFORM_SPECIFIC_ENV__ =/docker-build-linux-$arch =/" pixi.toml +echo "Creating environment" +PIXI_CACHE_DIR=/opt/conda pixi install --environment docker-build-linux-$arch +pixi list --environment docker-build-linux-$arch +echo "Activating environment" +eval "$(pixi shell-hook --environment docker-build-linux-$arch)" +mv pixi.toml.bak pixi.toml +popd export CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1 # set up the condarc @@ -57,20 +66,39 @@ if [[ -f "${FEEDSTOCK_ROOT}/LICENSE.txt" ]]; then fi if [[ "${BUILD_WITH_CONDA_DEBUG:-0}" == 1 ]]; then - if [[ "x${BUILD_OUTPUT_ID:-}" != "x" ]]; then - EXTRA_CB_OPTIONS="${EXTRA_CB_OPTIONS:-} --output-id ${BUILD_OUTPUT_ID}" - fi - conda debug "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + # differences between conda-build vs. rattler-build + # - 1 step (conda debug + manually open shell) vs. 2 step (rb debug {setup, shell}) + # - recipe is positional vs. --recipe "${RECIPE_ROOT}" + # - --output-id vs. --output-name + # - --clobber-file vs. none + # - none vs. --target-platform + export CONDA_BLD_PATH="${CONDA_BLD_PATH:-${FEEDSTOCK_ROOT}/build_artifacts}" + rattler-build debug setup \ + --recipe "${RECIPE_ROOT}" \ + -m "${CI_SUPPORT}/${CONFIG}.yaml" \ ${EXTRA_CB_OPTIONS:-} \ - --clobber-file "${CI_SUPPORT}/clobber_${CONFIG}.yaml" + ${BUILD_OUTPUT_ID:+--output-name "${BUILD_OUTPUT_ID}"} \ + --build-platform "${BUILD_PLATFORM}" \ + --target-platform "${HOST_PLATFORM}" - # Drop into an interactive shell - /bin/bash + rattler-build debug shell else - conda-build "${RECIPE_ROOT}" -m "${CI_SUPPORT}/${CONFIG}.yaml" \ - --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:-}" + # differences between conda-build vs. rattler-build + # - recipe is positional vs. --recipe "${RECIPE_ROOT}" + # - --suppress-variables vs. none + # - --clobber-file vs. none + # - none vs. --target-platform + # - --extra-meta a=b c=d vs. --extra-meta a=b --extra-meta c=d + + rattler-build build \ + --recipe "${RECIPE_ROOT}" \ + -m "${CI_SUPPORT}/${CONFIG}.yaml" \ + ${EXTRA_CB_OPTIONS:-} \ + --build-platform "${BUILD_PLATFORM}" \ + --target-platform "${HOST_PLATFORM}" \ + --extra-meta flow_run_id="${flow_run_id:-}" \ + --extra-meta remote_url="${remote_url:-}" \ + --extra-meta sha="${sha:-}" ( startgroup "Inspecting artifacts" ) 2> /dev/null # inspect_artifacts was only added in conda-forge-ci-setup 4.9.4 @@ -94,4 +122,4 @@ fi ( startgroup "Final checks" ) 2> /dev/null -touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" \ No newline at end of file +touch "${FEEDSTOCK_ROOT}/build_artifacts/conda-forge-build-done-${CONFIG}" diff --git a/.scripts/logging_utils.sh b/.scripts/logging_utils.sh old mode 100644 new mode 100755 diff --git a/.scripts/run_docker_build.sh b/.scripts/run_docker_build.sh index 00f377a..17d983f 100755 --- a/.scripts/run_docker_build.sh +++ b/.scripts/run_docker_build.sh @@ -11,8 +11,10 @@ source .scripts/logging_utils.sh set -xeo pipefail +DOCKER_EXECUTABLE="${DOCKER_EXECUTABLE:-docker}" + THISDIR="$( cd "$( dirname "$0" )" >/dev/null && pwd )" -PROVIDER_DIR="$(basename $THISDIR)" +PROVIDER_DIR="$(basename "$THISDIR")" FEEDSTOCK_ROOT="$( cd "$( dirname "$0" )/.." >/dev/null && pwd )" RECIPE_ROOT="${FEEDSTOCK_ROOT}/recipe" @@ -27,7 +29,7 @@ if [[ "${sha:-}" == "" ]]; then popd fi -docker info +${DOCKER_EXECUTABLE} info # In order for the conda-build process in the container to write to the mounted # volumes, we need to run with the same id as the host machine, which is @@ -35,6 +37,7 @@ docker info export HOST_USER_ID=$(id -u) # Check if docker-machine is being used (normally on OSX) and get the uid from # the VM + if hash docker-machine 2> /dev/null && docker-machine active > /dev/null; then export HOST_USER_ID=$(docker-machine ssh $(docker-machine active) id -u) fi @@ -76,27 +79,56 @@ if [ -z "${CI}" ]; then DOCKER_RUN_ARGS="-it ${DOCKER_RUN_ARGS}" fi -( endgroup "Configure Docker" ) 2> /dev/null +# Default volume suffix for Docker (preserve original behavior) +VOLUME_SUFFIX=",z" + +# Podman-specific handling +if [ "${DOCKER_EXECUTABLE}" = "podman" ]; then + # Fix file permissions for rootless podman builds + podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${ARTIFACTS}" + podman unshare chown -R ${HOST_USER_ID}:${HOST_USER_ID} "${RECIPE_ROOT}" + + # Add SELinux label only if enforcing + if command -v getenforce &>/dev/null && [ "$(getenforce)" = "Enforcing" ]; then + VOLUME_SUFFIX=",z" + else + VOLUME_SUFFIX="" + fi +fi + +# When running on GitHub Actions, mount the step summary file into the container +# and point GITHUB_STEP_SUMMARY at it so that rattler-build's GitHub integration +# can write its summary. GitHub writes the file out to the job summary after the +# step finishes. +if [[ -n "${GITHUB_STEP_SUMMARY:-}" ]]; then + DOCKER_RUN_ARGS="${DOCKER_RUN_ARGS} -v ${GITHUB_STEP_SUMMARY}:/home/conda/github_step_summary:rw${VOLUME_SUFFIX},delegated -e GITHUB_STEP_SUMMARY=/home/conda/github_step_summary" +fi +( endgroup "Configure Docker" ) 2> /dev/null ( startgroup "Start Docker" ) 2> /dev/null export UPLOAD_PACKAGES="${UPLOAD_PACKAGES:-True}" export IS_PR_BUILD="${IS_PR_BUILD:-False}" -docker pull "${DOCKER_IMAGE}" -docker run ${DOCKER_RUN_ARGS} \ - -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw,z,delegated \ - -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw,z,delegated \ + +${DOCKER_EXECUTABLE} pull "${DOCKER_IMAGE}" + +${DOCKER_EXECUTABLE} run ${DOCKER_RUN_ARGS} \ + -v "${RECIPE_ROOT}":/home/conda/recipe_root:rw${VOLUME_SUFFIX},delegated \ + -v "${FEEDSTOCK_ROOT}":/home/conda/feedstock_root:rw${VOLUME_SUFFIX},delegated \ + -e BUILD_OUTPUT_ID \ + -e BUILD_WITH_CONDA_DEBUG \ + -e CI \ -e CONFIG \ + -e CPU_COUNT \ + -e FEEDSTOCK_NAME \ + -e GIT_BRANCH \ + -e GITHUB_ACTIONS \ -e HOST_USER_ID \ - -e UPLOAD_PACKAGES \ -e IS_PR_BUILD \ - -e GIT_BRANCH \ + -e RATTLER_BUILD_COLOR \ + -e RATTLER_BUILD_ENABLE_GITHUB_INTEGRATION \ -e UPLOAD_ON_BRANCH \ - -e CI \ - -e FEEDSTOCK_NAME \ - -e CPU_COUNT \ - -e BUILD_WITH_CONDA_DEBUG \ - -e BUILD_OUTPUT_ID \ + -e UPLOAD_PACKAGES \ -e flow_run_id \ -e remote_url \ -e sha \ @@ -111,4 +143,4 @@ docker run ${DOCKER_RUN_ARGS} \ test -f "$DONE_CANARY" # This closes the last group opened in `build_steps.sh` -( endgroup "Final checks" ) 2> /dev/null \ No newline at end of file +( endgroup "Final checks" ) 2> /dev/null diff --git a/LICENSE.txt b/LICENSE.txt index 2ec51d7..c5aa738 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,6 +1,5 @@ BSD-3-Clause license -Copyright (c) 2015-2022, conda-forge contributors -All rights reserved. +Copyright (c) 2015-2026, conda-forge contributors Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index c89ced2..9162cc4 100644 --- a/README.md +++ b/README.md @@ -3,11 +3,11 @@ About python-slugify-feedstock Feedstock license: [BSD-3-Clause](https://github.com/conda-forge/python-slugify-feedstock/blob/main/LICENSE.txt) -Home: https://github.com/un33k/python-slugify +Home: https://pypi.org/project/python-slugify Package license: MIT -Summary: A Python Slugify application that handles Unicode +Summary: A Python slugify application that also handles Unicode Development: https://github.com/un33k/python-slugify @@ -15,10 +15,11 @@ Current build status ==================== - +
All platforms:
+ @@ -42,31 +43,73 @@ conda config --add channels conda-forge conda config --set channel_priority strict ``` -Once the `conda-forge` channel has been enabled, `python-slugify, python-slugify-with-unidecode` can be installed with `conda`: +How to use +---------- + +
+With conda ``` conda install python-slugify python-slugify-with-unidecode ``` -or with `mamba`: +
+ +
+With mamba ``` mamba install python-slugify python-slugify-with-unidecode ``` -It is possible to list all of the versions of `python-slugify` available on your platform with `conda`: +
+ +
+With pixi + +``` +# for adding to your local project +pixi add python-slugify python-slugify-with-unidecode +# for installing globally +pixi global install python-slugify python-slugify-with-unidecode +``` + +
+ +Search package versions +----------------------- + +It is possible to list all of the versions of `python-slugify` available on your platform: + +
+With conda ``` conda search python-slugify --channel conda-forge ``` -or with `mamba`: +
+ +
+With mamba ``` mamba search python-slugify --channel conda-forge ``` -Alternatively, `mamba repoquery` may provide more information: +
+ +
+With pixi + +``` +pixi search python-slugify --channel conda-forge +``` + +
+ +
+With mamba repoquery, which may provide more information ``` # Search all versions available on your platform: @@ -79,6 +122,8 @@ mamba repoquery whoneeds python-slugify --channel conda-forge mamba repoquery depends python-slugify --channel conda-forge ``` +
+ About conda-forge ================= @@ -101,12 +146,12 @@ it is possible to build and upload installable packages to the [conda-forge](https://anaconda.org/conda-forge) [anaconda.org](https://anaconda.org/) channel for Linux, Windows and OSX respectively. -To manage the continuous integration and simplify feedstock maintenance +To manage the continuous integration and simplify feedstock maintenance, [conda-smithy](https://github.com/conda-forge/conda-smithy) has been developed. Using the ``conda-forge.yml`` within this repository, it is possible to re-render all of this feedstock's supporting files (e.g. the CI configuration files) with ``conda smithy rerender``. -For more information please check the [conda-forge documentation](https://conda-forge.org/docs/). +For more information, please check the [conda-forge documentation](https://conda-forge.org/docs/). Terminology =========== @@ -133,7 +178,7 @@ merged, the recipe will be re-built and uploaded automatically to the everybody to install and use from the `conda-forge` channel. Note that all branches in the conda-forge/python-slugify-feedstock are immediately built and any created packages are uploaded, so PRs should be based -on branches in forks and branches in the main repository should only be used to +on branches in forks, and branches in the main repository should only be used to build distinct package versions. In order to produce a uniquely identifiable distribution: diff --git a/azure-pipelines.yml b/azure-pipelines.yml deleted file mode 100644 index d309e84..0000000 --- a/azure-pipelines.yml +++ /dev/null @@ -1,31 +0,0 @@ -# This file was generated automatically from conda-smithy. To update this configuration, -# update the conda-forge.yml and/or the recipe/meta.yaml. -# -*- mode: yaml -*- - -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 c4a56c6..3beb68c 100755 --- a/build-locally.py +++ b/build-locally.py @@ -1,5 +1,6 @@ #!/bin/sh """exec" "python3" "$0" "$@" #""" # fmt: off # fmt: on + # # This file has been generated by conda-smithy in order to build the recipe # locally. @@ -10,6 +11,7 @@ import os import platform import subprocess +import sys from argparse import ArgumentParser @@ -26,13 +28,6 @@ def setup_environment(ns): os.path.dirname(__file__), "miniforge3" ) - # The default cache location might not be writable using docker on macOS. - if ns.config.startswith("linux") and platform.system() == "Darwin": - os.environ["CONDA_FORGE_DOCKER_RUN_ARGS"] = ( - os.environ.get("CONDA_FORGE_DOCKER_RUN_ARGS", "") - + " -e RATTLER_CACHE_DIR=/tmp/rattler_cache" - ) - def run_docker_build(ns): script = ".scripts/run_docker_build.sh" @@ -44,10 +39,19 @@ def run_osx_build(ns): subprocess.check_call([script]) +def run_win_build(ns): + script = ".scripts/run_win_build.bat" + subprocess.check_call(["cmd", "/D", "/Q", "/C", f"CALL {script}"]) + + def verify_config(ns): + choices_filter = ns.filter or "*" valid_configs = { - os.path.basename(f)[:-5] for f in glob.glob(".ci_support/*.yaml") + os.path.basename(f)[:-5] + for f in glob.glob(f".ci_support/{choices_filter}.yaml") } + if choices_filter != "*": + print(f"filtering for '{choices_filter}.yaml' configs") print(f"valid configs are {valid_configs}") if ns.config in valid_configs: print("Using " + ns.config + " configuration") @@ -60,38 +64,46 @@ def verify_config(ns): selections = list(enumerate(sorted(valid_configs), 1)) for i, c in selections: print(f"{i}. {c}") - s = input("\n> ") + try: + s = input("\n> ") + except KeyboardInterrupt: + print("\nno option selected, bye!", file=sys.stderr) + sys.exit(1) idx = int(s) - 1 ns.config = selections[idx][1] print(f"selected {ns.config}") else: raise ValueError("config " + ns.config + " is not valid") - # Remove the following, as implemented - if ns.config.startswith("win"): - raise ValueError( - f"only Linux/macOS configs currently supported, got {ns.config}" + if ( + ns.config.startswith("osx") + and platform.system() == "Darwin" + and not os.environ.get("OSX_SDK_DIR") + ): + raise RuntimeError( + "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " + "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " + "Note: OSX_SDK_DIR must be set to an absolute path. " + "Setting this variable implies agreement to the licensing terms of the SDK by Apple." ) - elif ns.config.startswith("osx"): - if "OSX_SDK_DIR" not in os.environ: - raise RuntimeError( - "Need OSX_SDK_DIR env variable set. Run 'export OSX_SDK_DIR=$PWD/SDKs' " - "to download the SDK automatically to '$PWD/SDKs/MacOSX.sdk'. " - "Note: OSX_SDK_DIR must be set to an absolute path. " - "Setting this variable implies agreement to the licensing terms of the SDK by Apple." - ) def main(args=None): p = ArgumentParser("build-locally") p.add_argument("config", default=None, nargs="?") p.add_argument( - "--debug", - action="store_true", - help="Setup debug environment using `conda debug`", + "--filter", + default=None, + help="Glob string to filter which build choices are presented in interactive mode.", ) p.add_argument( - "--output-id", help="If running debug, specify the output to setup." + "--debug", + action="store_true", + help=( + "Setup debug environment using `conda debug` " + "(or `rattler-build debug` for rattler-build recipes)" + ), ) + p.add_argument("--output-id", help="If running debug, specify the output to setup.") ns = p.parse_args(args=args) verify_config(ns) @@ -104,10 +116,10 @@ def main(args=None): run_docker_build(ns) elif ns.config.startswith("osx"): run_osx_build(ns) + elif ns.config.startswith("win"): + run_win_build(ns) finally: - recipe_license_file = os.path.join( - "recipe", "recipe-scripts-license.txt" - ) + recipe_license_file = os.path.join("recipe", "recipe-scripts-license.txt") if os.path.exists(recipe_license_file): os.remove(recipe_license_file) diff --git a/conda-forge.yml b/conda-forge.yml index 22fb4f5..3153a00 100644 --- a/conda-forge.yml +++ b/conda-forge.yml @@ -1,8 +1,10 @@ +bot: + inspection: hint-all +conda_build: + pkg_format: '2' +conda_build_tool: rattler-build conda_forge_output_validation: true +conda_install_tool: pixi github: branch_name: main tooling_branch_name: main -conda_build: - pkg_format: '2' -bot: - inspection: hint-all diff --git a/pixi.toml b/pixi.toml new file mode 100644 index 0000000..2d8bd78 --- /dev/null +++ b/pixi.toml @@ -0,0 +1,53 @@ +# -*- mode: toml -*- +# This file was generated automatically from conda-smithy. To update this configuration, +# update the conda-forge.yml and/or the recipe/meta.yaml. +"$schema" = "https://pixi.sh/v0.59.0/schema/manifest/schema.json" + +[workspace] +name = "python-slugify-feedstock" +version = "2026.9.1" # conda-smithy version used to generate this file +description = "Pixi configuration for conda-forge/python-slugify-feedstock" +authors = ["@conda-forge/python-slugify"] +channels = ["conda-forge"] +platforms = ["linux-64", "osx-64", "win-64"] +requires-pixi = ">=0.59.0" + +[tasks.build-locally] +cmd = "pixi exec --force-reinstall --list='^python$' python ./build-locally.py" +description = "Build packages locally using the same setup scripts used in conda-forge's CI" +[tasks.smithy] +cmd = "pixi exec --force-reinstall --list='^conda-smithy$' conda-smithy" +description = "Run conda-smithy. Pass necessary arguments." +[tasks.rerender] +cmd = "pixi exec --force-reinstall --list='^conda-smithy$' conda-smithy rerender" +description = "Rerender the feedstock." + +[tasks.lint] +cmd = "pixi exec --list='^conda-smithy$' conda-smithy lint --conda-forge recipe" +description = "Lint the feedstock recipe" + +[feature.build.dependencies] +conda-build = ">=26.3" +conda-forge-ci-setup = "4.*" +rattler-build = "*" + +[feature.build.tasks.inspect-all] +cmd = "inspect_artifacts --all-packages" +description = "List contents of all packages found in rattler-build build directory." +[feature.build.tasks.build] +cmd = "rattler-build build --recipe recipe" +description = "Build python-slugify-feedstock directly (without setup scripts), no particular variant specified" +[feature.build.tasks."build-linux_64_"] +cmd = "rattler-build build --recipe recipe -m .ci_support/linux_64_.yaml " +description = "Build python-slugify-feedstock with variant linux_64_ directly (without setup scripts)" +[feature.build.tasks."debug-linux_64_"] +cmd = "rattler-build debug setup --recipe recipe -m .ci_support/linux_64_.yaml " +description = "Debug python-slugify-feedstock with variant linux_64_ directly (without setup scripts)" +[feature.build.tasks."inspect-linux_64_"] +cmd = "inspect_artifacts --recipe-dir recipe -m .ci_support/linux_64_.yaml" +description = "List contents of python-slugify-feedstock packages built for variant linux_64_" + +[environments] +build = ["build"] +# This is a copy of 'build', to be enabled by build_steps.sh during Docker builds +# __PLATFORM_SPECIFIC_ENV__ = ["build"] diff --git a/recipe/meta.yaml b/recipe/meta.yaml deleted file mode 100644 index dd8b82c..0000000 --- a/recipe/meta.yaml +++ /dev/null @@ -1,91 +0,0 @@ -{% set version = "8.0.4" %} - -{% set PYTHON = PYTHON | default("$PYTHON") %} - -{% set pytest_args = "pytest test.py -vv --cov=slugify --cov-branch --cov-report=term-missing:skip-covered --no-cov-on-fail --cov-fail-under=92" %} - -package: - name: python-slugify - version: {{ version }} - -source: - - url: https://pypi.org/packages/source/p/python-slugify/python-slugify-{{ version }}.tar.gz - sha256: 59202371d1d05b54a9e7720c5e038f928f45daaffe41dd10822f3907b937c856 - - url: https://raw.githubusercontent.com/un33k/python-slugify/v{{ version }}/test.py - sha256: 96a2fb00cb9a225c473cd0bcfab01286f16d47b51368a986a250e00a50ddcc92 - -build: - number: 1 - noarch: python - script: - - {{ PYTHON }} -m pip install . --no-deps -vv --no-build-isolation --disable-pip-version-check - entry_points: - - slugify = slugify.__main__:main - -requirements: - host: - - pip - - python {{ python_min }} - - setuptools - run: - - python >={{ python_min }} - - text-unidecode >=1.3 - run_constrained: - # ships slugify in site-packages and bin - - slugify <0 - # ships slugify in site-packages - - awesome-slugify <0 - # optional, GPLed dep with pin, see `python-slugify-with-unidecode` - - unidecode >=1.1.1 - -test: - requires: - - pip - - pytest-cov - - python {{ python_min }} - imports: - - slugify - source_files: - - test.py - commands: - - pip check - - slugify --help - - {{ pytest_args }} - -outputs: - - name: python-slugify - - - name: python-slugify-with-unidecode - build: - noarch: generic - requirements: - run: - - {{ pin_subpackage("python-slugify", max_pin="x.x.x") }} - - unidecode - test: - requires: - - pip - - pytest-cov - imports: - - slugify - source_files: - - test.py - commands: - - pip check - - slugify --help - - {{ pytest_args }} - -about: - home: https://github.com/un33k/python-slugify - license: MIT - license_family: MIT - license_file: LICENSE - summary: A Python Slugify application that handles Unicode - dev_url: https://github.com/un33k/python-slugify - -extra: - feedstock-name: python-slugify - recipe-maintainers: - - proinsias - - sodre - - bollwyvl diff --git a/recipe/recipe.yaml b/recipe/recipe.yaml new file mode 100644 index 0000000..4addc53 --- /dev/null +++ b/recipe/recipe.yaml @@ -0,0 +1,104 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/prefix-dev/recipe-format/main/schema.json +schema_version: 1 + +context: + version: "9.0.0" + python_check_max: "3.14" + +recipe: + name: python-slugify-split + version: ${{ version }} + +source: + - url: https://files.pythonhosted.org/packages/source/p/python-slugify/python_slugify-${{ version }}.tar.gz + sha256: 1cd20fe7ebf941b11964a92aba9e5319edfe18606276c6e2481b92e737cde44a + - url: https://raw.githubusercontent.com/un33k/python-slugify/v${{ version }}/test.py + sha256: f10f27fa48230d93c34826c7e3c03336ea9fa5103c5a0706174c586470403eda + +build: + number: 0 + +outputs: + - package: + name: python-slugify + build: + number: 0 + noarch: python + script: + - ${{ PYTHON }} -m pip install . --no-deps -vv --no-build-isolation --disable-pip-version-check + python: + entry_points: + - slugify = slugify.__main__:main + requirements: + host: + - pip + - python ${{ python_min }}.* + - setuptools >=77 + run: + - python >=${{ python_min }} + - text-unidecode >=1.3 + run_constraints: + # avoid these packages with conflicts in `site-packages/slugify` + - awesome-slugify <0 + - slugify <0 + # [anyascii] + - anyascii >=0.3.2 + # [unidecode] + - unidecode >=1.1.1 + tests: + - python: + imports: slugify + pip_check: true + python_version: + - ${{ python_min }}.* + - ${{ python_check_max }}.* + - files: + source: + - test.py + requirements: + run: + - pytest-cov + - python ${{ python_min }}.* + script: + - slugify --help + - ${{ pytest_args }} + + - package: + name: python-slugify-with-unidecode + build: + noarch: generic + requirements: + run: + - ${{ pin_subpackage("python-slugify", exact=True) }} + - unidecode + tests: + - python: + imports: slugify + pip_check: true + python_version: + - ${{ python_min }}.* + - ${{ python_check_max }}.* + - files: + source: + - test.py + requirements: + run: + - pytest-cov + - python ${{ python_min }}.* + script: + - slugify --help + - ${{ pytest_args }} + +about: + license: MIT + license_file: LICENSE + summary: A Python slugify application that also handles Unicode + homepage: https://pypi.org/project/python-slugify + repository: https://github.com/un33k/python-slugify + +extra: + feedstock-name: python-slugify + recipe-maintainers: + - proinsias + - sodre + - bollwyvl
All platforms: - - + +