-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Packaging/RPM} Remove unused *.pyo and *.pyc in RPM #14288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e6032a2
7328085
79858ec
507274a
f4bf0fd
92419d0
3b621af
1179438
da68d09
ac35f36
0f06480
85e13c0
b076c27
1bee368
363bd8f
ee39b7d
55bd44a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,10 @@ | ||
| # RPM spec file for Azure CLI | ||
| # Definition of macros used - https://fedoraproject.org/wiki/Packaging:RPMMacros?rd=Packaging/RPMMacros | ||
|
|
||
| %global __python %{__python3} | ||
| # Turn off python byte compilation | ||
fengzhou-msft marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| %global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the instruction from the Fedora Packaging Guideline. |
||
|
|
||
| # .el7.centos -> .el7 | ||
| %if 0%{?rhel} | ||
| %define dist .el%{?rhel} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| #!/usr/bin/env bash | ||
|
|
||
| # This script should be run in a centos8 docker. | ||
| set -exv | ||
|
|
||
| yum --nogpgcheck localinstall /mnt/yum/$YUM_NAME -y | ||
|
|
||
| yum install git -y | ||
|
|
||
| ln -s /usr/bin/python3 /usr/bin/python | ||
| ln -s /usr/bin/pip3 /usr/bin/pip | ||
| time az self-test | ||
| time az --version | ||
|
|
||
| cd /azure-cli/ | ||
| pip3 install wheel | ||
| ./scripts/ci/build.sh | ||
| pip3 install pytest --prefix /usr/lib64/az | ||
| pip3 install pytest-xdist --prefix /usr/lib64/az | ||
|
|
||
| find /azure-cli/artifacts/build -name "azure_cli_testsdk*" | xargs pip3 install --prefix /usr/lib64/az --upgrade --ignore-installed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. is it necessary to pin version also?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| find /azure-cli/artifacts/build -name "azure_cli_fulltest*" | xargs pip3 install --prefix /usr/lib64/az --upgrade --ignore-installed --no-deps | ||
|
|
||
| python3 /azure-cli/scripts/release/rpm/test_rpm_package.py | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| # -------------------------------------------------------------------------------------------- | ||
| # Copyright (c) Microsoft Corporation. All rights reserved. | ||
| # Licensed under the MIT License. See License.txt in the project root for license information. | ||
| # -------------------------------------------------------------------------------------------- | ||
|
|
||
| import os | ||
| import sys | ||
| import subprocess | ||
|
|
||
| root_dir = '/usr/lib64/az/lib/python3.6/site-packages/azure/cli/command_modules' | ||
| mod_list = [mod for mod in sorted(os.listdir(root_dir)) if os.path.isdir(os.path.join(root_dir, mod)) and mod != '__pycache__'] | ||
|
|
||
| pytest_base_cmd = 'PYTHONPATH=/usr/lib64/az/lib/python3.6/site-packages python3 -m pytest -x -v --boxed -p no:warnings --log-level=WARN' | ||
| pytest_parallel_cmd = '{} -n auto'.format(pytest_base_cmd) | ||
|
|
||
| for mod_name in mod_list: | ||
| if mod_name in ['botservice', 'network']: | ||
| exit_code = subprocess.call(['{} --junit-xml /azure_cli_test_result/{}.xml --pyargs azure.cli.command_modules.{}'.format(pytest_base_cmd, mod_name, mod_name)], shell=True) | ||
| else: | ||
| exit_code = subprocess.call(['{} --junit-xml /azure_cli_test_result/{}.xml --pyargs azure.cli.command_modules.{}'.format(pytest_parallel_cmd, mod_name, mod_name)], shell=True) | ||
| if exit_code == 5: | ||
| print('No tests found for {}'.format(mod_name)) | ||
| elif exit_code != 0: | ||
| sys.exit(exit_code) | ||
|
|
||
| exit_code = subprocess.call(['{} --junit-xml /azure_cli_test_result/azure-cli-core.xml --pyargs azure.cli.core'.format(pytest_parallel_cmd)], shell=True) | ||
| sys.exit(exit_code) |
Uh oh!
There was an error while loading. Please reload this page.