0

I currently build my simple Python module with a command like:

python3 -m build --wheel --outdir /tmp .

This creates the /tmp/mypackage-0.1-py3-none-any.whl -- as one would expect. However, it also creates the myproject.egg-info/ and build/ subdirectories in the project directory (next to the pyproject.toml), which I find annoying -- it should be possible for the project directory to be read-only.

The python3.11 -m build --help does not list any options, that'd allow to specify a different path for the transient files/folders. Is there some undocumented method, perhaps?

5
  • I guess it might up to the "build backend" of the project you are trying to build. Do you happen to know what is the build backend? Is it setuptools, poetry-core, flit, hatchling, or something else? Commented Jun 12 at 18:29
  • I don't specify any backend explicitly, which seems to mean, setuptools is used, right? I suppose, I can switch -- but I'd rather avoid anything "exotic" (which would have to be installed too). Commented Jun 12 at 18:37
  • 1
    OK, seems like it is still not possible with setuptools. Many issues opened, like this one: github.com/pypa/setuptools/issues/3237 Commented Jun 12 at 19:35
  • Sigh, Ok... Make this an answer, and I'll accept it... Commented Jun 12 at 20:32
  • Look into other build backends than setuptools. Maybe one fits your needs better. Nowadays, setuptools is far from being the "best one", and for sure it is not the only one. -- Feel free to write the answer yourself based on my comments and accept this answer. Commented Jun 12 at 21:12

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.