FFY00 / trampolim

A modern Python build backend
https://trampolim.readthedocs.io
MIT License
43 stars 4 forks source link

Version 0.0.4 doesn't support dynamic version #18

Closed henryiii closed 3 years ago

henryiii commented 3 years ago

Upgrading to 0.0.4 breaks the dynamic version using TRAMPOLIM_VCS_VERSION:

Processing /Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/tmp/cookie-trampolim
  DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
   pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'error'
    ERROR: Command errored out with exit status 1:
     command: /Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/bin/python /Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py prepare_metadata_for_build_wheel /tmp/tmpbyha2ong
         cwd: /private/tmp/pip-req-build-cqa182lv
    Complete output (23 lines):
    Traceback (most recent call last):
      File "/Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 143, in prepare_metadata_for_build_wheel
        hook = backend.prepare_metadata_for_build_wheel
    AttributeError: module 'trampolim' has no attribute 'prepare_metadata_for_build_wheel'

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 349, in <module>
        main()
      File "/Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 331, in main
        json_out['return_val'] = hook(**hook_input['kwargs'])
      File "/Users/henryschreiner/git/scikit-hep/cookie/.nox/tests-trampolim/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 147, in prepare_metadata_for_build_wheel
        whl_basename = backend.build_wheel(metadata_directory, config_settings)
      File "/private/tmp/pip-build-env-osr5lkga/overlay/lib/python3.9/site-packages/trampolim/__init__.py", line 62, in build_wheel
        builder.build(wheel_directory)
      File "/private/tmp/pip-build-env-osr5lkga/overlay/lib/python3.9/site-packages/trampolim/_wheel.py", line 38, in build
        whl.writestr(f'{whl.dist_info_path}/METADATA', bytes(self._project._meta.as_rfc822()))
      File "/private/tmp/pip-build-env-osr5lkga/overlay/lib/python3.9/site-packages/pep621.py", line 243, in as_rfc822
        self.write_to_rfc822(message)
      File "/private/tmp/pip-build-env-osr5lkga/overlay/lib/python3.9/site-packages/pep621.py", line 250, in write_to_rfc822
        raise ConfigurationError('Missing version field')
    pep621.ConfigurationError: Missing version field

See https://github.com/scikit-hep/cookie/pull/41/checks?check_run_id=3804995613

Pinning to trampolim 0.0.3 fixes the issue.

FFY00 commented 3 years ago

Thank you for reporting. I will issue a fix shortly and then tag a new release.

henryiii commented 3 years ago

I've removed all my workarounds, and this is the only failure on the current branch:

https://github.com/scikit-hep/cookie/pull/42/checks?check_run_id=3810405895

When running build, doing SDist -> wheel, it can't find the version, it seems to get lost rather than baked into the SDist. (I expect --sdist --wheel would work)

FFY00 commented 3 years ago

19 fixed the regression, but dynamic versioning is still broken when building via sdist as they lack the required metadata.

FFY00 commented 3 years ago

20 fixes that issue.

henryiii commented 3 years ago

This passes https://github.com/scikit-hep/cookie/pull/42 - just waiting on a tag & PyPI release (and maybe a GitHub release so that I get notified? ;) )

FFY00 commented 3 years ago

The PyPI release is already up, I forgot the tag :facepalm: