Update packaging without azure bdist wheel (#507)

* Update packaging without azure bdist wheel

* Add forgotten exclude keyword

* Force reinstall not needed anymore

* nspkg 3.1.0

* Travis nspkg system

* Ignore env* folders

* nspkg typo

* Fix travis typo

* Include pkgutil files in the sdist only
This commit is contained in:
Laurent Mazuel 2018-10-03 13:54:53 -07:00 коммит произвёл Ze Qian Zhang
Родитель d5dd9756fa
Коммит c773644c7e
34 изменённых файлов: 81 добавлений и 288 удалений

4
.gitignore поставляемый
Просмотреть файл

@ -3,7 +3,7 @@ __pycache__/
*.pyc
# Virtual environment
env/
env*/
venv*/
# PTVS analysis
@ -23,7 +23,7 @@ build/
# Test results
TestResults/
# Credentials
# Credentials
testsettings_local.json
settings_real.py

Просмотреть файл

@ -33,11 +33,11 @@ install:
- pip install codecov
- pip install coverage
- pip install -r requirements.txt
- if [[ "$TRAVIS_PYTHON_VERSION" == "2.7" ]]; then pip install -e azure-storage-nspkg; fi; # Would work on Python 3, but will not be installed by PyPI. Trying to be close to real life.
- pip install -e azure-storage-common
- pip install -e azure-storage-blob
- pip install -e azure-storage-file
- pip install -e azure-storage-queue
- pip install --force-reinstall azure-nspkg==1.0.0
script:
- coverage run -m unittest discover
after_success:

Просмотреть файл

@ -2,6 +2,10 @@
> See [BreakingChanges](BreakingChanges.md) for a detailed list of API breaks.
## Version 1.x.x:
- azure-storage-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
## Version 1.3.1:
- Fixed design flaw where get_blob_to_* methods buffer entire blob when max_connections is set to 1.
- Added support for access conditions on append_blob_from_* methods.
@ -28,7 +32,7 @@
## Version 1.0.0:
- The package has switched from Apache 2.0 to the MIT license.
- Fixed bug where get_blob_to_* cannot get a single byte when start_range and end_range are both equal to 0.
- Fixed bug where get_blob_to_* cannot get a single byte when start_range and end_range are both equal to 0.
- Optimized page blob upload for create_blob_from_* methods, by skipping the empty chunks.
- Added convenient method to generate container url (make_container_url).
- Metadata keys are now case-preserving when fetched from the service. Previously they were made lower-case by the library.

Просмотреть файл

@ -1,2 +1,3 @@
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/storage/__init__.py

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1,54 +0,0 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from distutils import log as logger
import os.path
from wheel.bdist_wheel import bdist_wheel
class azure_bdist_wheel(bdist_wheel):
"""The purpose of this class is to build wheel a little differently than the sdist,
without requiring to build the wheel from the sdist (i.e. you can build the wheel
directly from source).
"""
description = "Create an Azure wheel distribution"
user_options = bdist_wheel.user_options + \
[('azure-namespace-package=', None,
"Name of the deepest nspkg used")]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.azure_namespace_package = None
def finalize_options(self):
bdist_wheel.finalize_options(self)
if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"):
raise ValueError("azure_namespace_package must finish by -nspkg")
def run(self):
if not self.distribution.install_requires:
self.distribution.install_requires = []
self.distribution.install_requires.append(
"{}>=2.0.0".format(self.azure_namespace_package))
bdist_wheel.run(self)
def write_record(self, bdist_dir, distinfo_dir):
if self.azure_namespace_package:
# Split and remove last part, assuming it's "nspkg"
subparts = self.azure_namespace_package.split('-')[0:-1]
folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))]
for azure_sub_package in folder_with_init:
init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py')
if os.path.isfile(init_file):
logger.info("manually remove {} while building the wheel".format(init_file))
os.remove(init_file)
else:
raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file))
bdist_wheel.write_record(self, bdist_dir, distinfo_dir)
cmdclass = {
'bdist_wheel': azure_bdist_wheel,
}

Просмотреть файл

@ -1,3 +1,2 @@
[bdist_wheel]
universal=1
azure-namespace-package=azure-storage-nspkg

Просмотреть файл

@ -10,13 +10,6 @@ import sys
from setuptools import setup, find_packages
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
@ -68,16 +61,20 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(),
packages=find_packages(exclude=[
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.storage',
]),
install_requires=[
'azure-common>=1.1.5',
'azure-storage-common~=1.3'
],
'azure-common>=1.1.5',
'azure-storage-common~=1.3'
],
extras_require={
":python_version<'3.0'": ['futures'],
},
cmdclass=cmdclass
)

Просмотреть файл

@ -6,6 +6,8 @@
- When unable to sign request, avoid wasting time on retries by failing faster.
- Allow the use of custom domain when creating service object targeting emulators.
- azure-storage-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
## Version 1.3.0:

Просмотреть файл

@ -1,2 +1,3 @@
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/storage/__init__.py

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1,54 +0,0 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from distutils import log as logger
import os.path
from wheel.bdist_wheel import bdist_wheel
class azure_bdist_wheel(bdist_wheel):
"""The purpose of this class is to build wheel a little differently than the sdist,
without requiring to build the wheel from the sdist (i.e. you can build the wheel
directly from source).
"""
description = "Create an Azure wheel distribution"
user_options = bdist_wheel.user_options + \
[('azure-namespace-package=', None,
"Name of the deepest nspkg used")]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.azure_namespace_package = None
def finalize_options(self):
bdist_wheel.finalize_options(self)
if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"):
raise ValueError("azure_namespace_package must finish by -nspkg")
def run(self):
if not self.distribution.install_requires:
self.distribution.install_requires = []
self.distribution.install_requires.append(
"{}>=2.0.0".format(self.azure_namespace_package))
bdist_wheel.run(self)
def write_record(self, bdist_dir, distinfo_dir):
if self.azure_namespace_package:
# Split and remove last part, assuming it's "nspkg"
subparts = self.azure_namespace_package.split('-')[0:-1]
folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))]
for azure_sub_package in folder_with_init:
init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py')
if os.path.isfile(init_file):
logger.info("manually remove {} while building the wheel".format(init_file))
os.remove(init_file)
else:
raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file))
bdist_wheel.write_record(self, bdist_dir, distinfo_dir)
cmdclass = {
'bdist_wheel': azure_bdist_wheel,
}

Просмотреть файл

@ -1,3 +1,2 @@
[bdist_wheel]
universal=1
azure-namespace-package=azure-storage-nspkg

Просмотреть файл

@ -10,13 +10,6 @@ import sys
from setuptools import setup, find_packages
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
@ -68,15 +61,22 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(),
packages=find_packages(exclude=[
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.storage',
]),
install_requires=[
'azure-common>=1.1.5',
'cryptography',
'python-dateutil',
'requests',
],
cmdclass=cmdclass
'azure-common>=1.1.5',
'cryptography',
'python-dateutil',
'requests',
],
extras_require={
":python_version<'3.0'": ['azure-storage-nspkg'],
}
)

Просмотреть файл

@ -2,6 +2,10 @@
> See [BreakingChanges](BreakingChanges.md) for a detailed list of API breaks.
## Version 1.x.x:
- azure-storage-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
## Version 1.3.1:
- Fixed design flaw where get_file_to_* methods buffer entire file when max_connections is set to 1.

Просмотреть файл

@ -1,2 +1,3 @@
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/storage/__init__.py

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1,54 +0,0 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from distutils import log as logger
import os.path
from wheel.bdist_wheel import bdist_wheel
class azure_bdist_wheel(bdist_wheel):
"""The purpose of this class is to build wheel a little differently than the sdist,
without requiring to build the wheel from the sdist (i.e. you can build the wheel
directly from source).
"""
description = "Create an Azure wheel distribution"
user_options = bdist_wheel.user_options + \
[('azure-namespace-package=', None,
"Name of the deepest nspkg used")]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.azure_namespace_package = None
def finalize_options(self):
bdist_wheel.finalize_options(self)
if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"):
raise ValueError("azure_namespace_package must finish by -nspkg")
def run(self):
if not self.distribution.install_requires:
self.distribution.install_requires = []
self.distribution.install_requires.append(
"{}>=2.0.0".format(self.azure_namespace_package))
bdist_wheel.run(self)
def write_record(self, bdist_dir, distinfo_dir):
if self.azure_namespace_package:
# Split and remove last part, assuming it's "nspkg"
subparts = self.azure_namespace_package.split('-')[0:-1]
folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))]
for azure_sub_package in folder_with_init:
init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py')
if os.path.isfile(init_file):
logger.info("manually remove {} while building the wheel".format(init_file))
os.remove(init_file)
else:
raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file))
bdist_wheel.write_record(self, bdist_dir, distinfo_dir)
cmdclass = {
'bdist_wheel': azure_bdist_wheel,
}

Просмотреть файл

@ -1,3 +1,2 @@
[bdist_wheel]
universal=1
azure-namespace-package=azure-storage-nspkg

Просмотреть файл

@ -10,13 +10,6 @@ import sys
from setuptools import setup, find_packages
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
@ -68,16 +61,20 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(),
packages=find_packages(exclude=[
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.storage',
]),
install_requires=[
'azure-common>=1.1.5',
'azure-storage-common~=1.3'
],
'azure-common>=1.1.5',
'azure-storage-common~=1.3'
],
extras_require={
":python_version<'3.0'": ['futures'],
},
cmdclass=cmdclass
)

Просмотреть файл

@ -1 +1,3 @@
include *.rst
include azure/__init__.py
include azure/storage/__init__.py

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -0,0 +1 @@
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -26,7 +26,7 @@ except ImportError:
setup(
name='azure-storage-nspkg',
version='3.0.0',
version='3.1.0',
description='Microsoft Azure Storage Namespace Package [Internal]',
long_description=open('README.rst', 'r').read(),
license='MIT License',
@ -43,11 +43,11 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=[
'azure',
'azure.storage',
],
install_requires=[

Просмотреть файл

@ -2,6 +2,10 @@
> See [BreakingChanges](BreakingChanges.md) for a detailed list of API breaks.
## Version 1.x.x:
- azure-storage-nspkg is not installed anymore on Python 3 (PEP420-based namespace package)
## Version 1.3.0:
- Support for 2018-03-28 REST version. Please see our REST API documentation and blog for information about the related added features.

Просмотреть файл

@ -1,2 +1,3 @@
include *.rst
include azure_bdist_wheel.py
include azure/__init__.py
include azure/storage/__init__.py

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1 +1 @@
__import__('pkg_resources').declare_namespace(__name__)
__path__ = __import__('pkgutil').extend_path(__path__, __name__)

Просмотреть файл

@ -1,54 +0,0 @@
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#--------------------------------------------------------------------------
from distutils import log as logger
import os.path
from wheel.bdist_wheel import bdist_wheel
class azure_bdist_wheel(bdist_wheel):
"""The purpose of this class is to build wheel a little differently than the sdist,
without requiring to build the wheel from the sdist (i.e. you can build the wheel
directly from source).
"""
description = "Create an Azure wheel distribution"
user_options = bdist_wheel.user_options + \
[('azure-namespace-package=', None,
"Name of the deepest nspkg used")]
def initialize_options(self):
bdist_wheel.initialize_options(self)
self.azure_namespace_package = None
def finalize_options(self):
bdist_wheel.finalize_options(self)
if self.azure_namespace_package and not self.azure_namespace_package.endswith("-nspkg"):
raise ValueError("azure_namespace_package must finish by -nspkg")
def run(self):
if not self.distribution.install_requires:
self.distribution.install_requires = []
self.distribution.install_requires.append(
"{}>=2.0.0".format(self.azure_namespace_package))
bdist_wheel.run(self)
def write_record(self, bdist_dir, distinfo_dir):
if self.azure_namespace_package:
# Split and remove last part, assuming it's "nspkg"
subparts = self.azure_namespace_package.split('-')[0:-1]
folder_with_init = [os.path.join(*subparts[0:i+1]) for i in range(len(subparts))]
for azure_sub_package in folder_with_init:
init_file = os.path.join(bdist_dir, azure_sub_package, '__init__.py')
if os.path.isfile(init_file):
logger.info("manually remove {} while building the wheel".format(init_file))
os.remove(init_file)
else:
raise ValueError("Unable to find {}. Are you sure of your namespace package?".format(init_file))
bdist_wheel.write_record(self, bdist_dir, distinfo_dir)
cmdclass = {
'bdist_wheel': azure_bdist_wheel,
}

Просмотреть файл

@ -1,3 +1,2 @@
[bdist_wheel]
universal=1
azure-namespace-package=azure-storage-nspkg

Просмотреть файл

@ -10,13 +10,6 @@ import sys
from setuptools import setup, find_packages
try:
from azure_bdist_wheel import cmdclass
except ImportError:
from distutils import log as logger
logger.warn("Wheel is not available, disabling bdist_wheel hook")
cmdclass = {}
# azure v0.x is not compatible with this package
# azure v0.x used to have a __version__ attribute (newer versions don't)
@ -68,13 +61,17 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'License :: OSI Approved :: MIT License',
],
zip_safe=False,
packages=find_packages(),
packages=find_packages(exclude=[
# Exclude packages that will be covered by PEP420 or nspkg
'azure',
'azure.storage',
]),
install_requires=[
'azure-common>=1.1.5',
'azure-storage-common>=1.3.0,<1.4.0'
],
cmdclass=cmdclass
'azure-common>=1.1.5',
'azure-storage-common>=1.3.0,<1.4.0'
],
)