Azure / azure-sdk-for-python

This repository is for active development of the Azure SDK for Python. For consumers of the SDK we recommend visiting our public developer docs at https://learn.microsoft.com/python/azure/ or our versioned developer docs at https://azure.github.io/azure-sdk-for-python.
MIT License
4.55k stars 2.77k forks source link

error: error in setup.cfg: command 'bdist_wheel' has no such option 'azure_namespace_package' #12612

Closed kappa closed 3 years ago

kappa commented 4 years ago

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.

kappa commented 4 years ago

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.

kaerm commented 4 years ago

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

lmazuel commented 4 years ago

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!

lmazuel commented 4 years ago

@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:

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

LianwMS commented 4 years ago

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

kappa commented 4 years ago

@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.

LianwMS commented 4 years ago

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

kappa commented 4 years ago

@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

LianwMS commented 4 years ago

@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

kappa commented 4 years ago

@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.

kappa commented 4 years ago

@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.

LianwMS commented 4 years ago

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.

RodgeFu commented 4 years ago

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

LianwMS commented 3 years ago

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

kappa commented 3 years ago

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

LianwMS commented 3 years ago

@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.

kappa commented 3 years ago

@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.

LianwMS commented 3 years ago

Add @yungezz here for CLI question.

yungezz commented 3 years ago

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.

lmazuel commented 3 years ago

Closing since issue is fixed and/or monitored elsewherre. The root cause has been removed for years now anyway (we don't patch wheel anymore to produce our wheel, hence any version of wheel works)