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.
Signed-off-by: zhouzheng <[email protected]>
- Loading branch information
Showing
9 changed files
with
67 additions
and
44 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
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# install python3.8 | ||
sudo apt-get install python3.8 | ||
sudo apt-get install python3.8-venv | ||
|
||
# init env | ||
rm -rf $TMPDIR/venv-sdk | ||
python3.8 -m venv $TMPDIR/venv-sdk | ||
VIRTUAL_ENV=$TMPDIR/venv-sdk | ||
export VIRTUAL_ENV | ||
PATH="$VIRTUAL_ENV/bin:$PATH" | ||
export PATH | ||
python -m pip install -U pip | ||
python scripts/dev_setup.py -p azure-core | ||
echo "{}" >> $2 | ||
echo "[Generate] init success!!!" |
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
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,42 @@ | ||
import glob | ||
import os | ||
|
||
from subprocess import check_call | ||
|
||
from .change_log import main as change_log_main | ||
|
||
DEFAULT_DEST_FOLDER = "./dist" | ||
|
||
|
||
def create_package(name, dest_folder=DEFAULT_DEST_FOLDER): | ||
# a package will exist in either one, or the other folder. this is why we can resolve both at the same time. | ||
absdirs = [ | ||
os.path.dirname(package) | ||
for package in (glob.glob("{}/setup.py".format(name)) + glob.glob("sdk/*/{}/setup.py".format(name))) | ||
] | ||
|
||
absdirpath = os.path.abspath(absdirs[0]) | ||
check_call(["python", "setup.py", "bdist_wheel", "-d", dest_folder], cwd=absdirpath) | ||
check_call(["python", "setup.py", "sdist", "--format", "zip", "-d", dest_folder], cwd=absdirpath) | ||
|
||
|
||
def change_log_generate(package_name, last_version): | ||
from pypi_tools.pypi import PyPIClient | ||
|
||
client = PyPIClient() | ||
try: | ||
last_version[-1] = str(client.get_ordered_versions(package_name)[-1]) | ||
except: | ||
return " - Initial Release" | ||
else: | ||
return change_log_main(f"{package_name}:pypi", f"{package_name}:latest") | ||
|
||
|
||
def extract_breaking_change(changelog): | ||
log = changelog.split("\n") | ||
breaking_change = [] | ||
for i in range(0, len(log)): | ||
if log[i].find("Breaking changes") > -1: | ||
breaking_change = log[min(i + 2, len(log) - 1) :] | ||
break | ||
return sorted([x.replace(" - ", "") for x in breaking_change]) |
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