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

bug: using source-dir produces broken SDists #36

Closed
henryiii opened this issue Jun 24, 2021 · 3 comments
Closed

bug: using source-dir produces broken SDists #36

henryiii opened this issue Jun 24, 2021 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@henryiii
Copy link

Description

Using src dir makes broken SDists.

Steps to Reproduce

Use the following minimal pyproject.toml:

[tool.whey]
source-dir = "src"

[build-system]
requires = ["whey"]
build-backend = "whey"

[project]
name = "spam"
version = "0.1.0"

And the following "package":

$ mkdir src
$ mkdir src/spam
$ touch src/spam/__init__.py

Actual result:

Running build:

$ pipx run build

Dies when it tries to make the wheel out of the SDist (requires build 0.5+ with pypa/build#304 )

Traceback (most recent call last):
  File "/Users/henryschreiner/.local/pipx/.cache/a7836b47fd2acf2/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 280, in <module>
    main()
  File "/Users/henryschreiner/.local/pipx/.cache/a7836b47fd2acf2/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 263, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
  File "/Users/henryschreiner/.local/pipx/.cache/a7836b47fd2acf2/lib/python3.9/site-packages/pep517/in_process/_in_process.py", line 204, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
  File "/private/var/folders/_8/xtbws09n017fbzdx9dmgnyyr0000gn/T/build-env-ohg7b683/lib/python3.9/site-packages/whey/__init__.py", line 57, in build_wheel
    return foreman.build_wheel(build_dir=tmpdir, out_dir=wheel_directory, verbose=True)
  File "/private/var/folders/_8/xtbws09n017fbzdx9dmgnyyr0000gn/T/build-env-ohg7b683/lib/python3.9/site-packages/whey/foreman.py", line 145, in build_wheel
    return builder.build()
  File "/private/var/folders/_8/xtbws09n017fbzdx9dmgnyyr0000gn/T/build-env-ohg7b683/lib/python3.9/site-packages/whey/builder.py", line 764, in build_wheel
    self.copy_source()
  File "/private/var/folders/_8/xtbws09n017fbzdx9dmgnyyr0000gn/T/build-env-ohg7b683/lib/python3.9/site-packages/whey/builder.py", line 185, in copy_source
    for py_file in self.iter_source_files():
  File "/private/var/folders/_8/xtbws09n017fbzdx9dmgnyyr0000gn/T/build-env-ohg7b683/lib/python3.9/site-packages/whey/builder.py", line 167, in iter_source_files
    raise FileNotFoundError(f"Package directory '{self.config['package']}' not found.")
FileNotFoundError: Package directory 'spam' not found.

Forcing build to build the wheel from the source directly, and not the SDist, works correctly.

$ pipx run build --sdist --wheel

Expected result:

The SDist should not be broken.

Version

  • whey: 0.16
@henryiii
Copy link
Author

henryiii commented Jul 8, 2021

Any chance this can get looked at? Producing broken SDists is rather serious (though most users install from wheels). I can't add whey to scikit-hep/cookie unless it produces valid SDists when src folders are present.

@domdfcoding
Copy link
Member

Hi @henryiii, sorry for the delay. Can you try with 0.0.17? Should be fixed in that version

@henryiii
Copy link
Author

henryiii commented Jul 8, 2021

Yes, it works! Thanks!

@henryiii henryiii closed this as completed Jul 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants