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

Source distribution tarballs on pypi do not contain README.md, causing hatch-fancy-pypi-readme plugin to fail #482

Open
charles-dyfis-net opened this issue Apr 29, 2024 · 0 comments

Comments

@charles-dyfis-net
Copy link

The source distributions published to pypi presently cannot be built; attempts fail with:

Processing /private/tmp/nix-build-python3.12-anthropic-0.25.7.drv-0/anthropic-0.25.7
  Running command Preparing metadata (pyproject.toml)
  Traceback (most recent call last):
    File "/nix/store/brnl7k3jxym5gyla9yh05xz5c4vhn1rz-python3.12-pip-23.2.1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
      main()
    File "/nix/store/brnl7k3jxym5gyla9yh05xz5c4vhn1rz-python3.12-pip-23.2.1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
      json_out['return_val'] = hook(**hook_input['kwargs'])
                               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/brnl7k3jxym5gyla9yh05xz5c4vhn1rz-python3.12-pip-23.2.1/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 152, in prepare_metadata_for_build_wheel
      whl_basename = backend.build_wheel(metadata_directory, config_settings)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/build.py", line 56, in build_wheel
      return os.path.basename(next(builder.build(wheel_directory, ['standard'])))
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/builders/plugin/interface.py", line 93, in build
      self.metadata.validate_fields()
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 243, in validate_fields
      _ = self.version
          ^^^^^^^^^^^^
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 128, in version
      self._version = self._get_version()
                      ^^^^^^^^^^^^^^^^^^^
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 222, in _get_version
      core_metadata = self.core
                      ^^^^^^^^^
    File "/nix/store/w6r9jmj192v8mwga0zll0wq0kw02xnvn-python3.12-hatchling-1.18.0/lib/python3.12/site-packages/hatchling/metadata/core.py", line 174, in core
      metadata_hook.update(self.core_raw_metadata)
    File "/nix/store/k3bq3xc58ajs29rlwcxyi1mi309wl3p7-python3.12-hatch-fancy-pypi-readme-23.1.0/lib/python3.12/site-packages/hatch_fancy_pypi_readme/hooks.py", line 24, in update
      config = load_and_validate_config(self.config)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/nix/store/k3bq3xc58ajs29rlwcxyi1mi309wl3p7-python3.12-hatch-fancy-pypi-readme-23.1.0/lib/python3.12/site-packages/hatch_fancy_pypi_readme/_config.py", line 56, in load_and_validate_config
      raise ConfigurationError(errs)
  hatch_fancy_pypi_readme.exceptions.ConfigurationError: ["Fragment file 'README.md' not found."]
  error: subprocess-exited-with-error

  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

Inspecting the tarball to list non-.py content shows only:

$ tar -tzf anthropic-0.25.7.tar.gz | grep -v '[.]py'
anthropic-0.25.7/src/anthropic/py.typed
anthropic-0.25.7/src/anthropic/tokenizer.json
anthropic-0.25.7/src/anthropic/lib/.keep
anthropic-0.25.7/.gitignore
anthropic-0.25.7/LICENSE
anthropic-0.25.7/pyproject.toml
anthropic-0.25.7/PKG-INFO

Notably, there is indeed no README.md file present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant