-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[engsys] Migrate to tox4 #30159
[engsys] Migrate to tox4 #30159
Conversation
tox prepends the {env_bin_dir} to $PATH, so commands will default to using the virtual environment first. See: https://tox.wiki/en/4.4.11/config.html#commands One of tox's core maintainers also discourages its use: tox-dev/tox#2909 (comment)
Uses an inline plugin (toxfile.py) to make a computed config value avaiable to tox environments.
{toxinidir} is an alias for {tox_root}, but {tox_root} is: * More clear: {tox_root} isn't necessarily where the ini file is * Shorter
This is the default behavior, see: https://tox.wiki/en/4.4.11/config.html#change_dir-external
--ignore-installed can break a python installation if multiple conflicting versions of a package are installed
platform = linux: linux macos: darwin windows: win32 Setting the above in the base environment has no effect: * None of the environments have {linux,macos,windows} in the name, so the platform config is always empty.
tox4 natively solves what `tox-monorepo` was written to solve: `--root` lets you set `toxinidir` independently of the config file in use. 4.4.11 was chosen as the cutoff since it was the first release to include a fix to `--root` that prevented `{work_dir}` from being changed when `{toxinidir}` was changed by `--root`. `tox-monorepo` should no longer be needed
* References to tox-monorepo were removed * Replaced discussion of `tox -l` with tox4's `tox list` * Updated examples to use `--root`
…point to CONTRIBUTING.md for tox
* TOX_CONFIG_DIR can be used to permanently set --conf * TOX_ROOT_DIR can be used to permanently set --root
It was a long painful process of nailing down every single possible file lock. That's why you notice stuff like a different pip cache directory for each tox environment, etc. |
sdk/core/azure-core/tests/async_tests/test_rest_response_backcompat_async.py
Show resolved
Hide resolved
We're v close now! Just FYI we won't be merging this even if it's green until next week at the least. We're in a release window right now and I don't like to introduce any eng code changes around this time. Remaining issues and additional checks before we can merge this:
|
Nice!
Works for me, there's no rush on my end.
Wow, I would've imagined that it trivially satisfies that installation requirement (I think tox bootstraps itself into a virtualenv, but I may be wrong). |
At the end of the day it's just using |
I will run regression and nightly alpha checks tomorrow, then we will be in the clear to merge this next week! 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 |
@kdestin We are GREEN! Regress tests + nightly alpha versions all seem to be working appropriately! I'm a bit disturbed by the consistent credscan stack overflow, but I don't think that's related to this PR at all. Let's see where releases are come monday, then make an announcement and merge it! Thank you so much for all the effort on this @kdestin ! This is a gigantic necessary contribution that is not at all fun to slog through 👍 |
On detailed review over the weekend, I found one last issue. We have one outstanding issue with Remember, package is installed when we GENERATE the coverage, but I think we now need to ensure that its present when we COMBINE and PUBLISH this report. I think that's the issue at play. |
… combining .coverage files. amend our tox tree cleanup to exclude the whl directory when running coverage.
Ok @kdestin I think we are ready to rock! Barring a notification to the internal team, this is ready to squash merge! |
/azp run python - core - ci |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Thanks again @kdestin !
Description
This pull request migrates this repository's tox config to be compatible with tox 4. Major changes include:
tox-monorepo
were removed in the repository.tox4
adds native support for the use-case thattox-monorepo
enables:--root
allows for{toxinidir}
to be specified indepedently of the location oftox.ini
.--root
in examples, call out that default values for the config file and root can be set with environment variables, etc...tox_harness.py
was updated to use--root
when invokingtox
tox.ini
to clean it uptoxfile.py
) to compute the repository root)This PR is part of an ongoing effort by the ML team to make azure-sdk-for-python's tooling more convenient for use during local development (Not a high priority workstream): #28785.
Resolves #28267
cc: @scbedd
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines