未验证 提交 76f34f28 编写于 作者: F Frost Ming

fix lockfile

上级 63fa7b5b
......@@ -96,6 +96,16 @@ termcolor = ">=1.1.0"
colorama = ">=0.3.9"
six = ">=1.12.0"
[[package]]
name = "importlib-metadata"
sections = ["dev"]
version = "1.6.0"
marker = "python_version >= \"3.5\" and python_version < \"3.8\""
summary = "Read metadata from Python packages"
[package.dependencies]
zipp = ">=0.5"
[[package]]
name = "incremental"
sections = ["dev"]
......@@ -267,6 +277,9 @@ version = "0.13.1"
marker = "python_version >= \"3.5\""
summary = "plugin and hook calling mechanisms for python"
[package.dependencies]
importlib-metadata = {marker = "python_version < \"3.8\"", version = ">=0.12"}
[[package]]
name = "py"
sections = ["dev"]
......@@ -312,6 +325,7 @@ attrs = ">=17.4.0"
more-itertools = ">=4.0.0"
pluggy = "<1.0,>=0.12"
wcwidth = "*"
importlib-metadata = {marker = "python_version < \"3.8\"", version = ">=0.12"}
atomicwrites = {marker = "sys_platform == \"win32\"", version = ">=1.0"}
colorama = {marker = "sys_platform == \"win32\"", version = "*"}
......@@ -462,6 +476,13 @@ version = "0.34.2"
marker = "python_version >= \"2.7\" and python_version not in \"3.0, 3.1, 3.2, 3.3, 3.4\""
summary = "A built-package format for Python"
[[package]]
name = "zipp"
sections = ["dev"]
version = "3.1.0"
marker = "python_version >= \"3.6\" and python_version < \"3.8\""
summary = "Backport of pathlib-compatible object wrapper for zip files"
[metadata]
"apipkg 1.5" = [
{file = "apipkg-1.5.tar.gz", hash = "sha256:37228cda29411948b422fae072f57e31d3396d2ee1c9783775980ee9c9990af6"},
......@@ -541,6 +562,10 @@ summary = "A built-package format for Python"
{file = "halo-0.0.29.tar.gz", hash = "sha256:a8aeb0164e269d7c96fb7444b2a4caaa09b8989fa0c85e6a26e8b2c6d1af3b9d"},
{file = "halo-0.0.29-py3-none-any.whl", hash = "sha256:67996649083229a9b7a93fe7c871c97d40bd2f1a988540eccf948a6b1844f644"},
]
"importlib-metadata 1.6.0" = [
{file = "importlib_metadata-1.6.0.tar.gz", hash = "sha256:34513a8a0c4962bc66d35b359558fd8a5e10cd472d37aec5f66858addef32c1e"},
{file = "importlib_metadata-1.6.0-py2.py3-none-any.whl", hash = "sha256:2a688cbaa90e0cc587f1df48bdc97a6eadccdcd9c35fb3f976a09e3b5016d90f"},
]
"incremental 17.5.0" = [
{file = "incremental-17.5.0.tar.gz", hash = "sha256:7b751696aaf36eebfab537e458929e194460051ccad279c72b755a167eebd4b3"},
{file = "incremental-17.5.0-py2.py3-none-any.whl", hash = "sha256:717e12246dddf231a349175f48d74d93e2897244939173b01974ab6661406b9f"},
......@@ -741,6 +766,10 @@ summary = "A built-package format for Python"
{file = "wheel-0.34.2.tar.gz", hash = "sha256:8788e9155fe14f54164c1b9eb0a319d98ef02c160725587ad60f14ddc57b6f96"},
{file = "wheel-0.34.2-py2.py3-none-any.whl", hash = "sha256:df277cb51e61359aba502208d680f90c0493adec6f0e848af94948778aed386e"},
]
"zipp 3.1.0" = [
{file = "zipp-3.1.0.tar.gz", hash = "sha256:c599e4d75c98f6798c509911d08a22e6c021d074469042177c8c86fb92eefd96"},
{file = "zipp-3.1.0-py3-none-any.whl", hash = "sha256:aa36550ff0c0b7ef7fa639055d797116ee891440eac1a56f378e2d3179e0320b"},
]
[root]
content_hash = "md5:fbac358de4e5b0747e3a27154febb055"
......
......@@ -18,7 +18,6 @@ from pythonfinder.environment import PYENV_INSTALLED, PYENV_ROOT
from pdm.exceptions import NoPythonVersion
from pdm.iostream import stream
from pdm.models.specifiers import PySpecSet
from pdm.utils import (
allow_all_wheels,
cached_property,
......@@ -342,12 +341,6 @@ class GlobalEnvironment(Environment):
is_global = True
def __init__(self, project: Project) -> None:
super().__init__(project)
self.python_requires = PySpecSet(
"==" + get_python_version(self.python_executable, True)
)
def get_paths(self) -> Dict[str, str]:
paths = get_sys_config_paths(self.python_executable)
paths["prefix"] = paths["data"]
......
......@@ -29,6 +29,7 @@ from pdm.utils import (
atomic_open_for_write,
cached_property,
find_project_root,
get_python_version,
get_venv_python,
)
......@@ -141,7 +142,13 @@ class Project:
@cached_property
def environment(self) -> Environment:
if self.is_global:
return GlobalEnvironment(self)
env = GlobalEnvironment(self)
# Rewrite global project's python requires to be
# compatible with the exact version
env.python_requires = PySpecSet(
"==" + get_python_version(env.python_executable, True)
)
return env
if self.config["use_venv"] and "VIRTUAL_ENV" in os.environ:
self.project_config["python.path"] = get_venv_python()
return GlobalEnvironment(self)
......
......@@ -423,6 +423,7 @@ def get_venv_python() -> Optional[str]:
@contextmanager
def atomic_open_for_write(filename: Union[Path, str], *, encoding: str = "utf-8"):
fd, name = tempfile.mkstemp("-atomic-write", "pdm-")
filename = str(filename)
try:
f = open(fd, "w", encoding=encoding)
yield f
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册