1
0
mirror of https://github.com/fedora-python/tox-current-env.git synced 2024-12-24 00:56:16 +01:00

Use sysconfig instead of hardcoded paths

This commit is contained in:
Lumir Balhar 2021-11-08 15:17:15 +01:00 committed by Miro Hrončok
parent bb79c6d405
commit 5d3802da93

View File

@ -1,6 +1,7 @@
import argparse import argparse
import platform import platform
import sys import sys
import sysconfig
import warnings import warnings
from pathlib import Path from pathlib import Path
from typing import Set from typing import Set
@ -125,13 +126,13 @@ class CurrentEnv(PythonRun):
return None return None
def env_bin_dir(self): def env_bin_dir(self):
return Path(sys.prefix) / "bin" return Path(sysconfig.get_path("scripts"))
def env_python(self): def env_python(self):
return sys.executable return sys.executable
def env_site_package_dir(self): def env_site_package_dir(self):
return Path(sys.prefix) / "lib" return Path(sysconfig.get_path("purelib"))
@property @property
def installer(self): def installer(self):