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

fix: drop some no-longer-needed bits from pydodide build #3814

Merged
merged 1 commit into from
May 1, 2023

Conversation

henryiii
Copy link
Contributor

@henryiii henryiii commented May 1, 2023

Description

A few things here aren't really needed:

  • "wheel" is injected via a PEP 517 hook when building wheels for all versions of setuptools that support PEP 517.
  • LICENSE is already included, no need for a MANIFEST.in. You can compare SDist and Git via pipx run check-sdist.
  • Recent-ish versions of Pip and Setuptools now support editable installs without setup.py

Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
@henryiii
Copy link
Contributor Author

henryiii commented May 1, 2023

Why are namespace packages used? And where are they used?

@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

To be honest I'm not sure what a namespace package is. We're certainly not intentionally using them but we might be doing so accidentally.

@henryiii
Copy link
Contributor Author

henryiii commented May 1, 2023

It's a package without a __init__.py. Generally should only be used to combine multiple packages (like adding a.c to a.b from a different place on disk).

@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

And how do you tell that we're using one?

@henryiii
Copy link
Contributor Author

henryiii commented May 1, 2023

packages = find_namespace:
is what I saw that I prefer to avoid if possible.

@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

Looks like @ryanking13 added that in #3358. You can try switching it back to packages = find: and see if it breaks. Or we can wait for him to tell us what the reason was.

@henryiii
Copy link
Contributor Author

henryiii commented May 1, 2023

Yep, tools is missing a __init__.py. Namespace packages weren't created to avoid empty __init__.py's, they were created to allow packages to be split; you get collisions with __init__.py's without namespace packages. There are tradeoffs that have to be made with namespace packages. The better solution here would be to drop an __init__.py in these if you are using importlib.resources to access them. Or to treat them all as data.

@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

Hmm it's not clear to me why we need it. In the tests we add the tools directory to the path, but that should allow us to import modules from the directory. I don't see any instances of import tools or from tools import x or anything.

@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

Thanks @henryiii!

@hoodmane hoodmane merged commit 1ee9915 into pyodide:main May 1, 2023
@hoodmane
Copy link
Member

hoodmane commented May 1, 2023

Hopefully we can fix the namespace packages in a followup.

@henryiii henryiii deleted the henryiii/chore/setupdrop branch May 1, 2023 21:42
@ryanking13
Copy link
Member

The better solution here would be to drop an init.py in these if you are using importlib.resources to access them.

Sounds good to me. We don't access files in tools directory with importlib, but I always had bad experiences dealing with namespaces packages... so adding an empty __init__.py then use packages = find: might be better.

@hoodmane
Copy link
Member

hoodmane commented May 2, 2023

If we don't import from it isn't the correct thing to indicate that everything in the directory is data files?

@ryanking13
Copy link
Member

ryanking13 commented May 2, 2023

If we don't import from it isn't the correct thing to indicate that everything in the directory is data files?

That would be ideal, but I never made Subdirectory for data files + packages = find: combination successful. Probably someone who know setuptools better than me could try.

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.

3 participants