Skip to content

Commit 43452dd

Browse files
[Storage] Introduce azure-storage-extensions (#33991)
1 parent 5df1112 commit 43452dd

File tree

17 files changed

+1031
-9
lines changed

17 files changed

+1031
-9
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
# Python cache
55
__pycache__/
6-
*.pyc
6+
*.py[cod]
77
.pytest_cache
88
.mypy_cache
99
.cache

.vscode/cspell.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@
9090
"sdk/translation/azure-ai-translation-document/samples/assets/**",
9191
"sdk/translation/azure-ai-translation-document/tests/glossaries-valid.csv",
9292
"sdk/storage/azure-storage-blob/**",
93+
"sdk/storage/azure-storage-extensions/**",
9394
"sdk/ml/azure-ai-ml/azure/ai/ml/_restclient/**",
9495
"sdk/ml/azure-ai-ml/azure/ai/ml/_utils/_virtual_cluster_utils/_restclient/**",
9596
"sdk/ml/azure-ai-ml/azure/ai/ml/entities/_job/job_name_generator.py",

eng/.docsettings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ omitted_paths:
1414
- sdk/**/swagger/*
1515
- sdk/ml/azure-ai-ml/tests/*
1616
- sdk/vision/azure-ai-vision-imageanalysis/tests/*
17+
- sdk/storage/azure-storage-extensions/*
1718

1819
language: python
1920
root_check_enabled: True

eng/pipelines/templates/steps/build-package-artifacts.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,20 @@ steps:
7070
displayName: Update package properties with dev version
7171
condition: and(succeeded(),eq(variables['SetDevVersion'],'true'))
7272

73+
- script: |
74+
sudo apt-get update
75+
sudo apt-get install -y qemu-user-static
76+
sudo update-binfmts --enable qemu-aarch64
77+
displayName: 'Install QEMU Dependencies'
78+
condition: and(succeeded(), eq(variables['Agent.OS'], 'Linux'))
79+
7380
- pwsh: |
7481
sdk_build -d "$(Build.ArtifactStagingDirectory)" "$(TargetingString)" --service=${{parameters.ServiceDirectory}} --inactive
7582
displayName: 'Generate Packages'
7683
condition: succeededOrFailed()
84+
timeoutInMinutes: 80
85+
env:
86+
CIBW_BUILD_VERBOSITY: 3
7787
7888
- script: |
7989
pip install twine==4.0.2

sdk/conftest.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@
2626
import os
2727
import pytest
2828

29-
from devtools_testutils import environment_variables, recorded_test, test_proxy, variable_recorder
30-
from devtools_testutils.preparers import AbstractPreparer
31-
3229

3330
def pytest_configure(config):
3431
# register an additional marker
@@ -55,7 +52,12 @@ def pytest_runtest_setup(item):
5552
@pytest.fixture(scope="session", autouse=True)
5653
def clean_cached_resources():
5754
yield
58-
AbstractPreparer._perform_pending_deletes()
55+
try:
56+
from devtools_testutils.preparers import AbstractPreparer
57+
AbstractPreparer._perform_pending_deletes()
58+
except ImportError:
59+
print("Failed to clean up due to missing azure-sdk-tools dependency. \
60+
For proper cleanup, install the azure-sdk-tools package from this repo.")
5961

6062

6163
@pytest.hookimpl(tryfirst=True, hookwrapper=True)
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Release History
2+
3+
## 1.0.0b1 (Unreleased)
4+
5+
Initial release.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Copyright (c) Microsoft Corporation.
2+
3+
MIT License
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Extension package for Azure Storage Python libraries
2+
This package contains a set of C-Extension modules intended to be used with the other Azure Storage Python SDK libraries.
3+
4+
## Getting started
5+
6+
### Prerequisites
7+
* Python 3.8 or later is required to use this package. For more details, please read our page on [Azure SDK for Python version support policy](https://github.com/Azure/azure-sdk-for-python/wiki/Azure-SDKs-Python-version-support-policy).
8+
9+
### Install the package
10+
This package is not meant to be used standalone and is meant to accompany other Azure Storage Python SDK libraries. However it can be installed and used standalone as well.
11+
12+
Install the Azure Storage Extensions library for Python with [pip](https://pypi.org/project/pip/):
13+
14+
```bash
15+
pip install azure-storage-extensions
16+
```
17+
18+
Please note that this package contains [C-Extension modules](https://docs.python.org/3/extending/extending.html) and therefore you must install the correct wheel for your
19+
particular platform. We distribute many pre-built wheels for a wide variety of platforms on PyPi and `pip` will attempt to install the wheel meant for your platform. If
20+
however, a wheel is not available for your platform, we also distribute the source code on PyPi so `pip` will attempt to build the module at install time, assuming you have
21+
a compiler available. If you encounter any issues installing this package, please feel to open an Issue.
22+
23+
## Extensions
24+
This section contains the list of available extensions and how to use them.
25+
26+
### Storage CRC64
27+
The `crc64` extension provides an implementation of the CRC64 algorithm, including the custom polynomial, that is used by the Azure Storage service. It can be used to compute
28+
the crc64 hash of `bytes` data, including given an initial hash.
29+
30+
```py
31+
from azure.storage.extensions import crc64
32+
33+
data = b'Hello World!'
34+
result = crc64.compute_crc64(data, 0)
35+
36+
# Chain together calculations
37+
data2 = b'Goodbye World!`
38+
result2 = crc64.compute_crc64(data2, result)
39+
```
40+
41+
## Contributing
42+
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.
43+
44+
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
45+
46+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.

sdk/storage/azure-storage-extensions/azure/storage/extensions/__init__.py

Whitespace-only changes.

0 commit comments

Comments
 (0)