Skip to content

Commit 67b3058

Browse files
committed
drop no-python-version-warning from pip install
When using `hatch sell` with `pip` 25.0.1 at the first time, a deprecation warning is showed: > $ hatch shell > DEPRECATION: --no-python-version-warning is deprecated. pip 25.1 will > enforce this behaviour change. A possible replacement is to remove the > flag as it's a no-op. Discussion can be found at > pypa/pip#13154 > You are about to enter a new shell, exit as you usually would e.g. by > typing `exit` or pressing `ctrl+d`... Looking at pypa/pip#13154 it said: > The Python 2 days are behind us, thus we can kill off the > --no-python-version-warning flag which disabled the > "Python 2 is sunsetting support" warnings :) > > If you're using this flag, you can simply stop. It does nothing today. So, lets remove it to not show the warning
1 parent d81790e commit 67b3058

File tree

4 files changed

+2
-6
lines changed

4 files changed

+2
-6
lines changed

backend/tests/downstream/integrate.py

-3
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,6 @@ def main():
140140
'download',
141141
'-q',
142142
'--disable-pip-version-check',
143-
'--no-python-version-warning',
144143
'-d',
145144
links_dir,
146145
os.path.join(links_dir, os.listdir(links_dir)[0]),
@@ -230,7 +229,6 @@ def main():
230229
'install',
231230
'-q',
232231
'--disable-pip-version-check',
233-
'--no-python-version-warning',
234232
'--find-links',
235233
links_dir,
236234
'--no-deps',
@@ -243,7 +241,6 @@ def main():
243241
'install',
244242
'-q',
245243
'--disable-pip-version-check',
246-
'--no-python-version-warning',
247244
repo_dir,
248245
])
249246

src/hatch/cli/application.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ def ensure_plugin_dependencies(self, dependencies: list[Requirement], *, wait_me
162162

163163
pip_command = [sys.executable, '-u', '-m', 'pip']
164164

165-
pip_command.extend(['install', '--disable-pip-version-check', '--no-python-version-warning'])
165+
pip_command.extend(['install', '--disable-pip-version-check'])
166166

167167
# Default to -1 verbosity
168168
add_verbosity_flag(pip_command, self.verbosity, adjustment=-1)

src/hatch/env/plugin/interface.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -768,7 +768,7 @@ def construct_pip_install_command(self, args: list[str]):
768768
A convenience method for constructing a [`pip install`](https://pip.pypa.io/en/stable/cli/pip_install/)
769769
command with the given verbosity. The default verbosity is set to one less than Hatch's verbosity.
770770
"""
771-
command = ['python', '-u', '-m', 'pip', 'install', '--disable-pip-version-check', '--no-python-version-warning']
771+
command = ['python', '-u', '-m', 'pip', 'install', '--disable-pip-version-check']
772772

773773
# Default to -1 verbosity
774774
add_verbosity_flag(command, self.verbosity, adjustment=-1)

tests/helpers/helpers.py

-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ def assert_plugin_installation(subprocess_run, dependencies: list[str], *, verbo
5555
'pip',
5656
'install',
5757
'--disable-pip-version-check',
58-
'--no-python-version-warning',
5958
]
6059
add_verbosity_flag(command, verbosity, adjustment=-1)
6160
command.extend(dependencies)

0 commit comments

Comments
 (0)