diff --git a/.github/workflows/ogf_workflow.yml b/.github/workflows/ogf_workflow.yml index 41fc79f28..7489d1119 100644 --- a/.github/workflows/ogf_workflow.yml +++ b/.github/workflows/ogf_workflow.yml @@ -79,6 +79,9 @@ jobs: # V. IMPORTANT: Copy this strategy section to the dependent cleanup job as well, # if you are making changes. Make sure they are the same. steps: + - name: Check out repository configuration + uses: actions/checkout@v4 + - name: Install node and npm uses: actions/setup-node@v2 with: @@ -91,6 +94,8 @@ jobs: creds: ${{ secrets.AZURE_CREDENTIALS }} - name: Install Core Tools and K6 + env: + NPM_CONFIG_USERCONFIG: ${{ github.workspace }}/.npmrc run: | npm i -g azure-functions-core-tools@3 --unsafe-perm true diff --git a/.npmrc b/.npmrc new file mode 100644 index 000000000..748c1b0da --- /dev/null +++ b/.npmrc @@ -0,0 +1,2 @@ +registry=https://pkgs.dev.azure.com/azfunc/public/_packaging/upstream-public/npm/registry/ +always-auth=false diff --git a/eng/ci/emulator-tests.yml b/eng/ci/emulator-tests.yml index c165b02ee..c7792ea94 100644 --- a/eng/ci/emulator-tests.yml +++ b/eng/ci/emulator-tests.yml @@ -49,6 +49,4 @@ extends: jobs: - template: /eng/templates/jobs/ci-emulator-tests.yml@self parameters: - PoolName: 1es-pool-azfunc - ArtifactFeed: 'internal/PythonWorker_Internal_PublicPackages' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' \ No newline at end of file + PoolName: 1es-pool-azfunc \ No newline at end of file diff --git a/eng/ci/official-build.yml b/eng/ci/official-build.yml index 876ac571b..be81254b4 100644 --- a/eng/ci/official-build.yml +++ b/eng/ci/official-build.yml @@ -63,16 +63,12 @@ extends: - template: /eng/templates/jobs/ci-emulator-tests.yml@self parameters: PoolName: 1es-pool-azfunc - ArtifactFeed: 'internal/PythonWorker_Internal_PublicPackages' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' - stage: RunWorkerUnitTests dependsOn: BuildPythonWorker jobs: - template: /eng/templates/jobs/ci-unit-tests.yml@self parameters: PoolName: 1es-pool-azfunc - ArtifactFeed: 'internal/PythonWorker_Internal_PublicPackages' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' - stage: RunWorkerDockerDedicatedTests dependsOn: BuildPythonWorker jobs: @@ -99,8 +95,6 @@ extends: PROJECT_NAME: 'Python V2 Library' PROJECT_DIRECTORY: 'runtimes/v2' PoolName: 1es-pool-azfunc - ArtifactFeed: 'internal/PythonWorker_Internal_PublicPackages' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' # Python V1 Library Build and Test Stages - stage: BuildV1Library @@ -118,6 +112,4 @@ extends: parameters: PROJECT_NAME: 'Python V1 Library' PROJECT_DIRECTORY: 'runtimes/v1' - PoolName: 1es-pool-azfunc - ArtifactFeed: 'internal/PythonWorker_Internal_PublicPackages' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' \ No newline at end of file + PoolName: 1es-pool-azfunc \ No newline at end of file diff --git a/eng/ci/public-build.yml b/eng/ci/public-build.yml index e9c5b414f..5605fa025 100644 --- a/eng/ci/public-build.yml +++ b/eng/ci/public-build.yml @@ -79,7 +79,6 @@ extends: - template: /eng/templates/jobs/ci-dependency-check.yml@self parameters: PoolName: 1es-pool-azfunc-public - ArtifactFeed: 'public/PythonWorker_PublicPackages' - stage: RunWorkerUnitTests dependsOn: BuildPythonWorker jobs: @@ -87,16 +86,12 @@ extends: parameters: PROJECT_DIRECTORY: 'workers' PoolName: 1es-pool-azfunc-public - ArtifactFeed: 'public/PythonWorker_PublicPackages' - NuGetServiceConnection: 'PythonWorker_PublicPackages' - stage: RunWorkerEmulatorTests dependsOn: BuildPythonWorker jobs: - template: /eng/templates/jobs/ci-emulator-tests.yml@self parameters: PoolName: 1es-pool-azfunc-public - ArtifactFeed: 'public/PythonWorker_PublicPackages' - NuGetServiceConnection: 'PythonWorker_PublicPackages' # Python V2 Library Build and Test Stages - stage: BuildV2Library @@ -115,8 +110,6 @@ extends: PROJECT_NAME: 'V2 Library' PROJECT_DIRECTORY: 'runtimes/v2' PoolName: 1es-pool-azfunc-public - ArtifactFeed: 'public/PythonWorker_PublicPackages' - NuGetServiceConnection: 'PythonWorker_PublicPackages' # Python V1 Library Build and Test Stages - stage: BuildV1Library @@ -134,6 +127,4 @@ extends: parameters: PROJECT_NAME: 'V1 Library' PROJECT_DIRECTORY: 'runtimes/v1' - PoolName: 1es-pool-azfunc-public - ArtifactFeed: 'public/PythonWorker_PublicPackages' - NuGetServiceConnection: 'PythonWorker_PublicPackages' \ No newline at end of file + PoolName: 1es-pool-azfunc-public \ No newline at end of file diff --git a/eng/pack/templates/macos_64_env_gen.yml b/eng/pack/templates/macos_64_env_gen.yml index de3c65fa5..825351608 100644 --- a/eng/pack/templates/macos_64_env_gen.yml +++ b/eng/pack/templates/macos_64_env_gen.yml @@ -5,9 +5,10 @@ parameters: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.pythonVersion }} diff --git a/eng/pack/templates/nix_arm64_env_gen.yml b/eng/pack/templates/nix_arm64_env_gen.yml index ef68cae43..f9dd5dd19 100644 --- a/eng/pack/templates/nix_arm64_env_gen.yml +++ b/eng/pack/templates/nix_arm64_env_gen.yml @@ -5,9 +5,10 @@ parameters: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.pythonVersion }} diff --git a/eng/pack/templates/nix_env_gen.yml b/eng/pack/templates/nix_env_gen.yml index 4f5278fb4..eef266405 100644 --- a/eng/pack/templates/nix_env_gen.yml +++ b/eng/pack/templates/nix_env_gen.yml @@ -5,9 +5,10 @@ parameters: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.pythonVersion }} diff --git a/eng/pack/templates/win_env_gen.yml b/eng/pack/templates/win_env_gen.yml index 1027cc85a..2c99ade1a 100644 --- a/eng/pack/templates/win_env_gen.yml +++ b/eng/pack/templates/win_env_gen.yml @@ -5,9 +5,10 @@ parameters: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.pythonVersion }} diff --git a/eng/scripts/install-dependencies.sh b/eng/scripts/install-dependencies.sh index e7e0dd00c..5de75f565 100644 --- a/eng/scripts/install-dependencies.sh +++ b/eng/scripts/install-dependencies.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" + # Install uv for faster dependency resolution / installation. python -m pip install --upgrade pip python -m pip install uv diff --git a/eng/scripts/test-extensions.sh b/eng/scripts/test-extensions.sh index 3bd5adeaf..b80d60f54 100644 --- a/eng/scripts/test-extensions.sh +++ b/eng/scripts/test-extensions.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" + python -m pip install --upgrade pip python -m pip install uv diff --git a/eng/scripts/test-sdk.sh b/eng/scripts/test-sdk.sh index cf5caf1e6..2d1b46fa0 100644 --- a/eng/scripts/test-sdk.sh +++ b/eng/scripts/test-sdk.sh @@ -1,6 +1,8 @@ #!/bin/bash set -e +export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" + python -m pip install --upgrade pip python -m pip install uv diff --git a/eng/templates/jobs/build.yml b/eng/templates/jobs/build.yml index 2af6eeeec..92733e41f 100644 --- a/eng/templates/jobs/build.yml +++ b/eng/templates/jobs/build.yml @@ -18,5 +18,4 @@ jobs: parameters: PYTHON_VERSION: ${{ parameters.PYTHON_VERSION }} PROJECT_NAME: ${{ parameters.PROJECT_NAME }} - PROJECT_DIRECTORY: ${{ parameters.PROJECT_DIRECTORY }} - ArtifactFeed: 'public/PythonWorker_PublicPackages' \ No newline at end of file + PROJECT_DIRECTORY: ${{ parameters.PROJECT_DIRECTORY }} \ No newline at end of file diff --git a/eng/templates/jobs/ci-dependency-check.yml b/eng/templates/jobs/ci-dependency-check.yml index a3bdaa54e..a6bb14c3d 100644 --- a/eng/templates/jobs/ci-dependency-check.yml +++ b/eng/templates/jobs/ci-dependency-check.yml @@ -1,6 +1,4 @@ parameters: - ArtifactFeed: '' - jobs: - job: "TestPython" displayName: "Run Dependency Checks" @@ -26,9 +24,10 @@ jobs: PYTHON_VERSION: '3.14' steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: ${{ parameters.ArtifactFeed }} + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: $(PYTHON_VERSION) @@ -54,6 +53,7 @@ jobs: displayName: 'Set necessary variables' - bash: | echo "Checking azure_functions_worker (Python < 3.13)..." + export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" cd workers python -m pip install --upgrade pip python -m pip install uv @@ -67,6 +67,7 @@ jobs: condition: eq(variables['proxyWorker'], false) - bash: | echo "Checking proxy_worker (Python >= 3.13)..." + export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" cd workers python -m pip install --upgrade pip python -m pip install uv @@ -79,6 +80,7 @@ jobs: condition: eq(variables['proxyWorker'], true) - bash: | echo "Checking V1 Library Worker (Python >= 3.13)..." + export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" cd runtimes/v1 python -m pip install --upgrade pip python -m pip install uv @@ -88,6 +90,7 @@ jobs: condition: eq(variables['proxyWorker'], true) - bash: | echo "Checking V2 Library Worker (Python >= 3.13)..." + export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" cd runtimes/v2 python -m pip install --upgrade pip python -m pip install uv diff --git a/eng/templates/jobs/ci-emulator-tests.yml b/eng/templates/jobs/ci-emulator-tests.yml index 10d563fa7..466f590f9 100644 --- a/eng/templates/jobs/ci-emulator-tests.yml +++ b/eng/templates/jobs/ci-emulator-tests.yml @@ -1,7 +1,5 @@ parameters: PROJECT_DIRECTORY: 'workers' - ArtifactFeed: '' - NuGetServiceConnection: '' jobs: - job: "TestPython" @@ -28,9 +26,10 @@ jobs: PYTHON_VERSION: '3.14' steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: ${{ parameters.ArtifactFeed }} + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - bash: | echo "Disk space before cleanup:" df -h @@ -77,19 +76,7 @@ jobs: inputs: version: 10.0.x - task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - - bash: | - # Remove the feed that doesn't match the current service connection - if [[ "${{ parameters.NuGetServiceConnection }}" == "PythonWorker_PublicPackages" ]]; then - # Remove internal feed for public builds - sed -i '/_Internal_PublicPackages/d' nuget.config - else - # Remove public feed for internal builds - sed -i '/PythonWorker_PublicPackages[^_]/d' nuget.config - fi - echo "Updated nuget.config:" - cat nuget.config - displayName: 'Configure NuGet feed for current organization' + displayName: 'Authenticate NuGet to CFS' - bash: | chmod +x eng/scripts/install-dependencies.sh eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }} diff --git a/eng/templates/jobs/ci-library-unit-tests.yml b/eng/templates/jobs/ci-library-unit-tests.yml index d7d0a1a6e..a792790d5 100644 --- a/eng/templates/jobs/ci-library-unit-tests.yml +++ b/eng/templates/jobs/ci-library-unit-tests.yml @@ -1,8 +1,6 @@ parameters: PROJECT_NAME: '' PROJECT_DIRECTORY: '' - ArtifactFeed: '' - NuGetServiceConnection: '' jobs: - job: "TestPython" @@ -20,9 +18,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: ${{ parameters.ArtifactFeed }} + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: $(PYTHON_VERSION) @@ -31,19 +30,7 @@ jobs: inputs: version: 10.0.x - task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - - bash: | - # Remove the feed that doesn't match the current service connection - if [[ "${{ parameters.NuGetServiceConnection }}" == "PythonWorker_PublicPackages" ]]; then - # Remove internal feed for public builds - sed -i '/_Internal_PublicPackages/d' nuget.config - else - # Remove public feed for internal builds - sed -i '/PythonWorker_PublicPackages[^_]/d' nuget.config - fi - echo "Updated nuget.config:" - cat nuget.config - displayName: 'Configure NuGet feed for current organization' + displayName: 'Authenticate NuGet to CFS' - bash: | chmod +x eng/scripts/install-dependencies.sh eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }} diff --git a/eng/templates/jobs/ci-unit-tests.yml b/eng/templates/jobs/ci-unit-tests.yml index 6db168801..e035b1a72 100644 --- a/eng/templates/jobs/ci-unit-tests.yml +++ b/eng/templates/jobs/ci-unit-tests.yml @@ -1,7 +1,5 @@ parameters: PROJECT_DIRECTORY: 'workers' - ArtifactFeed: '' - NuGetServiceConnection: '' jobs: - job: "TestPython" @@ -28,9 +26,10 @@ jobs: PYTHON_VERSION: '3.14' steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: ${{ parameters.ArtifactFeed }} + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - bash: | echo "Disk space before cleanup:" df -h @@ -80,19 +79,7 @@ jobs: inputs: version: 10.0.x - task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - - bash: | - # Remove the feed that doesn't match the current service connection - if [[ "${{ parameters.NuGetServiceConnection }}" == "PythonWorker_PublicPackages" ]]; then - # Remove internal feed for public builds - sed -i '/_Internal_PublicPackages/d' nuget.config - else - # Remove public feed for internal builds - sed -i '/PythonWorker_PublicPackages[^_]/d' nuget.config - fi - echo "Updated nuget.config:" - cat nuget.config - displayName: 'Configure NuGet feed for current organization' + displayName: 'Authenticate NuGet to CFS' - bash: | chmod +x eng/scripts/install-dependencies.sh eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }} diff --git a/eng/templates/official/jobs/build-library.yml b/eng/templates/official/jobs/build-library.yml index 7d1400836..e76544aee 100644 --- a/eng/templates/official/jobs/build-library.yml +++ b/eng/templates/official/jobs/build-library.yml @@ -21,9 +21,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'public/PythonWorker_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: "3.13" diff --git a/eng/templates/official/jobs/ci-core-tools-tests.yml b/eng/templates/official/jobs/ci-core-tools-tests.yml index 61a723aab..977cd82fd 100644 --- a/eng/templates/official/jobs/ci-core-tools-tests.yml +++ b/eng/templates/official/jobs/ci-core-tools-tests.yml @@ -9,9 +9,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 displayName: 'Install Python' inputs: @@ -27,6 +28,8 @@ jobs: inputs: packageType: 'sdk' version: "6.x" + - task: NuGetAuthenticate@1 + displayName: 'Authenticate NuGet to CFS' - pwsh: '$(Build.SourcesDirectory)/.ci/e2e_integration_test/start-e2e.ps1' env: AzureWebJobsStorage: $(LinuxStorageConnectionString311) diff --git a/eng/templates/official/jobs/ci-custom-image-tests.yml b/eng/templates/official/jobs/ci-custom-image-tests.yml index 9592d9b1c..481f4d10c 100644 --- a/eng/templates/official/jobs/ci-custom-image-tests.yml +++ b/eng/templates/official/jobs/ci-custom-image-tests.yml @@ -12,9 +12,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: $(CUSTOM_PYTHON_VERSION) diff --git a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml index 8e875ce4e..d13762758 100644 --- a/eng/templates/official/jobs/ci-docker-dedicated-tests.yml +++ b/eng/templates/official/jobs/ci-docker-dedicated-tests.yml @@ -39,9 +39,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: $(PYTHON_VERSION) diff --git a/eng/templates/official/jobs/ci-e2e-tests.yml b/eng/templates/official/jobs/ci-e2e-tests.yml index 0ab7381c3..9eef94285 100644 --- a/eng/templates/official/jobs/ci-e2e-tests.yml +++ b/eng/templates/official/jobs/ci-e2e-tests.yml @@ -1,6 +1,5 @@ parameters: PROJECT_DIRECTORY: 'workers' - NuGetServiceConnection: 'PythonWorker_Internal_PublicPackages' jobs: - job: "TestPython" @@ -51,9 +50,10 @@ jobs: EVENTGRID_CONNECTION: $(LinuxEventGridConnectionKeyString38) steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - bash: | echo "Disk space before cleanup:" df -h @@ -89,19 +89,7 @@ jobs: inputs: version: 10.0.x - task: NuGetAuthenticate@1 - displayName: 'NuGet Authenticate' - - bash: | - # Remove the feed that doesn't match the current service connection - if [[ "${{ parameters.NuGetServiceConnection }}" == "PythonWorker_PublicPackages" ]]; then - # Remove internal feed for public builds - sed -i '/_Internal_PublicPackages/d' nuget.config - else - # Remove public feed for internal builds - sed -i '/PythonWorker_PublicPackages[^_]/d' nuget.config - fi - echo "Updated nuget.config:" - cat nuget.config - displayName: 'Configure NuGet feed for current organization' + displayName: 'Authenticate NuGet to CFS' - bash: | chmod +x eng/scripts/install-dependencies.sh eng/scripts/install-dependencies.sh $(PYTHON_VERSION) ${{ parameters.PROJECT_DIRECTORY }} diff --git a/eng/templates/official/jobs/ci-fc-tests.yml b/eng/templates/official/jobs/ci-fc-tests.yml index f85c389e3..06e9018b7 100644 --- a/eng/templates/official/jobs/ci-fc-tests.yml +++ b/eng/templates/official/jobs/ci-fc-tests.yml @@ -24,9 +24,10 @@ jobs: PYTHON_VERSION: '3.14' steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - bash: | echo "Disk space before cleanup:" df -h @@ -65,6 +66,7 @@ jobs: condition: and(eq(variables.isSdkRelease, false), eq(variables.isExtensionsRelease, false), eq(variables['USETESTPYTHONSDK'], false), eq(variables['USETESTPYTHONEXTENSIONS'], false)) - bash: | + export UV_DEFAULT_INDEX="${UV_DEFAULT_INDEX:-$PIP_INDEX_URL}" python -m pip install --upgrade pip python -m pip install uv UV_PIP="python -m uv pip install --system" diff --git a/eng/templates/official/release/build-artifacts.yml b/eng/templates/official/release/build-artifacts.yml index 647f74a9b..b06662659 100644 --- a/eng/templates/official/release/build-artifacts.yml +++ b/eng/templates/official/release/build-artifacts.yml @@ -46,9 +46,10 @@ jobs: steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: 'internal/PythonWorker_Internal_PublicPackages' + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - ${{ if ne(parameters.libraryVersion, '') }}: - checkout: none - bash: | diff --git a/eng/templates/shared/build-steps.yml b/eng/templates/shared/build-steps.yml index 5fcb66b75..04f88dcff 100644 --- a/eng/templates/shared/build-steps.yml +++ b/eng/templates/shared/build-steps.yml @@ -2,13 +2,13 @@ parameters: PYTHON_VERSION: '' PROJECT_NAME: '' PROJECT_DIRECTORY: '' - ArtifactFeed: '' steps: - task: PipAuthenticate@1 - displayName: 'Pip Authenticate' + displayName: 'Authenticate pip to CFS' inputs: - artifactFeeds: ${{ parameters.ArtifactFeed }} + artifactFeeds: 'public/upstream-public' + onlyAddExtraIndex: false - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.PYTHON_VERSION }} diff --git a/nuget.config b/nuget.config index 08b34c2a2..c4f77e13b 100644 --- a/nuget.config +++ b/nuget.config @@ -2,6 +2,11 @@ - + + + + + + \ No newline at end of file diff --git a/workers/tests/test_setup.py b/workers/tests/test_setup.py index 2f785dcb7..7657db6f7 100644 --- a/workers/tests/test_setup.py +++ b/workers/tests/test_setup.py @@ -30,10 +30,11 @@ from invoke import task -from utils.constants import EXTENSIONS_CSPROJ_TEMPLATE, NUGET_CONFIG +from utils.constants import EXTENSIONS_CSPROJ_TEMPLATE ROOT_DIR = pathlib.Path(__file__).parent.parent BUILD_DIR = ROOT_DIR / 'build' +NUGET_CONFIG_PATH = ROOT_DIR.parent / 'nuget.config' WEBHOST_GITHUB_API = "https://api.github.com/repos/Azure/azure-functions-host" WEBHOST_GIT_REPO = "https://github.com/Azure/azure-functions-host/archive" WEBHOST_TAG_PREFIX = "v4." @@ -115,6 +116,8 @@ def chmod_protobuf_generation_script(webhost_dir): def compile_webhost(webhost_dir): print(f"Compiling Functions Host from {webhost_dir}") + nuget_config_path = webhost_dir / "NuGet.config" + shutil.copy2(NUGET_CONFIG_PATH, nuget_config_path) # Build only the WebHost project (and its dependencies) instead of the # entire WebJobs.Script.sln. The solution also contains test projects, # benchmarks and isolated-worker samples that the tests never run; building @@ -131,6 +134,7 @@ def compile_webhost(webhost_dir): "/m:1", # Disable parallel MSBuild "/nodeReuse:false", # Prevent MSBuild node reuse f"--property:OutputPath={webhost_dir}/bin", # Set output folder + f"--property:RestoreConfigFile={nuget_config_path}", "/p:TreatWarningsAsErrors=false" ], check=True, @@ -289,14 +293,17 @@ def install_extensions(extensions_dir): with open(extensions_dir / "extensions.csproj", "w") as f: f.write(EXTENSIONS_CSPROJ_TEMPLATE) - with open(extensions_dir / "NuGet.config", "w") as f: - f.write(NUGET_CONFIG) + nuget_config_path = extensions_dir / "NuGet.config" + shutil.copy2(NUGET_CONFIG_PATH, nuget_config_path) env = os.environ.copy() env["TERM"] = "xterm" # ncurses 6.1 workaround try: subprocess.run( - args=["dotnet", "build", "-o", "."], + args=[ + "dotnet", "build", "-o", ".", + f"--property:RestoreConfigFile={nuget_config_path}", + ], check=True, cwd=str(extensions_dir), stdout=sys.stdout, diff --git a/workers/tests/utils/constants.py b/workers/tests/utils/constants.py index f78f133d8..cf176f19d 100644 --- a/workers/tests/utils/constants.py +++ b/workers/tests/utils/constants.py @@ -45,24 +45,6 @@ """ -NUGET_CONFIG = """\ - - - - - - - - - - -""" - # PROJECT_ROOT refers to the path to azure-functions-python-worker # TODO: Find root folder without .parent PROJECT_ROOT = pathlib.Path(__file__).parent.parent.parent