I'm trying to build a Flask + React application where the React client is built, moved into the python directory, and packaged as static files within a wheel build from the Flask package with pip wheel . --no-deps.
The file structure looks like this:
* client/
* server/
* my_project/
* build/ -> static files generated by building the client
* app.py
* ... -> additional python files
* pyproject.toml
I was able to get this working with setup.py by generating a list of client files by parsing the build/ directory and creating a list of all filenames and adding the following to the setuptools.setup() call:
package_data={"my_project": client_files},
After moving to pyproject.toml, I can only get it to package:
just the python files:
...
[tool.setuptools]
packages = ["my_project"]
[tool.setuptools.package-data]
build = ["*.*"]
or
just the client files:
...
[tool.setuptools.packages.find]
where = ["my_project"]
I also can't get the behavior to change at all using a MANIFEST.in file.