Skip to content

Commit 2abfaab

Browse files
committed
Added command to use the currently active python version
1 parent 84ca6f9 commit 2abfaab

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

test/integration/util/dependencies/audit_integration_test.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,15 +53,19 @@ def create(self) -> PoetryProject:
5353
aux_subprocess(self.poetry, "new", self.name, cwd=self.dir.parent)
5454
return self
5555

56-
def set_minimum_python_version(self, version: sys.version_info) -> PoetryProject:
56+
def set_python_version(self, version: sys.version_info) -> PoetryProject:
5757
content = self.toml.read_text()
58+
python_version = f"{version.major}.{version.minor}"
5859
changed = re.sub(
5960
r'^requires-python = ".*"$',
60-
f'requires-python = ">={version.major}.{version.minor}"',
61+
f'requires-python = ">={python_version}"',
6162
content,
6263
flags=re.MULTILINE,
6364
)
6465
self.toml.write_text(changed)
66+
aux_subprocess(
67+
self.poetry, "env", "use", f"python{python_version}", cwd=self.dir
68+
)
6569
return self
6670

6771
def add_package(self, spec: str) -> PoetryProject:

0 commit comments

Comments
 (0)