Skip to content

build: rename blob extension #30

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Apr 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/ci_ut_ext_blob_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ on:
push:
branches: [ dev, main, release/* ]
paths:
- 'azure-functions-extension-blob/**'
- 'azurefunctions-extensions-bindings-blob/**'
pull_request:
branches: [ dev, main, release/* ]
paths:
- 'azure-functions-extension-blob/**'
- 'azurefunctions-extensions-bindings-blob/**'

jobs:
build:
Expand All @@ -29,13 +29,13 @@ jobs:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
working-directory: azure-functions-extension-blob
working-directory: azurefunctions-extensions-bindings-blob
run: |
python -m pip install --upgrade pip
python -m pip install -U -e .[dev]

- name: Run Unit Tests
working-directory: azure-functions-extension-blob
working-directory: azurefunctions-extensions-bindings-blob
env:
AzureWebJobsStorage: ${{ secrets.AzureWebJobsStorage }}
run: |
Expand All @@ -46,7 +46,7 @@ jobs:
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
with:
file: ./azure-functions-extension-blob/coverage.xml
file: ./azurefunctions-extensions-bindings-blob/coverage.xml
flags: unittests
name: codecov
fail_ci_if_error: false
Expand Down
16 changes: 8 additions & 8 deletions .github/workflows/linting_extension_blob.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
###########################
###########################

name: Lint azure-functions-extension-blob
name: Lint azurefunctions-extensions-bindings-blob

#
# Documentation:
Expand All @@ -23,22 +23,22 @@ on:
- main
- 'release/*'
paths:
- 'azure-functions-extension-blob/**'
- 'azurefunctions-extensions-bindings-blob/**'
pull_request:
branches:
- dev
- main
- 'release/*'
paths:
- 'azure-functions-extension-blob/**'
- 'azurefunctions-extensions-bindings-blob/**'

###############
# Set the Job #
###############
jobs:
build:
# Name the Job
name: Lint azure-functions-extension-blob
name: Lint azurefunctions-extensions-bindings-blob
# Set the agent to run on
runs-on: ubuntu-latest
permissions:
Expand Down Expand Up @@ -74,9 +74,9 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VALIDATE_PYTHON: true
VALIDATE_PYTHON_BLACK: true # same as above
VALIDATE_PYTHON_ISORT: true # same as above
# VALIDATE_PYTHON_ISORT: true # same as above TODO: fix conflicting linters
PYTHON_ISORT_CONFIG_FILE: .isort.cfg
FILTER_REGEX_INCLUDE: azure-functions-extension-blob/*
FILTER_REGEX_INCLUDE: azurefunctions-extensions-bindings-blob/*
DEFAULT_BRANCH: origin/dev

send-notification:
Expand All @@ -90,7 +90,7 @@ jobs:
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
notification-summary: "Python Extension Lint azure-functions-extension-blob Failed"
notification-summary: "Python Extension Lint azurefunctions-extensions-bindings-blob Failed"
notification-color: FF0000
timezone: America/Denver
verbose-logging: false
Expand All @@ -101,7 +101,7 @@ jobs:
with:
github-token: ${{ github.token }}
ms-teams-webhook-uri: ${{ secrets.MS_TEAMS_WEBHOOK_URI }}
notification-summary: "Python Extension Lint azure-functions-extension-blob Passed"
notification-summary: "Python Extension Lint azurefunctions-extensions-bindings-blob Passed"
notification-color: 008000
timezone: America/Denver
verbose-logging: false
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@ Blob client types can be generated from:
* Blob Triggers
* Blob Input

[Source code](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob)
[Source code](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob)
| Package (PyPi)
| Package (Conda)
| API reference documentation
| Product documentation
| [Samples](hhttps://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples)
| [Samples](hhttps://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples)


## Getting started
Expand All @@ -27,7 +27,7 @@ Blob client types can be generated from:
Install the Azure Functions Extension Blob library for Python with pip:

```bash
pip install azure-functions-extension-blob
pip install azurefunctions-extensions-bindings-blob
```

### Create a storage account
Expand Down Expand Up @@ -55,7 +55,7 @@ properties and methods available as seen in the Azure Storage Blob library for P
```python
import logging
import azure.functions as func
import azure.functions.extension.blob as blob
import azurefunctions.extensions.bindings.blob as blob

@app.blob_trigger(arg_name="client",
path="PATH/TO/BLOB",
Expand Down Expand Up @@ -86,19 +86,19 @@ This list can be used for reference to catch thrown exceptions. To get the speci

### More sample code

Get started with our [Blob samples](hhttps://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples).
Get started with our [Blob samples](hhttps://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples).

Several samples are available in this GitHub repository. These samples provide example code for additional scenarios commonly encountered while working with Storage Blobs:

* [blob_samples_blobclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_blobclient) - Examples for using the BlobClient type:
* [blob_samples_blobclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_blobclient) - Examples for using the BlobClient type:
* From BlobTrigger
* From BlobInput

* [blob_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_containerclient) - Examples for using the ContainerClient type:
* [blob_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_containerclient) - Examples for using the ContainerClient type:
* From BlobTrigger
* From BlobInput

* [blob_samples_storagestreamdownloader](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_storagestreamdownloader) - Examples for using the StorageStreamDownloader type:
* [blob_samples_storagestreamdownloader](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_storagestreamdownloader) - Examples for using the StorageStreamDownloader type:
* From BlobTrigger
* From BlobInput

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
from typing import Union

from azure.functions.extension.base import Datum, SdkType
from azure.storage.blob import BlobClient as BlobClientSdk
from azurefunctions.extensions.base import Datum, SdkType


class BlobClient(SdkType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from typing import Any

from azure.functions.extension.base import Datum, InConverter, OutConverter
from azurefunctions.extensions.base import Datum, InConverter, OutConverter

from .blobClient import BlobClient
from .containerClient import ContainerClient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
from typing import Union

from azure.functions.extension.base import Datum, SdkType
from azure.storage.blob import ContainerClient as ContainerClientSdk
from azurefunctions.extensions.base import Datum, SdkType


class ContainerClient(SdkType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import os
from typing import Union

from azure.functions.extension.base import Datum, SdkType
from azure.storage.blob import BlobClient as BlobClientSdk
from azurefunctions.extensions.base import Datum, SdkType


class StorageStreamDownloader(SdkType):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools >= 61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "azure-functions-extension-blob"
name = "azurefunctions-extensions-bindings-blob"
dynamic = ["version"]
requires-python = ">=3.9"
authors = [{ name = "Azure Functions team at Microsoft Corp.", email = "[email protected]"}]
Expand All @@ -24,7 +24,7 @@ classifiers= [
'Development Status :: 5 - Production/Stable',
]
dependencies = [
'azure-functions-extension-base',
'azurefunctions-extensions-base',
'azure-storage-blob==12.19.0'
]

Expand All @@ -38,11 +38,11 @@ dev = [
]

[tool.setuptools.dynamic]
version = {attr = "azure.functions.extension.blob.__version__"}
version = {attr = "azurefunctions.extensions.bindings.blob.__version__"}

[tool.setuptools.packages.find]
exclude = [
'azure.functions.extension', 'azure.functions',
'azure', 'tests', 'samples'
'azurefunctions.extensions.bindings','azurefunctions.extensions',
'azurefunctions', 'tests', 'samples'
]

Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ products:
- azure
- azure-functions
- azure-functions-extensions
- azure-functions-extension-blob
- azurefunctions-extensions-bindings-blob
urlFragment: extension-blob-samples
---

Expand All @@ -17,15 +17,15 @@ These are code samples that show common scenario operations with the Azure Funct
These samples relate to the Azure Storage Blob client library being used as part of a Python Function App. For
examples on how to use the Azure Storage Blob client library, please see [Azure Storage Blob samples](https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/storage/azure-storage-blob/samples)

* [blob_samples_blobclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_blobclient) - Examples for using the BlobClient type:
* [blob_samples_blobclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_blobclient) - Examples for using the BlobClient type:
* From BlobTrigger
* From BlobInput

* [blob_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_containerclient) - Examples for using the ContainerClient type:
* [blob_samples_containerclient](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_containerclient) - Examples for using the ContainerClient type:
* From BlobTrigger
* From BlobInput

* [blob_samples_storagestreamdownloader](https://github.com/Azure/azure-functions-python-extensions/tree/main/azure-functions-extension-blob/samples/blob_samples_storagestreamdownloader) - Examples for using the StorageStreamDownloader type:
* [blob_samples_storagestreamdownloader](https://github.com/Azure/azure-functions-python-extensions/tree/main/azurefunctions-extensions-bindings-blob/samples/blob_samples_storagestreamdownloader) - Examples for using the StorageStreamDownloader type:
* From BlobTrigger
* From BlobInput

Expand All @@ -40,7 +40,7 @@ examples on how to use the Azure Storage Blob client library, please see [Azure
2. Install the Azure Functions Extension Blob library for Python with [pip](https://pypi.org/project/pip/):

```bash
pip install azure-functions-extension-blob
pip install azurefunctions-extensions-bindings-blob
```

3. Clone or download this sample repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging

import azure.functions as func
import azure.functions.extension.blob as blob
import azurefunctions.extensions.bindings.blob as blob

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Manually managing azure-functions-worker may cause unexpected issues

azure-functions
azure-functions-extension-blob
azurefunctions-extensions-bindings-blob
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging

import azure.functions as func
import azure.functions.extension.blob as blob
import azurefunctions.extensions.bindings.blob as blob

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Manually managing azure-functions-worker may cause unexpected issues

azure-functions
azure-functions-extension-blob
azurefunctions-extensions-bindings-blob
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import logging

import azure.functions as func
import azure.functions.extension.blob as blob
import azurefunctions.extensions.bindings.blob as blob

app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
# Manually managing azure-functions-worker may cause unexpected issues

azure-functions
azure-functions-extension-blob
azurefunctions-extensions-bindings-blob
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@
from enum import Enum
from typing import Optional

from azure.functions.extension.base import Datum
from azure.functions.extension.blob import BlobClient, BlobClientConverter
from azure.storage.blob import BlobClient as BlobClientSdk
from azurefunctions.extensions.base import Datum

from azurefunctions.extensions.bindings.blob import BlobClient, BlobClientConverter


# Mock classes for testing
Expand Down Expand Up @@ -160,7 +161,7 @@ def test_blob_client_invalid_creation(self):
# Create test indexed_function
mock_indexed_functions = MockFunction(bindings=[mock_blob])

dict_repr = BlobClientConverter.get_raw_bindings(
dict_repr, logs = BlobClientConverter.get_raw_bindings(
mock_indexed_functions, mock_input_types
)

Expand All @@ -174,6 +175,8 @@ def test_blob_client_invalid_creation(self):
],
)

self.assertEqual(logs, {"blob": {bytes: "False"}})

def test_blob_client_valid_creation(self):
# Create test binding
mock_blob = MockBinding(
Expand All @@ -191,7 +194,7 @@ def test_blob_client_valid_creation(self):
# Create test indexed_function
mock_indexed_functions = MockFunction(bindings=[mock_blob])

dict_repr = BlobClientConverter.get_raw_bindings(
dict_repr, logs = BlobClientConverter.get_raw_bindings(
mock_indexed_functions, mock_input_types
)

Expand All @@ -204,3 +207,5 @@ def test_blob_client_valid_creation(self):
'{"SupportsDeferredBinding": true}}'
],
)

self.assertEqual(logs, {"client": {BlobClient: "True"}})
Loading