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

package HISTORY.rst #7831

Merged
merged 1 commit into from
Jul 29, 2024
Merged

Conversation

dimbleby
Copy link
Member

A pedantic packaging fix: probably not making a meaningful difference today but likely saving trouble in the future

packaging connectedk8s using the tooling recommended in current python packaging reveals that HISTORY.rst is not included in the sdist, and therefore not available for use by setup.py when building the wheel.

$ pip install build ; python -m build
<snipped output>
* Getting build dependencies for wheel...
Wheel is not available, disabling bdist_wheel hook
Traceback (most recent call last):
  File "/home/dch/.virtualenvs/foo/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 373, in <module>
    main()
  File "/home/dch/.virtualenvs/foo/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 357, in main
    json_out["return_val"] = hook(**hook_input["kwargs"])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/dch/.virtualenvs/foo/lib/python3.12/site-packages/pyproject_hooks/_in_process/_in_process.py", line 134, in get_requires_for_build_wheel
    return hook(config_settings)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-4bdqbk0w/lib/python3.12/site-packages/setuptools/build_meta.py", line 327, in get_requires_for_build_wheel
    return self._get_build_requires(config_settings, requirements=[])
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/build-env-4bdqbk0w/lib/python3.12/site-packages/setuptools/build_meta.py", line 297, in _get_build_requires
    self.run_setup()
  File "/tmp/build-env-4bdqbk0w/lib/python3.12/site-packages/setuptools/build_meta.py", line 497, in run_setup
    super().run_setup(setup_script=setup_script)
  File "/tmp/build-env-4bdqbk0w/lib/python3.12/site-packages/setuptools/build_meta.py", line 313, in run_setup
    exec(code, locals())
  File "<string>", line 45, in <module>
  File "<frozen codecs>", line 918, in open
FileNotFoundError: [Errno 2] No such file or directory: 'HISTORY.rst'

per https://github.com/pypa/setuptools/blob/08bd31115732ece3cca50bd93f338e1b90dead34/docs/userguide/miscellaneous.rst#controlling-files-in-the-distribution, setuptools includes certain files by default - eg README.md - and HISTORY.rst is not among them.

Therefore explicitly package HISTORY.rst, after which this works fine.

Copy link

azure-client-tools-bot-prd bot commented Jul 26, 2024

️✔️Azure CLI Extensions Breaking Change Test
️✔️Non Breaking Changes

Copy link

Hi @dimbleby,
Please write the description of changes which can be perceived by customers into HISTORY.rst.
If you want to release a new extension version, please update the version in setup.py as well.

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 26, 2024

Thank you for your contribution! We will review the pull request and get back to you soon.

@dimbleby
Copy link
Member Author

Please write the description of changes which can be perceived by customers into HISTORY.rst.

no customer-visible changes

@yonzhan
Copy link
Collaborator

yonzhan commented Jul 27, 2024

Please fix CI issues

@dimbleby
Copy link
Member Author

azdev style issues are obviously nothing to do with this pull request and it makes no sense to fix them as part of it

@zhoxing-ms zhoxing-ms merged commit 9a0599d into Azure:main Jul 29, 2024
19 of 20 checks passed
@dimbleby dimbleby deleted the connectedk8s-packaging-fix branch July 29, 2024 07:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants