Packing does not work with poetry
#291
Replies: 9 comments
-
|
This issue is idle because it has been open for 14 days with no activity. |
Beta Was this translation helpful? Give feedback.
-
|
Bump... |
Beta Was this translation helpful? Give feedback.
-
|
This issue is idle because it has been open for 14 days with no activity. |
Beta Was this translation helpful? Give feedback.
-
|
@paulschroeder-tomtom env:
AZURE_FUNCTIONAPP_NAME: 'my_name' # set this to your function app name on Azure
AZURE_FUNCTIONAPP_PACKAGE_PATH: '.' # set this to the path to your function app project, defaults to the repository root
PYTHON_VERSION: '3.8' # set this to the python version to use (e.g. '3.6', '3.7', '3.8')
POETRY_VERSION: '1.7.1' # set this to the python version to use (e.g. '3.6', '3.7', '3.8')
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: 'Checkout GitHub Action'
uses: actions/checkout@v3
- name: Setup Python ${{ inputs.PYTHON_VERSION }} Environment
uses: actions/setup-python@v4
with:
python-version: ${{ inputs.PYTHON_VERSION }}
- name: 'Set up poetry'
uses: abatilo/actions-poetry@v2
with:
poetry-version: ${{ inputs.POETRY_VERSION }}
- name: 'Resolve Project Dependencies Using Poetry'
shell: bash
run: |
pushd './${{ inputs.AZURE_FUNCTIONAPP_PACKAGE_PATH }}'
poetry export --format requirements.txt --output requirements.txt
pip install -r requirements.txt --target=".python_packages/lib/site-packages"
popd
- name: Log into Azure
uses: azure/login@v1
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: 'Run Azure Functions Action'
uses: Azure/functions-action@v1
id: fa
with:
app-name: ${{ inputs.AZURE_FUNCTIONAPP_NAME }}
package: ${{ inputs.AZURE_FUNCTIONAPP_PACKAGE_PATH }}
scm-do-build-during-deployment: false
enable-oryx-build: false
respect-funcignore: true |
Beta Was this translation helpful? Give feedback.
-
|
This issue is idle because it has been open for 14 days with no activity. |
Beta Was this translation helpful? Give feedback.
-
|
@GodVenn thank! But since MS was not helpful in that regard (honestly and sadly no surprise 😞) we settled on the following workaround: jobs:
func:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.commit_sha }}
- name: Install dependencies and login to Azure CLI
uses: ./.github/actions/prepare-runner
with:
azure-tenant-id: ${{ vars.AZURE_TENANT_ID }}
azure-subscription-id: ${{ vars.AZURE_SUBSCRIPTION_ID }}
azure-client-id: ${{ vars.AZURE_CLIENT_ID }}
# interesting stuff starts here:
- name: Install poetry
uses: abatilo/actions-poetry@v2
# optionally select a version:
# with:
# poetry-version: # default=latest
- name: Make Oryx happy with requirements.txt
working-directory: ${{ inputs.function_directory }}
run: |
poetry export --without=test --without-hashes --format=requirements.txt > requirements.txt
- name: Upload Function
uses: Azure/functions-action@v1
with:
app-name: ${{ inputs.function_app_name }}
package: ${{ inputs.function_directory }}
scm-do-build-during-deployment: true
enable-oryx-build: trueI seems like the Oryx builder which the |
Beta Was this translation helpful? Give feedback.
-
|
@paulschroeder-tomtom Yeah, that's essentially the same workaround we have! |
Beta Was this translation helpful? Give feedback.
-
|
Very strange because App Services, which also uses Oryx, works correctly with poetry |
Beta Was this translation helpful? Give feedback.
-
|
I'm running into the same issue when deploying from VS Code. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
We use poetry to manage our dependencies. When we use in our workflows like that:
we encounter the following error:
I also found this two issue:
PRE_BUILD_COMMANDenv.var. did not work.Full log:
Beta Was this translation helpful? Give feedback.
All reactions