Skip to content

Embed default html templates#87

Merged
ryanking13 merged 9 commits intopyodide:mainfrom
ryanking13:test-template
May 10, 2023
Merged

Embed default html templates#87
ryanking13 merged 9 commits intopyodide:mainfrom
ryanking13:test-template

Conversation

@ryanking13
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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...

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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