Skip to content

Conversation

@fengzhou-msft
Copy link
Member

@fengzhou-msft fengzhou-msft commented Jul 9, 2020

Description

  1. Disable unnecessary byte compilation which generates the Python2-style pyc and pyo files in the same location as py files. The pyc files in __pycache__ for Python 3 is still generated.
  2. Add RPM package automation test in CI. RPM package is tested after it's built.

MSI changes moved to #14300

Testing Guide

Checked in the code in the build_test branch, the packages built and results of the RPM test script can be found here.

History Notes

[Component Name 1] BREAKING CHANGE: az command a: Make some customer-facing breaking change.
[Component Name 2] az command b: Add some customer-facing feature.


This checklist is used to make sure that common guidelines for a pull request are followed.

@fengzhou-msft fengzhou-msft marked this pull request as ready for review July 9, 2020 03:39
@fengzhou-msft fengzhou-msft self-assigned this Jul 9, 2020
@yungezz yungezz added this to the S172 milestone Jul 9, 2020
@Azure Azure deleted a comment from yonzhan Jul 9, 2020
@yungezz yungezz modified the milestones: S172, S173 Jul 9, 2020
@yungezz yungezz requested a review from arrownj July 9, 2020 04:38
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 != 0 and exit_code != 5: # exit code is 5 when there is no tests collected in the module
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when no tests found, it's better to at least stdout some message

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The extension module do not have tests. Extension tests are under azure-cli-core.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added message.

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it necessary to pin version also?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

azdev uses pytest>=4.4.0, which would always install the latest version in CI enviroment and achieves the same effect as no version specified.
Maybe we should first pin it in azdev to avoid breaking changes with pytest. @haroldrandom

https://github.com/Azure/azure-cli-dev-tools/blob/5284eaf69b90ab61cc251e55056b040209f12626/setup.py#L69

@Azure Azure deleted a comment from yonzhan Jul 9, 2020
@fengzhou-msft fengzhou-msft changed the title {Packaging} Reduce package size of MSI and RPM {Packaging/RPM} Remove unused *.pyo and *.pyc in RPM Jul 9, 2020

%global __python %{__python3}
# Turn off python byte compilation
%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Based on the instruction from the Fedora Packaging Guideline.

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 9, 2020

Packaging/RPM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants