-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add Python version support #1239
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
konstin
approved these changes
Feb 2, 2024
b1e6ecd
to
5e36a39
Compare
5e36a39
to
7f8d853
Compare
jherland
added a commit
to tweag/FawltyDeps
that referenced
this pull request
May 7, 2024
Upgrade Nox to (at least) 2024.03.02 (which is the first version with support for managing virtualenvs with uv. Add uv as an indirect dependency by depending on "nox[uv]" instead of "nox" (exception: inside the "lint" dependency group, we only depend on "nox" in order for Mypy to access Nox' type annotations, uv is not needed here). Also we cannot use/depend on uv when using Python 3.7, since uv requires Python >=v3.8. I'm not actually sure _why_ uv requires >=v3.8, as it is apparently able to create venvs for Python v3.7 (see e.g. https://github.com/astral-sh/uv?tab=readme-ov-file#python-discovery), still astral-sh/uv#1239 prevents uv from being installed on <=v3.7). Finally, in noxfile.py, use uv as our default venv_backend instead of the default (pip), but only when it is in fact available. A final complication on Nix(OS) happens when we install requirements for the current session; we do this in two steps, and then we make sure that whatever we installed was patched appropriately: session.install("-r", str(requirments_txt)) if include_self: session.install("-e", ".") if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) However, with uv in the mix, we have to consider that session.install() itself _runs_ uv at the same time as the first session.install() may also _install_ uv itself into the virtualenv. The second session.install() can then end up _running_ a uv that was _installed_ by the first session.install(), and this will break on Nix(OS) unless the uv binary has been patched in the meantime. We therefore need to insert a call to patch_binaries_if_needed() _between_ the two session.install() calls. Since the second session.install() only installs FawltyDeps itself (which does not introduce any binaries to be patched), we can get away with simply reordering the second session.install() and the call to patch_binaries_if_needed(): session.install("-r", str(requirments_txt)) if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) if include_self: session.install("-e", ".")
jherland
added a commit
to tweag/FawltyDeps
that referenced
this pull request
May 22, 2024
Upgrade Nox to (at least) 2024.03.02 (which is the first version with support for managing virtualenvs with uv. Add uv as an indirect dependency by depending on "nox[uv]" instead of "nox" (exception: inside the "lint" dependency group, we only depend on "nox" in order for Mypy to access Nox' type annotations, uv is not needed here). Also we cannot use/depend on uv when using Python 3.7, since uv requires Python >=v3.8. I'm not actually sure _why_ uv requires >=v3.8, as it is apparently able to create venvs for Python v3.7 (see e.g. https://github.com/astral-sh/uv?tab=readme-ov-file#python-discovery), still astral-sh/uv#1239 prevents uv from being installed on <=v3.7). Finally, in noxfile.py, use uv as our default venv_backend instead of the default (pip), but only when it is in fact available. A final complication on Nix(OS) happens when we install requirements for the current session; we do this in two steps, and then we make sure that whatever we installed was patched appropriately: session.install("-r", str(requirments_txt)) if include_self: session.install("-e", ".") if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) However, with uv in the mix, we have to consider that session.install() itself _runs_ uv at the same time as the first session.install() may also _install_ uv itself into the virtualenv. The second session.install() can then end up _running_ a uv that was _installed_ by the first session.install(), and this will break on Nix(OS) unless the uv binary has been patched in the meantime. We therefore need to insert a call to patch_binaries_if_needed() _between_ the two session.install() calls. Since the second session.install() only installs FawltyDeps itself (which does not introduce any binaries to be patched), we can get away with simply reordering the second session.install() and the call to patch_binaries_if_needed(): session.install("-r", str(requirments_txt)) if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) if include_self: session.install("-e", ".")
jherland
added a commit
to tweag/FawltyDeps
that referenced
this pull request
Jun 12, 2024
Upgrade Nox to (at least) 2024.03.02 (which is the first version with support for managing virtualenvs with uv. Add uv as an indirect dependency by depending on "nox[uv]" instead of "nox" (exception: inside the "lint" dependency group, we only depend on "nox" in order for Mypy to access Nox' type annotations, uv is not needed here). Also we cannot use/depend on uv when using Python 3.7, since uv requires Python >=v3.8. I'm not actually sure _why_ uv requires >=v3.8, as it is apparently able to create venvs for Python v3.7 (see e.g. https://github.com/astral-sh/uv?tab=readme-ov-file#python-discovery), still astral-sh/uv#1239 prevents uv from being installed on <=v3.7). Finally, in noxfile.py, use uv as our default venv_backend instead of the default (pip), but only when it is in fact available. A final complication on Nix(OS) happens when we install requirements for the current session; we do this in two steps, and then we make sure that whatever we installed was patched appropriately: session.install("-r", str(requirments_txt)) if include_self: session.install("-e", ".") if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) However, with uv in the mix, we have to consider that session.install() itself _runs_ uv at the same time as the first session.install() may also _install_ uv itself into the virtualenv. The second session.install() can then end up _running_ a uv that was _installed_ by the first session.install(), and this will break on Nix(OS) unless the uv binary has been patched in the meantime. We therefore need to insert a call to patch_binaries_if_needed() _between_ the two session.install() calls. Since the second session.install() only installs FawltyDeps itself (which does not introduce any binaries to be patched), we can get away with simply reordering the second session.install() and the call to patch_binaries_if_needed(): session.install("-r", str(requirments_txt)) if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) if include_self: session.install("-e", ".")
jherland
added a commit
to tweag/FawltyDeps
that referenced
this pull request
Jul 9, 2024
Upgrade Nox to (at least) 2024.03.02 (which is the first version with support for managing virtualenvs with uv. Add uv as an indirect dependency by depending on "nox[uv]" instead of "nox" (exception: inside the "lint" dependency group, we only depend on "nox" in order for Mypy to access Nox' type annotations, uv is not needed here). Also we cannot use/depend on uv when using Python 3.7, since uv requires Python >=v3.8. I'm not actually sure _why_ uv requires >=v3.8, as it is apparently able to create venvs for Python v3.7 (see e.g. https://github.com/astral-sh/uv?tab=readme-ov-file#python-discovery), still astral-sh/uv#1239 prevents uv from being installed on <=v3.7). Finally, in noxfile.py, use uv as our default venv_backend instead of the default (pip), but only when it is in fact available. A final complication on Nix(OS) happens when we install requirements for the current session; we do this in two steps, and then we make sure that whatever we installed was patched appropriately: session.install("-r", str(requirments_txt)) if include_self: session.install("-e", ".") if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) However, with uv in the mix, we have to consider that session.install() itself _runs_ uv at the same time as the first session.install() may also _install_ uv itself into the virtualenv. The second session.install() can then end up _running_ a uv that was _installed_ by the first session.install(), and this will break on Nix(OS) unless the uv binary has been patched in the meantime. We therefore need to insert a call to patch_binaries_if_needed() _between_ the two session.install() calls. Since the second session.install() only installs FawltyDeps itself (which does not introduce any binaries to be patched), we can get away with simply reordering the second session.install() and the call to patch_binaries_if_needed(): session.install("-r", str(requirments_txt)) if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) if include_self: session.install("-e", ".")
jherland
added a commit
to tweag/FawltyDeps
that referenced
this pull request
Jul 23, 2024
Upgrade Nox to (at least) 2024.03.02 (which is the first version with support for managing virtualenvs with uv. Add uv as an indirect dependency by depending on "nox[uv]" instead of "nox" (exception: inside the "lint" dependency group, we only depend on "nox" in order for Mypy to access Nox' type annotations, uv is not needed here). Also we cannot use/depend on uv when using Python 3.7, since uv requires Python >=v3.8. I'm not actually sure _why_ uv requires >=v3.8, as it is apparently able to create venvs for Python v3.7 (see e.g. https://github.com/astral-sh/uv?tab=readme-ov-file#python-discovery), still astral-sh/uv#1239 prevents uv from being installed on <=v3.7). Finally, in noxfile.py, use uv as our default venv_backend instead of the default (pip), but only when it is in fact available. A final complication on Nix(OS) happens when we install requirements for the current session; we do this in two steps, and then we make sure that whatever we installed was patched appropriately: session.install("-r", str(requirments_txt)) if include_self: session.install("-e", ".") if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) However, with uv in the mix, we have to consider that session.install() itself _runs_ uv at the same time as the first session.install() may also _install_ uv itself into the virtualenv. The second session.install() can then end up _running_ a uv that was _installed_ by the first session.install(), and this will break on Nix(OS) unless the uv binary has been patched in the meantime. We therefore need to insert a call to patch_binaries_if_needed() _between_ the two session.install() calls. Since the second session.install() only installs FawltyDeps itself (which does not introduce any binaries to be patched), we can get away with simply reordering the second session.install() and the call to patch_binaries_if_needed(): session.install("-r", str(requirments_txt)) if not session.virtualenv._reused: # noqa: SLF001 patch_binaries_if_needed(session, session.virtualenv.location) if include_self: session.install("-e", ".")
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #1221.