azure-sdk-for-python icon indicating copy to clipboard operation
azure-sdk-for-python copied to clipboard

Swap to `python -m build` instead of `python setup.py <format>`

Open scbedd opened this issue 3 years ago • 7 comments

As warned in our CI, we really needed to modernize how we produce our wheels/sdists.

Unfortunately, it looks like I'm going to need to add a post-step that unzips the tar.gz and rezips it if we want to continue publishing our sdists as zip. Unfortunately, unlike python setup.py, it doesn't look like build honors --format=sdist.

EDIT: found the official docs referencing the new requirement: https://packaging.python.org/en/latest/key_projects/#build, for anyone concerned about introducing a random build package 👍

  • [x] Check all tox environments
  • [x] This PR somehow destroys all the logging cleanup that I had finished with python setup.py. Need to resolve this before merging. python -m build is loud.
  • [x] Ensure that integration and pypi publishing still works
  • [x] Ensure that github.io and docs.ms productions still work

scbedd avatar Nov 16 '22 02:11 scbedd

I'm not super familiar with packaging -- though I'd like to learn -- but I do remember having read that setup.py was out of date. Are the failures in the current pipeline run expected from this change?

mccoyp avatar Nov 16 '22 08:11 mccoyp

Eventually, there definitely will be failures. I'll ask Laurent at scrum if we want to look into unzip/rezip. I believe that pip will install a tar.gz just fine, so we should be ok. I'll still get that verified though.

scbedd avatar Nov 17 '22 18:11 scbedd

/azp run python - core

scbedd avatar Nov 19 '22 00:11 scbedd

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 19 '22 00:11 azure-pipelines[bot]

/azp run python - template

scbedd avatar Nov 21 '22 21:11 scbedd

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Nov 21 '22 21:11 azure-pipelines[bot]

I am going to wait to merge this until after the release week. Effectively, this means next week.

scbedd avatar Jan 03 '23 23:01 scbedd

Due to the fact that we will be using python setup.py until we migrate to pyproject.toml, I am closing this PR. It is ready to go.

scbedd avatar Jan 05 '23 21:01 scbedd