Commit 727f4e9
committed
Use static notation for
`setuptools` may potentially be needed for installation to work
fully as desired prior to Python 3.12, so in those versions it is
installed automatically in any virtual environment that is created
with `pip` available. This is a behavior of the `venv` module that
is not specific to CI.
However, on CI we upgrade packages that are preinstalled in the
virtual environment, or that we may otherwise wish to be present.
This took the form of unconditionally installing/upgrading the
`pip` and `wheel` packages, but conditionally upgrading the
`setuptools` package only if we find that it is already installed.
This commit changes the behavior to statically specify the same
list of package specifications to `pip` in all environments and in
all versions of Python, but to use the static notation recognized
by `pip` to indicate that `setuptools` is to be instaled/upgraded
only if the Python version is strictly less than Python 3.12.
This seems to be more readable. It also avoids using unquoted shell
parameter expansion in a way that is potentially confusing (for
example, if we were running our CI script steps through ShellCheck,
then it would automatically balk at that construction). It is also
more consistent with how `test_installation` sets up its
environment (especially since 31e1c03, but actually even before
that, because it was still conditioning `setuptools` on the Python
version rather than whether it was already installed). Finally,
this behavior is what the preexisting comment already described.
This also adjusts the shell quoting style slightly in other related
commands (in the same workflows) that pass package specifications
to `pip`, for consistency.
(For now, `".[test]"` rather than `.[test]` remains written in the
readme because it works in `cmd.exe` as well as other shells, but
it may be changed there in the future too.)setuptools in CI pip commands1 parent 31e1c03 commit 727f4e9
File tree
3 files changed
+7
-7
lines changed- .github/workflows
3 files changed
+7
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
58 | | - | |
| 58 | + | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
| 82 | + | |
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
86 | | - | |
| 86 | + | |
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
0 commit comments