diff --git a/.azure-pipelines/azure-pipelines-win.yml b/.azure-pipelines/azure-pipelines-win.yml new file mode 100755 index 0000000..f09740f --- /dev/null +++ b/.azure-pipelines/azure-pipelines-win.yml @@ -0,0 +1,67 @@ +# 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: win + pool: + vmImage: windows-2022 + strategy: + matrix: + win_64_python3.10.____cpython: + CONFIG: win_64_python3.10.____cpython + UPLOAD_PACKAGES: 'True' + win_64_python3.11.____cpython: + CONFIG: win_64_python3.11.____cpython + UPLOAD_PACKAGES: 'True' + win_64_python3.12.____cpython: + CONFIG: win_64_python3.12.____cpython + UPLOAD_PACKAGES: 'True' + win_64_python3.8.____cpython: + CONFIG: win_64_python3.8.____cpython + UPLOAD_PACKAGES: 'True' + win_64_python3.9.____73_pypy: + CONFIG: win_64_python3.9.____73_pypy + UPLOAD_PACKAGES: 'True' + win_64_python3.9.____cpython: + CONFIG: win_64_python3.9.____cpython + UPLOAD_PACKAGES: 'True' + timeoutInMinutes: 360 + variables: + CONDA_BLD_PATH: D:\\bld\\ + UPLOAD_TEMP: D:\\tmp + + steps: + + - task: PythonScript@0 + displayName: 'Download Miniforge' + inputs: + scriptSource: inline + script: | + import urllib.request + url = 'https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Windows-x86_64.exe' + path = r"$(Build.ArtifactStagingDirectory)/Miniforge.exe" + urllib.request.urlretrieve(url, path) + + - script: | + start /wait "" %BUILD_ARTIFACTSTAGINGDIRECTORY%\Miniforge.exe /InstallationType=JustMe /RegisterPython=0 /S /D=C:\Miniforge + displayName: Install Miniforge + + - powershell: Write-Host "##vso[task.prependpath]C:\Miniforge\Scripts" + displayName: Add conda to PATH + + - script: | + call ".scripts\run_win_build.bat" + displayName: Run Windows build + env: + PYTHONUNBUFFERED: 1 + CONFIG: $(CONFIG) + CI: azure + flow_run_id: azure_$(Build.BuildNumber).$(System.JobAttempt) + remote_url: $(Build.Repository.Uri) + sha: $(Build.SourceVersion) + UPLOAD_PACKAGES: $(UPLOAD_PACKAGES) + UPLOAD_TEMP: $(UPLOAD_TEMP) + 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/win_64_python3.10.____cpython.yaml b/.ci_support/win_64_python3.10.____cpython.yaml new file mode 100644 index 0000000..db1c6bb --- /dev/null +++ b/.ci_support/win_64_python3.10.____cpython.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.10.* *_cpython +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.11.____cpython.yaml b/.ci_support/win_64_python3.11.____cpython.yaml new file mode 100644 index 0000000..124864f --- /dev/null +++ b/.ci_support/win_64_python3.11.____cpython.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.11.* *_cpython +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.12.____cpython.yaml b/.ci_support/win_64_python3.12.____cpython.yaml new file mode 100644 index 0000000..3fc30c0 --- /dev/null +++ b/.ci_support/win_64_python3.12.____cpython.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.12.* *_cpython +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.8.____cpython.yaml b/.ci_support/win_64_python3.8.____cpython.yaml new file mode 100644 index 0000000..adfb38c --- /dev/null +++ b/.ci_support/win_64_python3.8.____cpython.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.8.* *_cpython +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.9.____73_pypy.yaml b/.ci_support/win_64_python3.9.____73_pypy.yaml new file mode 100644 index 0000000..8d10fcf --- /dev/null +++ b/.ci_support/win_64_python3.9.____73_pypy.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_73_pypy +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.ci_support/win_64_python3.9.____cpython.yaml b/.ci_support/win_64_python3.9.____cpython.yaml new file mode 100644 index 0000000..6570a2e --- /dev/null +++ b/.ci_support/win_64_python3.9.____cpython.yaml @@ -0,0 +1,18 @@ +c_compiler: +- vs2019 +c_stdlib: +- vs +channel_sources: +- conda-forge +channel_targets: +- conda-forge main +pin_run_as_build: + python: + min_pin: x.x + max_pin: x.x +python: +- 3.9.* *_cpython +rust_compiler: +- rust +target_platform: +- win-64 diff --git a/.scripts/run_win_build.bat b/.scripts/run_win_build.bat new file mode 100755 index 0000000..65650bf --- /dev/null +++ b/.scripts/run_win_build.bat @@ -0,0 +1,130 @@ +:: PLEASE NOTE: This script has been automatically generated by conda-smithy. Any changes here +:: will be lost next time ``conda smithy rerender`` is run. If you would like to make permanent +:: changes to this script, consider a proposal to conda-smithy so that other feedstocks can also +:: benefit from the improvement. + +:: Note: we assume a Miniforge installation is available + +:: INPUTS (required environment variables) +:: CONFIG: name of the .ci_support/*.yaml file for this job +:: CI: azure, github_actions, or unset +:: UPLOAD_PACKAGES: true or false +:: UPLOAD_ON_BRANCH: true or false + +setlocal enableextensions enabledelayedexpansion + +call :start_group "Configuring conda" + +:: Activate the base conda environment +call activate base +:: Configure the solver +set "CONDA_SOLVER=libmamba" +if !errorlevel! neq 0 exit /b !errorlevel! +set "CONDA_LIBMAMBA_SOLVER_NO_CHANNELS_FROM_INSTALLED=1" + +:: Provision the necessary dependencies to build the recipe later +echo Installing dependencies +mamba.exe install "python=3.10" pip mamba conda-build conda-forge-ci-setup=4 "conda-build>=24.1" -c conda-forge --strict-channel-priority --yes +if !errorlevel! neq 0 exit /b !errorlevel! + +:: Set basic configuration +echo Setting up configuration +setup_conda_rc .\ ".\recipe" .\.ci_support\%CONFIG%.yaml +if !errorlevel! neq 0 exit /b !errorlevel! +echo Running build setup +CALL run_conda_forge_build_setup + + +if !errorlevel! neq 0 exit /b !errorlevel! + +if EXIST LICENSE.txt ( + echo Copying feedstock license + copy LICENSE.txt "recipe\\recipe-scripts-license.txt" +) +if NOT [%HOST_PLATFORM%] == [%BUILD_PLATFORM%] ( + if [%CROSSCOMPILING_EMULATOR%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --no-test" + ) +) + +if NOT [%flow_run_id%] == [] ( + set "EXTRA_CB_OPTIONS=%EXTRA_CB_OPTIONS% --extra-meta flow_run_id=%flow_run_id% remote_url=%remote_url% sha=%sha%" +) + +call :end_group + +:: Build the recipe +echo Building recipe +conda-build.exe "recipe" -m .ci_support\%CONFIG%.yaml --suppress-variables %EXTRA_CB_OPTIONS% +if !errorlevel! neq 0 exit /b !errorlevel! + +call :start_group "Inspecting artifacts" +:: inspect_artifacts was only added in conda-forge-ci-setup 4.6.0 +WHERE inspect_artifacts >nul 2>nul && inspect_artifacts || echo "inspect_artifacts needs conda-forge-ci-setup >=4.6.0" +call :end_group + +:: Prepare some environment variables for the upload step +if /i "%CI%" == "github_actions" ( + set "FEEDSTOCK_NAME=%GITHUB_REPOSITORY:*/=%" + set "GIT_BRANCH=%GITHUB_REF:refs/heads/=%" + if /i "%GITHUB_EVENT_NAME%" == "pull_request" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%RUNNER_TEMP%" +) +if /i "%CI%" == "azure" ( + set "FEEDSTOCK_NAME=%BUILD_REPOSITORY_NAME:*/=%" + set "GIT_BRANCH=%BUILD_SOURCEBRANCHNAME%" + if /i "%BUILD_REASON%" == "PullRequest" ( + set "IS_PR_BUILD=True" + ) else ( + set "IS_PR_BUILD=False" + ) + set "TEMP=%UPLOAD_TEMP%" +) + +:: Validate +call :start_group "Validating outputs" +validate_recipe_outputs "%FEEDSTOCK_NAME%" +if !errorlevel! neq 0 exit /b !errorlevel! +call :end_group + +if /i "%UPLOAD_PACKAGES%" == "true" ( + if /i "%IS_PR_BUILD%" == "false" ( + call :start_group "Uploading packages" + if not exist "%TEMP%\" md "%TEMP%" + set "TMP=%TEMP%" + upload_package --validate --feedstock-name="%FEEDSTOCK_NAME%" .\ ".\recipe" .ci_support\%CONFIG%.yaml + if !errorlevel! neq 0 exit /b !errorlevel! + call :end_group + ) +) + +exit + +:: Logging subroutines + +:start_group +if /i "%CI%" == "github_actions" ( + echo ::group::%~1 + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[group]%~1 + exit /b +) +echo %~1 +exit /b + +:end_group +if /i "%CI%" == "github_actions" ( + echo ::endgroup:: + exit /b +) +if /i "%CI%" == "azure" ( + echo ##[endgroup] + exit /b +) +exit /b \ No newline at end of file diff --git a/README.md b/README.md index 59bddaf..42d3153 100644 --- a/README.md +++ b/README.md @@ -240,6 +240,48 @@ Current build status variant + + win_64_python3.10.____cpython + + + variant + + + + win_64_python3.11.____cpython + + + variant + + + + win_64_python3.12.____cpython + + + variant + + + + win_64_python3.8.____cpython + + + variant + + + + win_64_python3.9.____73_pypy + + + variant + + + + win_64_python3.9.____cpython + + + variant + + diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33a441c..e5306da 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -4,4 +4,5 @@ jobs: - template: ./.azure-pipelines/azure-pipelines-linux.yml - - template: ./.azure-pipelines/azure-pipelines-osx.yml \ No newline at end of file + - template: ./.azure-pipelines/azure-pipelines-osx.yml + - template: ./.azure-pipelines/azure-pipelines-win.yml \ No newline at end of file diff --git a/recipe/meta.yaml b/recipe/meta.yaml index 0bf517d..92bd5a6 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -11,14 +11,19 @@ source: build: # We have to skip Windows due to - skip: true # [py<38 or win] + skip: true # [py<38] entry_points: - deptry = deptry.cli:deptry + # Setting CARGO_HOME is a workaround for "path too long" error on + # Windows due to the 260 character limit for paths, and because the + # ruff repo (which is a dependency) has some files with very long names. + script: | + set "CARGO_HOME=C:\cargo" echo "building..." {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation cargo-bundle-licenses --format yaml --output THIRDPARTY.yml - number: 1 + number: 2 requirements: build: