Skip to content
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

Extensions do not return a version if packaged with the latest version of wheel #6441

Closed
noelbundick opened this issue May 28, 2018 · 4 comments
Assignees
Labels
Extensions `az extension` commands or extension infrastructure question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@noelbundick
Copy link
Contributor

Describe the bug
Extensions do not return a version if packaged with the latest version of wheel. I noticed that the extension command module was pinned to 0.30.0 in #6164, but the version returns null if extensions were built with the latest wheel

Ex: I build an extension using the VSTS Python build tools, which uses the Build Python wheels task. This appears to use the latest version of wheel, or at least one 0.31.0 or newer. This reproduces locally if using 0.31.1, but my older builds that were 0.30.0 properly return a version

On latest, when the wheel is built, there is no metadata.json in the noelbundick-0.0.x.dist-info folder, and as a result, I get the following output when I run az extension list:

[
  {
    "extensionType": "whl",
    "name": "noelbundick",
    "version": null
  }
]

To Reproduce

  1. Install my extension via
az extension add --source https://github.com/noelbundick/azure-cli-extension-noelbundick/releases/download/v0.0.5/noelbundick-0.0.5-py2.py3-none-any.whl
  1. List the files that were installed, noting that metadata.json is not present
ls ~/.azure/cliextensions/noelbundick/noelbundick-0.0.5.dist-info
  1. List installed extensions
az extension list

observe that the version is null

Expected behavior
I expect the version in the output to match the version contained in my setup.py (in this case, 0.0.5)

Environment summary
apt-get / 2.0.33 / Ubuntu 18.04 / WSL

@tjprescott tjprescott added Extensions `az extension` commands or extension infrastructure question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels May 29, 2018
@williexu
Copy link
Contributor

@noelbundick This is due to: pypa/wheel#195, which removed the metadata.json from generated files.

For now, we expect extensions to be built using either 0.29.0 or 0.30.0

@noelbundick
Copy link
Contributor Author

@williexu thanks for merging the docs PR!

Would you be open to a PR that pulls the version from *.dist-info/METADATA instead of the now-gone *.dist-info/metadata.json? That should cover both the pre 0.31.0 versions as well as latest

I'm new-ish to Python - so I'm unsure if I'm going to run into trouble there, or if that's a pretty safe change to investigate

@williexu
Copy link
Contributor

@noelbundick that should be fine, feel free to open a PR

@tjprescott
Copy link
Member

I believe this is fixed. If not, please open a new issue.

@haroldrandom haroldrandom added Extensions `az extension` commands or extension infrastructure question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Oct 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extensions `az extension` commands or extension infrastructure question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

4 participants