Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdba4245

Browse files
committed
Fix installation test for Python 3.12 and Windows
Starting in Python 3.12, global and virtual Python environments nolonger automatically ship setuptools (per the "ensurepip" item inhttps://docs.python.org/3.12/whatsnew/3.12.html#removed). Projectsthat use setuptools as a build backend are still supported,including with setup.py using techniques such as "pip install .".In Windows, the "bin" subdir of a virtual environment dir is called"Scripts" instead. Unlike in a global environment (where no namesare universal, and "python3" and "pip3" are more common for thePython 3 commands on some popular Unix-like systems), in a virtualenvironment the "python" and "pip" commands are always present and"python3" and "pip3" are not guaranteed to be present.This commit changes test_installation accordingly. The CI workflowsand documentation still need to be updated.
1 parentc8e303f commitdba4245

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎test/test_installation.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
importast
55
importos
66
importsubprocess
7+
fromgit.compatimportis_win
78
fromtest.libimportTestBase
89
fromtest.lib.helperimportwith_rw_directory
910

@@ -12,8 +13,9 @@ class TestInstallation(TestBase):
1213
defsetUp_venv(self,rw_dir):
1314
self.venv=rw_dir
1415
subprocess.run(["virtualenv",self.venv],stdout=subprocess.PIPE)
15-
self.python=os.path.join(self.venv,"bin/python3")
16-
self.pip=os.path.join(self.venv,"bin/pip3")
16+
bin_name="Scripts"ifis_winelse"bin"
17+
self.python=os.path.join(self.venv,bin_name,"python")
18+
self.pip=os.path.join(self.venv,bin_name,"pip")
1719
self.sources=os.path.join(self.venv,"src")
1820
self.cwd=os.path.dirname(os.path.dirname(__file__))
1921
os.symlink(self.cwd,self.sources,target_is_directory=True)
@@ -32,14 +34,14 @@ def test_installation(self, rw_dir):
3234
msg=result.stderrorresult.stdoutor"Can't install requirements",
3335
)
3436
result=subprocess.run(
35-
[self.python,"setup.py","install"],
37+
[self.pip,"install","."],
3638
stdout=subprocess.PIPE,
3739
cwd=self.sources,
3840
)
3941
self.assertEqual(
4042
0,
4143
result.returncode,
42-
msg=result.stderrorresult.stdoutor"Can'tbuild - setup.py failed",
44+
msg=result.stderrorresult.stdoutor"Can'tinstall project",
4345
)
4446
result=subprocess.run([self.python,"-c","import git"],stdout=subprocess.PIPE,cwd=self.sources)
4547
self.assertEqual(

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp