forked from Azure/azure-sdk-for-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New packaging system for all packages
- Loading branch information
Showing
144 changed files
with
2,005 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include *.rst | ||
exclude azure/__init__.py | ||
include azure_wheel.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#------------------------------------------------------------------------- | ||
# 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 | ||
try: | ||
from wheel.bdist_wheel import bdist_wheel as original_bdist_wheel | ||
class bdist_wheel(original_bdist_wheel): | ||
|
||
description = "Create an Azure wheel distribution" | ||
|
||
user_options = original_bdist_wheel.user_options + \ | ||
[('azure-namespace-package=', None, | ||
"Name of the deepest nspkg used")] | ||
|
||
def initialize_options(self): | ||
original_bdist_wheel.initialize_options(self) | ||
self.azure_namespace_package = None | ||
|
||
def finalize_options(self): | ||
original_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)) | ||
original_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)) | ||
original_bdist_wheel.write_record(self, bdist_dir, distinfo_dir) | ||
cmdclass = { | ||
'bdist_wheel': bdist_wheel, | ||
} | ||
except ImportError: | ||
logger.warn("Wheel is not available, disabling bdist_wheel hook") | ||
cmdclass = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
azure-namespace-package=azure-nspkg | ||
|
||
[install] | ||
single-version-externally-managed=1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
include *.rst | ||
exclude azure/__init__.py | ||
exclude azure/mgmt/__init__.py | ||
include azure_wheel.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#------------------------------------------------------------------------- | ||
# 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 | ||
try: | ||
from wheel.bdist_wheel import bdist_wheel as original_bdist_wheel | ||
class bdist_wheel(original_bdist_wheel): | ||
|
||
description = "Create an Azure wheel distribution" | ||
|
||
user_options = original_bdist_wheel.user_options + \ | ||
[('azure-namespace-package=', None, | ||
"Name of the deepest nspkg used")] | ||
|
||
def initialize_options(self): | ||
original_bdist_wheel.initialize_options(self) | ||
self.azure_namespace_package = None | ||
|
||
def finalize_options(self): | ||
original_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)) | ||
original_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)) | ||
original_bdist_wheel.write_record(self, bdist_dir, distinfo_dir) | ||
cmdclass = { | ||
'bdist_wheel': bdist_wheel, | ||
} | ||
except ImportError: | ||
logger.warn("Wheel is not available, disabling bdist_wheel hook") | ||
cmdclass = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
azure-namespace-package=azure-nspkg | ||
|
||
[install] | ||
single-version-externally-managed=1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
include *.rst | ||
exclude azure/__init__.py | ||
include azure_wheel.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#------------------------------------------------------------------------- | ||
# 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 | ||
try: | ||
from wheel.bdist_wheel import bdist_wheel as original_bdist_wheel | ||
class bdist_wheel(original_bdist_wheel): | ||
|
||
description = "Create an Azure wheel distribution" | ||
|
||
user_options = original_bdist_wheel.user_options + \ | ||
[('azure-namespace-package=', None, | ||
"Name of the deepest nspkg used")] | ||
|
||
def initialize_options(self): | ||
original_bdist_wheel.initialize_options(self) | ||
self.azure_namespace_package = None | ||
|
||
def finalize_options(self): | ||
original_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)) | ||
original_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)) | ||
original_bdist_wheel.write_record(self, bdist_dir, distinfo_dir) | ||
cmdclass = { | ||
'bdist_wheel': bdist_wheel, | ||
} | ||
except ImportError: | ||
logger.warn("Wheel is not available, disabling bdist_wheel hook") | ||
cmdclass = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
[bdist_wheel] | ||
universal=1 | ||
azure-namespace-package=azure-nspkg | ||
|
||
[install] | ||
single-version-externally-managed=1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
include *.rst | ||
exclude azure/__init__.py | ||
exclude azure/mgmt/__init__.py | ||
include azure_wheel.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#------------------------------------------------------------------------- | ||
# 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 | ||
try: | ||
from wheel.bdist_wheel import bdist_wheel as original_bdist_wheel | ||
class bdist_wheel(original_bdist_wheel): | ||
|
||
description = "Create an Azure wheel distribution" | ||
|
||
user_options = original_bdist_wheel.user_options + \ | ||
[('azure-namespace-package=', None, | ||
"Name of the deepest nspkg used")] | ||
|
||
def initialize_options(self): | ||
original_bdist_wheel.initialize_options(self) | ||
self.azure_namespace_package = None | ||
|
||
def finalize_options(self): | ||
original_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)) | ||
original_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)) | ||
original_bdist_wheel.write_record(self, bdist_dir, distinfo_dir) | ||
cmdclass = { | ||
'bdist_wheel': bdist_wheel, | ||
} | ||
except ImportError: | ||
logger.warn("Wheel is not available, disabling bdist_wheel hook") | ||
cmdclass = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
include *.rst | ||
exclude azure/__init__.py | ||
exclude azure/mgmt/__init__.py | ||
include azure_wheel.py |
Oops, something went wrong.