You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm confused about how setuptools chooses what to include when building from source. I'm working on creating packages with setuptools, and ran into an issue where I would make a change to a pyproject.toml, and not get the changes I expect, or do get the changes I expect, but also see the old config persist, even after wiping away the install location.
One instance of this occurred while I was trying to learn how to write a pyproject.toml, and I mistyped something.
I then run pip install --prefix <path> -vv ., see I made a mistake, and update to:
[tool.setuptools.package-dir]
mypkg = "src/mypkg"
I deleted the install prefix and reran the installation. However, I see both wrongname and mypkg in the install site-packages. I'd understand wrongname sticking around if I hadn't cleaned the install dir, but it will reappear every time. I see there's a build/ dir created during the build step that is retaining the wrongname pkg, and when I delete that dir, it no longer shows up in my installs, but I would think the build should be refreshed every time pyproject.toml is changed.
Should I be deleting build/ myself before updating pyproject.toml, or is this a case where some flag for pip/setuptools that is helpful to ensure the build is always fresh? Would using python -m build be the correct workaround?
Again, I'm learning how this works, and this gotcha caused me a lot of frustration, as my changes did not have an obvious result.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm confused about how setuptools chooses what to include when building from source. I'm working on creating packages with setuptools, and ran into an issue where I would make a change to a
pyproject.toml
, and not get the changes I expect, or do get the changes I expect, but also see the old config persist, even after wiping away the install location.One instance of this occurred while I was trying to learn how to write a
pyproject.toml
, and I mistyped something.I then run
pip install --prefix <path> -vv .
, see I made a mistake, and update to:I deleted the install prefix and reran the installation. However, I see both
wrongname
andmypkg
in the install site-packages. I'd understandwrongname
sticking around if I hadn't cleaned the install dir, but it will reappear every time. I see there's abuild/
dir created during the build step that is retaining thewrongname
pkg, and when I delete that dir, it no longer shows up in my installs, but I would think the build should be refreshed every timepyproject.toml
is changed.Should I be deleting
build/
myself before updatingpyproject.toml
, or is this a case where some flag for pip/setuptools that is helpful to ensure the build is always fresh? Would usingpython -m build
be the correct workaround?Again, I'm learning how this works, and this gotcha caused me a lot of frustration, as my changes did not have an obvious result.
Beta Was this translation helpful? Give feedback.
All reactions