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

set [tool.setuptools] package-dir to force setuptools editables to append to sys.path #7804

Conversation

graingert
Copy link
Member

Closes #7782

  • Tests added / passed
  • Passes pre-commit run --all-files

@graingert graingert requested a review from fjetter as a code owner April 26, 2023 13:58
@@ -62,6 +62,7 @@ dask-worker = "distributed.cli.dask_worker:main"
[tool.setuptools]
include-package-data = true
zip-safe = false
package-dir = {"" = "."}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this causes setuptools to go down the same codepath as is_compat_mode:

https://github.com/pypa/setuptools/blob/e94cb204693cee145ea531905dd50b02a26c9f0a/setuptools/command/editable_wheel.py#L376-L378

        if set(self.package_dir) == {""} and has_simple_layout or is_compat_mode:
            # src-layout(ish) is relatively safe for a simple pth file
            src_dir = self.package_dir.get("", ".")

@fjetter
Copy link
Member

fjetter commented Apr 26, 2023

I'm OK with this fix for now. @graingert offline we discussed briefly why the repo is not detected as simple. Can you summarize this here briefly for prosperity in case this hack fails us?

@graingert
Copy link
Member Author

graingert commented Apr 26, 2023

@fjetter ah it's no good, this breaks include-package-data=True and so distributed.yaml does not get included in the built wheel

@graingert graingert closed this Apr 26, 2023
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

Successfully merging this pull request may close these issues.

namespace packages take priority over setuptools PEP 660 editables in lenient mode
2 participants