Azure-sdk-for-python: error: error in setup.cfg: command 'bdist_wheel' has no such option 'azure_namespace_package'

Created on 20 Jul 2020  路  19Comments  路  Source: Azure/azure-sdk-for-python

Describe the bug

I am trying to build the wheel for azure-cli and the build fails with the message
"error: error in setup.cfg: command 'bdist_wheel' has no such option 'azure_namespace_package'" in several dependant packages which I am trying to list here:

azure-mgmt-billing
azure-mgmt-applicationinsights
azure-mgmt-consumption
azure-mgmt-datalake-analytics
azure-mgmt-relay

To Reproduce

$ pip wheel --no-binary :all: azure-cli

Expected behavior

Environment summary

Building the wheel with "pip wheel" on Fedora 31 with python 3.7.7.

Additional context

I believe the issue is similar to https://github.com/Azure/azure-cli/issues/10232.

Mgmt Packaging customer-reported question

All 19 comments

The problem does not reproduce on master which means what's needed is to release new packages to pypi.org. For example, https://pypi.org/project/azure-mgmt-billing/ was last released more than 2 years ago.

Thanks @kappa for reporting this, adding @RodgeFu to take a look at this

Hi @kappa
This is a CLI bug related to some known packaging issues https://github.com/Azure/azure-cli/issues/8164

Moving your issue to the CLI repo.

Thanks!

@kappa Moving it back, the CLI has the same issue, but that's not what your issue is about :p

@RodgeFu @changlong-liu this means CLI is still using a version of SDK that contains the old packaging approach. This is a two steps fix:

  • Ensure that there is at least one version on PyPI with the new system for each of them (CLI could have pinned an old version). If not, release a new version (doesn't necessarily need regeneration, that's pure packaging)
  • Update the CLI to use more recent SDK

@kappa the short workaround is to downgrade wheel to 0.30.0 (if I remember correctly the problem started after 0.31.0)

@kappa , you mention that the issue cannot repo on master branch. So which branch are you using to repo?

@LianwMS here's what I did to test on master (testing on azure-mgmt-billing):

  1. Downloaded and unpacked https://github.com/Azure/azure-sdk-for-python/archive/master.zip.
  2. cd azure-sdk-for-python-master/sdk/billing/azure-mgmt-billing
  3. pip wheel --no-binary azure-mgmt-billing .
  4. (incorrectly was: 3. pip wheel --no-binary .)

^ This succeeds as opposed to:

  1. pip wheel --no-binary azure-mgmt-billing azure-mgmt-billing
  2. (incorrectly was: 1. pip wheel --no-binary azure-mgmt-billing)

This one fails because it uses the source from https://pypi.org/project/azure-mgmt-billing/#files which was published in March 2018.

Hope that helps.

@kappa, I tried your repo step. but both of command work: Here is some screenshot:
image
image

@LianwMS I am sorry, I didn't copy the command correctly, because "--no-binary" switch requires an argument.

Here's the correct repro command:

$ pip3 wheel --no-binary azure-mgmt-billing azure-mgmt-billing

Attaching the screenshot as well.
screen_$r_2020-07-22-001

@kappa, I tried repo steps you provided, it's correct. but It seems that only billing have the issue. other 4 you list cannot repo.
@languy, Could you explain more what's impact now? if we do not release new SDK, what will happened? Thanks

@LianwMS this is the output from my original command (building the wheel for azure-cli with dependencies) in the task:
https://gist.github.com/kappa/718802ed7e3bef53b5c49bd10c92558a

123 wheels built successfully and 5 failures for the packages I mentioned.

@LianwMS The reason why we don't see the errors when we build other packages individually is because the new packages are already released for them but azure-cli specifies old versions as dependencies. See:

pip wheel --no-binary azure-mgmt-applicationinsights azure-mgmt-applicationinsights

This is successful and build a wheel for azure-mgmt-applicationinsights-0.3.0 which was released in April 2020: https://pypi.org/project/azure-mgmt-applicationinsights/#history

But azure-cli depends on the version 0.1.1 of that package: https://github.com/Azure/azure-cli/blob/dev/src/azure-cli/requirements.py3.Linux.txt which is broken:

pip wheel --no-binary azure-mgmt-applicationinsights  azure-mgmt-applicationinsights~=0.1.1

Fails.

So, it seems that, we only need to release billing for new. Then Cli need update to the recent version. I will try to release billing first.

quick update: @LianwMS is working with Billing team on updating the swagger accordingly.

Hi @kappa , do you still have the issue? Are you developing azure-cli locally https://github.com/Azure/azure-cli/blob/dev/doc/configuring_your_machine.md? If yes, pls use azdev tool to setup environment. Or are you trying to use Azure CLI as end user? then pls follow official instruction guideline https://docs.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest

@LianwMS, yes, the issue is still there. It can be reproduced with:
$ pip3 wheel --no-binary :all: azure-cli

@kappa, May I know why you need build it locally? There is another issues https://github.com/Azure/azure-cli-extensions/issues/1395 which is the same as this issue.

@LianwMS, thank you, yes, it looks exactly the same issue. Glad I am not alone.
We build everything locally because we need reproducible builds, cannot use pre-built packages.

Add @yungezz here for CLI question.

Hi @kappa is it ok to close this one while track the error in https://github.com/Azure/azure-cli/issues/14416 since this is an azure-cli issue? thanks.

Was this page helpful?
0 / 5 - 0 ratings