Skip to content

Commit e847283

Browse files
authored
Merge pull request #359 from zezha-msft/wastore-master-10-4-2017
Wastore master to Azure master
2 parents df6aa46 + f56d34c commit e847283

File tree

897 files changed

+126928
-157454
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

897 files changed

+126928
-157454
lines changed

.coveragerc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[run]
2+
branch = True
3+
include =
4+
azure*
5+
omit =
6+
azure-storage-nspkg

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,7 @@ src/build
5353

5454
# Azure deployment credentials
5555
*.pubxml
56+
57+
# code coverage
58+
.coverage
59+
.cache/

.travis.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
dist: trusty
2+
sudo: required
3+
cache: pip
4+
language: python
5+
matrix:
6+
include:
7+
- os: linux
8+
python: "2.7"
9+
- os: linux
10+
python: "3.3"
11+
- os: linux
12+
python: "3.4"
13+
- os: linux
14+
python: "3.5"
15+
- os: linux
16+
python: "3.6"
17+
- os: linux
18+
python: "nightly"
19+
- os: linux
20+
python: "pypy3.5-5.8.0"
21+
- os: osx
22+
osx_image: xcode7.3
23+
language: generic
24+
allow_failures:
25+
- os: osx
26+
- python: "3.3"
27+
- python: "pypy3.5-5.8.0"
28+
- python: "nightly"
29+
fast_finish: true
30+
# Perform the manual steps on osx to install python3 and activate venv
31+
before_install:
32+
- if [[ -n "$TRAVIS_TAG" && "$TRAVIS_PYTHON_VERSION" != "3.6" ]]; then travis_terminate 0; fi; # Deploy on 3.6
33+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update; fi
34+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3; fi
35+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then python3 -m venv venv; fi
36+
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then source venv/bin/activate; fi
37+
install:
38+
- pip install -U pip
39+
- pip install codecov
40+
- pip install coverage
41+
- pip install -r requirements.txt
42+
- pip install -e azure-storage-common
43+
- pip install -e azure-storage-blob
44+
- pip install -e azure-storage-file
45+
- pip install -e azure-storage-queue
46+
- pip install --force-reinstall azure-nspkg==1.0.0
47+
script:
48+
- coverage run -m unittest discover
49+
after_success:
50+
- coverage report
51+
- codecov
52+
notifications:
53+
webhooks:
54+
urls:
55+
- https://outlook.office.com/webhook/a4aad5a1-3f32-42c8-8a5e-903446565be3@72f988bf-86f1-41af-91ab-2d7cd011db47/TravisCI/a018a63e5e994165a2a56b0dd4c62120/3d491bab-ac74-4d43-aeeb-f4b674cb5466
56+
on_success: never # default: always
57+
on_failure: always # default: always
58+
on_start: never # default: never
59+
on_cancel: always # default: always
60+
on_error: always # default: always

BreakingChanges.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,25 @@
22

33
> See the [Change Log](ChangeLog.md) for a summary of storage library changes.
44
5+
**Note: This changelog is deprecated starting with version XX.XX.XX, please refer to the ChangeLog.md in each package for future change logs.**
6+
7+
## Version 0.37.0:
8+
9+
### All:
10+
- The library has been split into 5 different packages:
11+
- azure-storage-common
12+
- azure-storage-blob
13+
- azure-storage-file
14+
- azure-storage-queue
15+
- azure-storage-nspkg
16+
- azure.storage.table is now releasing under a different namespace: azure-cosmosdb-table. Please refer to github.com/Azure/azure-cosmosdb-python for more info.
17+
- The package `azure-storage` is now deprecated.
18+
- The classes that were directly under azure.storage, not under azure.storage.*(blob, file, queue), are now under azure.storage.common.
19+
- Example: azure.storage.retry becomes azure.storage.common.retry
20+
- The methods on the class SharedAccessSignature were moved into corresponding new subclasses in each service package.
21+
- Example: the methods generate_blob and generate_container were moved to BlobSharedAccessSignature in the blob package. BlobSharedAccessSignature inherits generate_account from SharedAccessSignature in common.
22+
- Please refer to the reference documentation for more info.
23+
524
## Version 0.34.0:
625

726
### All:

ChangeLog.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,32 @@
22

33
> See [BreakingChanges](BreakingChanges.md) for a detailed list of API breaks.
44
5+
**Note: This changelog is deprecated starting with version 0.37.0, please refer to the ChangeLog.md in each package for future change logs.**
6+
7+
## Version 0.37.0:
8+
9+
### All:
10+
- Added logging to the library, the name of the logger is 'azure.storage'. User must add handlers to the logger to output logs. Please refer to readme for more info.
11+
- Secondary endpoints may now be specified in connection strings, provided the corresponding primary endpoint is specified. See the connection string documentation for details.
12+
- Fixed an off-by-1 bug in exponential retry interval calculation.
13+
- The library has been split into 5 different packages:
14+
- azure-storage-common
15+
- azure-storage-blob
16+
- azure-storage-file
17+
- azure-storage-queue
18+
- azure-storage-nspkg
19+
- azure.storage.table is now releasing under a different namespace: azure-cosmosdb-table. Please refer to github.com/Azure/azure-cosmosdb-python for more info.
20+
- The package `azure-storage` is now deprecated.
21+
- The classes that were directly under azure.storage, not under azure.storage.*(blob, file, queue), are now under azure.storage.common.
22+
- Example: azure.storage.retry becomes azure.storage.common.retry
23+
- The methods on the class SharedAccessSignature were moved into corresponding new subclasses in each service package.
24+
- Example: the methods generate_blob and generate_container were moved to BlobSharedAccessSignature in the blob package. BlobSharedAccessSignature inherits generate_account from SharedAccessSignature in common.
25+
- Please refer to the reference documentation for more info.
26+
27+
### File:
28+
- Added support for creating and deleting share snapshots. See the new 'snapshot_share' method on FileService.
29+
- Most read operations (such as getting properties and metadata) now include an additional snapshot parameter.
30+
531
## Version 0.36.0:
632

733
### Blob:

README.rst

Lines changed: 93 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Microsoft Azure Storage SDK for Python
22
======================================
33

4+
.. image:: https://travis-ci.org/Azure/azure-storage-python.svg?branch=dev
5+
:target: https://travis-ci.org/Azure/azure-storage-python
6+
.. image:: https://img.shields.io/codecov/c/github/azure/azure-storage-python/dev.svg
7+
:target: https://codecov.io/gh/Azure/azure-storage-python/branch/dev
8+
49
This project provides a client library in Python that makes it easy to
510
consume Microsoft Azure Storage services. For documentation please see
611
the Microsoft Azure `Python Developer Center`_ and our `API Reference`_ Page.
@@ -32,9 +37,23 @@ If you see azure==0.11.0 (or any version below 1.0), uninstall it first then ins
3237
If you are upgrading from a version older than 0.30.0, see the upgrade doc, the
3338
usage samples in the samples directory, and the ChangeLog and BreakingChanges.
3439

35-
If you are encountering `problems`_ installing azure-storage on Azure Web Apps,
40+
If you are encountering `problems`_ installing azure storage on Azure Web Apps,
3641
`upgrading pip`_ might help.
3742

43+
**IMPORTANT**: If you have an earlier version of the azure-storage package
44+
(version <= 0.36.0), you should uninstall it before installing the new split packages.
45+
46+
You can check the version using pip:
47+
48+
.. code:: shell
49+
50+
pip freeze
51+
52+
If you see azure-storage==0.36.0 (or any version below 0.36.0), uninstall it first:
53+
54+
.. code:: shell
55+
56+
pip uninstall azure-storage
3857
3958
Features
4059
========
@@ -51,13 +70,6 @@ Features
5170
- Insert/Peek Queue Messages
5271
- Advanced Queue Operations
5372

54-
- Table
55-
56-
- Create/Read/Update/Delete Tables
57-
- Create/Read/Update/Delete Entities
58-
- Batch operations
59-
- Advanced Table Operations
60-
6173
- Files
6274

6375
- Create/Update/Delete Shares
@@ -71,13 +83,41 @@ Getting Started
7183
Download
7284
--------
7385

86+
The Azure Storage SDK for Python is composed of 5 packages:
87+
88+
- azure-storage-blob
89+
90+
- Contains the blob service APIs.
91+
92+
- azure-storage-file
93+
94+
- Contains the file service APIs.
95+
96+
- azure-storage-queue
97+
98+
- Contains the queue service APIs.
99+
100+
- azure-storage-common
101+
102+
- Contains common code shared by blob, file and queue.
103+
104+
- azure-storage-nspkg
105+
106+
- Owns the azure.storage namespace, user should not use this directly.
107+
108+
**Note**: prior to and including version 0.36.0, there used to be a single package (azure-storage) containing all services.
109+
It is no longer supported, and users should install the 3 before-mentioned service packages individually, depending on the need.
110+
In addition, the **table** package is no longer releasing under the azure-storage namespace, please refer to `cosmosdb`_.
111+
74112
Option 1: Via PyPi
75113
~~~~~~~~~~~~~~~~~~
76114

77115
To install via the Python Package Index (PyPI), type:
78116
::
79117

80-
pip install azure-storage
118+
pip install azure-storage-blob
119+
pip install azure-storage-file
120+
pip install azure-storage-queue
81121

82122
Option 2: Source Via Git
83123
~~~~~~~~~~~~~~~~~~~~~~~~
@@ -87,23 +127,28 @@ To get the source code of the SDK via git just type:
87127
::
88128

89129
git clone git://github.com/Azure/azure-storage-python.git
90-
cd ./azure-storage-python
130+
131+
cd ./azure-storage-python/azure-storage-nspkg
91132
python setup.py install
92133

93-
Option 3: Source Zip
94-
~~~~~~~~~~~~~~~~~~~~
134+
cd ../azure-storage-common
135+
python setup.py install
95136

96-
Download a zip of the code via GitHub or PyPi. Then, type:
137+
cd ../azure-storage-blob
138+
python setup.py install
97139

98-
::
99140

100-
cd ./azure-storage-python
101-
python setup.py install
141+
Replace azure-storage-blob with azure-storage-file or azure-storage-queue, to install the other services.
142+
143+
Option 3: Source Zip
144+
~~~~~~~~~~~~~~~~~~~~
145+
146+
Download a zip of the code via GitHub or PyPi. Then follow the same instructions in option 2.
102147

103148
Minimum Requirements
104149
--------------------
105150

106-
- Python 2.7, 3.3, 3.4, or 3.5.
151+
- Python 2.7, 3.3, 3.4, 3.5, or 3.6.
107152
- See setup.py for dependencies
108153

109154
Usage
@@ -112,10 +157,38 @@ Usage
112157
To use this SDK to call Microsoft Azure storage services, you need to
113158
first `create an account`_.
114159

160+
Logging
161+
-----------
162+
163+
To make debugging easier, it is recommended to turn on logging for the logger named 'azure.storage'.
164+
Here are two example configurations:
165+
166+
.. code:: python
167+
168+
# Basic configuration: configure the root logger, including 'azure.storage'
169+
logging.basicConfig(format='%(asctime)s %(name)-20s %(levelname)-5s %(message)s', level=logging.INFO)
170+
171+
.. code:: python
172+
173+
# More advanced configuration allowing more control
174+
logger = logging.getLogger('azure.storage')
175+
handler = logging.StreamHandler()
176+
formatter = logging.Formatter('%(asctime)s %(name)-20s %(levelname)-5s %(message)s')
177+
handler.setFormatter(formatter)
178+
logger.addHandler(handler)
179+
logger.setLevel(logging.INFO)
180+
181+
Here is how we use the logging levels, it is recommended to use INFO:
182+
183+
- DEBUG: log strings to sign
184+
- INFO: log outgoing requests and responses, as well as retry attempts
185+
- WARNING: not used
186+
- ERROR: log calls that still failed after all the retries
187+
115188
Code Sample
116189
-----------
117190

118-
See the samples directory for blob, queue, table, and file usage samples.
191+
See the samples directory for blob, queue, and file usage samples.
119192

120193
Need Help?
121194
==========
@@ -154,4 +227,5 @@ Learn More
154227
.. _Azure Storage Team Blog: http://blogs.msdn.com/b/windowsazurestorage/
155228
.. _CONTRIBUTING.md doc: CONTRIBUTING.md
156229
.. _problems: https://github.com/Azure/azure-storage-python/issues/219
157-
.. _upgrading pip: https://docs.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service
230+
.. _upgrading pip: https://docs.microsoft.com/en-us/visualstudio/python/managing-python-on-azure-app-service
231+
.. _cosmosdb: https://github.com/Azure/azure-cosmosdb-python
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Breaking Changes azure-storage-blob
2+
3+
> See the [Change Log](ChangeLog.md) for a summary of storage library changes.

azure-storage-blob/ChangeLog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Change Log azure-storage-blob
2+
3+
> See [BreakingChanges](BreakingChanges.md) for a detailed list of API breaks.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
include *.rst
2-
exclude azure/__init__.py
32
include azure_bdist_wheel.py

0 commit comments

Comments
 (0)