-
-
Notifications
You must be signed in to change notification settings - Fork 28
feat: Support custom package root #226
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
base: main
Are you sure you want to change the base?
Conversation
Allow tov-uv to recognize properly a custom package root if any, without enforcing to have pyproject.toml in the same directory of tox.ini Address issue tox-dev#220
for more information, see https://pre-commit.ci
@@ -112,7 +113,14 @@ def _setup_env(self) -> None: # noqa: C901 | |||
cmd.extend(("-p", self.env_version_spec())) | |||
|
|||
show = self.options.verbosity > 2 # noqa: PLR2004 | |||
outcome = self.execute(cmd, stdin=StdinSource.OFF, run_id="uv-sync", show=show) | |||
cwd = self.package_root() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be root
instead of cwd
.
@@ -310,6 +311,18 @@ def _py_info(self) -> PythonInfo: # pragma: win32 no cover | |||
extra={}, | |||
) | |||
|
|||
def package_root(self) -> Path: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be a cached property.
try: | ||
return self.core["package_root"] | ||
except KeyError: | ||
config = self.core["tox_root"] / "tox.ini" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be a lot more, than just ini, like toml and various other file sources we support.
@@ -168,6 +168,9 @@ overwritten by the VIRTUALENV_SYSTEM_SITE_PACKAGES environment variable. This fl | |||
We use `uv pip` to install packages into the virtual environment. The behavior of this can be configured via the | |||
following options: | |||
|
|||
tox-uv resolves your project location based on the `package_root` setting. If that option is not defined, it will fall |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't really want to publicize setupdir
, rather package_root
is what we should only advertise.
Allow tov-uv to recognize properly a custom package root if any, without enforcing to have pyproject.toml in the same directory of tox.ini
Address issue #220