-
Notifications
You must be signed in to change notification settings - Fork 112
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
Configurable "build" directory? #446
Comments
I think that is a behavior of setuptools, not us. |
That makes sense; I couldn't find a direct reference to the build directory in It looks like |
|
I'd generally specify the directories for tools - tell pytest to only look in tests, mypy to only look in source (and/or tests), etc. Fighting the normal directory structure is likely to confuse users who are familiar with setuptools but are not familiar with the setup you are trying to enforce. You often don't want mypy looking at your tests, pytest looking at your source, anything looking at your docs, etc. [tool.mypy]
files = "src"
[tool.pytest.ini_options]
testpaths = [
"tests",
] Also, most tools stop at the outer directory, because it doesn't have an |
No luck, unfortunately; that produces:
I also tried
This is mostly a self-inflicted problem on my part, I'll admit 😅. But I work on a large codebase with multiple Python packages in a monorepo, and with each QA/testing/etc. tool enabled and configured on a per-directory basis (i.e., each directly has both |
Are you sure the setuptools option is called |
Here's what I see with
I'll try doing the build directly now and see if one of those other options has an effect. |
Okay, I confirmed that this: $ python3 setup.py build --build-base ~/tmp/pybuild ...copies everything into |
$ python3 setup.py bdist_wheel --bdist-dir ~/tmp/pybuild ...still produces |
Well, if the option is only valid for the build command, it won't work with build - the setuptools backend is not able to discriminate between options for different commands. |
I looked into this briefly, and fwiw setuptools' |
I'll close this since it's not related to build. You can track pypa/wheel#447. |
HI there! Thanks a ton for maintaining this tool; it's a real pleasure to use.
When running
python -m build
, I can pass--outdir /somewhere/else
to control wherebuild
will place the completed distribution files (i.e., instead of$SOURCE/dist/
).However
build
(or something else it uses) still produces abuild
directory in the source root, with the following structure:...where
lib
contains the entire package source tree forsome-pkg
. This in turn causes problems for a variety of tools in the Python ecosystem:pytest
automatically discovers bothbuild
and the "real" source tree and exits with an error, complaining about duplicate modules.mypy
attempts to lint both and errors for the same reason (duplicate__init__.py
s).bellybutton
and other QA tools see a "new" source tree, and can't apply their allow/denylists correctlyEach of these has an individual knob/configuration option for fixing the problem, but this causes an
N*M
configuration issue: a source tree withN
Python packages withM
tools requiresN*M
individual configuration changes.Ideally (for my use case),
build
would be about to do one of the following:--builddir
to control the placement of thebuild/
directory.--cleanup
(or similar) option to automatically remove any build directories after all distributions are builtThe text was updated successfully, but these errors were encountered: