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

Embed default html templates #87

Merged
merged 9 commits into from
May 10, 2023
Merged

Conversation

ryanking13
Copy link
Member

This embeds test.html and module_test.html into pytest-pyodide wheel. So we don't need to bundle them into pyodide distribution.

Additional context : I found that pyodide-core archive does not contain these test templates... which make it hard for me to run tests with pyodide-core. Anyway, I think it is better to remove test templates from pyodide distribution.

@ryanking13
Copy link
Member Author

@hoodmane @rth Can I ask for a review for this when you have time?

BTW, this PR also adds empty __init__.py file to make setuptools happy (pyodide/pyodide#3814 (comment))

Copy link
Member

@hoodmane hoodmane left a comment

Choose a reason for hiding this comment

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

Looks good to me.

Copy link
Member

Choose a reason for hiding this comment

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

Why do we have this? This _templates directory is not a submodule, it has data files.

Copy link
Member Author

@ryanking13 ryanking13 May 10, 2023

Choose a reason for hiding this comment

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

As I mentioned here, I wasn't able to make packages: find to locate data files in subdirectories correctly. So I added __init__.py as a hack to make setuptools add that directory to the wheel. I don't wanted to use packages = find_namespace: since it often adds unwanted directories to wheels when we are not careful.

Copy link
Member

Choose a reason for hiding this comment

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

Maybe we can get @henryiii to help...

Choose a reason for hiding this comment

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

It is the correct way to make it accessible to importlib.metadata. If you don't need that, then you can make it available via setting package_data. Though what do you think about just moving to hatchling or flit-core, which IMO are much easier to configure?

Copy link
Member

Choose a reason for hiding this comment

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

I am in favor of moving to a different build backend.

Copy link
Member Author

Choose a reason for hiding this comment

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

+1

Does hatchling or flit support auto versioning? We use setuptools-scm for versioning.
(TBH, I haven't used those build backends before)

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