Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
f56b4933
P
Pdm
项目概览
后端镜像
/
Pdm
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Pdm
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
f56b4933
编写于
2月 17, 2020
作者:
F
frostming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update README.md
上级
38c88d43
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
21 addition
and
7 deletion
+21
-7
README.md
README.md
+5
-1
README_zh.md
README_zh.md
+3
-0
pdm/models/repositories.py
pdm/models/repositories.py
+2
-2
pdm/project/core.py
pdm/project/core.py
+6
-3
pyproject.toml
pyproject.toml
+5
-1
未找到文件。
README.md
浏览文件 @
f56b4933
...
...
@@ -3,6 +3,7 @@
A modern Python package manager with PEP 582 support.
[
中文版本说明
](
README_zh.md
)
![
Github Actions
](
https://github.com/pdm-project/pdm/workflows/Tests/badge.svg
)
![
PyPI
](
https://img.shields.io/pypi/v/pdm?logo=python&logoColor=%23cccccc
)
## What is PDM?
...
...
@@ -58,7 +59,7 @@ $ pip install --user pdm
PEP 582 is a draft proposal which still needs a lot of polishment, for instance, it doesn't mention how to manage
CLI executables. PDM take the decision to put
`bin`
,
`include`
together with
`lib`
under
`__pypackage__/X.Y`
.
### 2. How
to
run CLI scripts in the local package directory?
### 2. How
do I
run CLI scripts in the local package directory?
The recommended way is to prefix your command with
`pdm run`
. It is also possible to run CLI scripts directly from
the outside, the PDM's installer has already injected the package path to the
`sys.path`
in the entry script file.
...
...
@@ -73,6 +74,9 @@ and could lead to some confusion around which packages are being used, though.
You'd better not. The packages installed inside
`__pypackages__`
are OS dependent. Instead, you should keep
`pdm.lock`
in VCS and do
`pdm sync`
on the target environment to deploy.
### 5. Can I use `pdm` to manage a Python 2.7 project?
Sure. The
`pdm`
itself can be installed under Python 3.7+ only, but it doesn't restrict the Python used by the project.
## Credits
This project is strongly inspired by [pyflow] and [poetry].
...
...
README_zh.md
浏览文件 @
f56b4933
...
...
@@ -67,6 +67,9 @@ PDM 会首先在 `__pypackage__` 中寻找,然后会在选择的 Python 解释
最好别这样搞,
`__pypackage__`
下面安装的包是和操作系统相关的,所以除非是纯 Python 的包,都会有兼容性的问题。你应该把
`pdm.lock`
纳入版本管理,然后在目标环境中执行
`pdm sync`
。
### 5. 我能用`pdm`管理一个 Python 2.7 的项目吗?
当然可以。只是
`pdm`
本身的安装需要 Python 版本高于 3.7,它并不限制项目使用的 Python 版本。
## 鸣谢
本项目的受到 [pyflow] 与 [poetry] 的很多启发。
...
...
pdm/models/repositories.py
浏览文件 @
f56b4933
...
...
@@ -14,7 +14,7 @@ from pdm.models.requirements import (
parse_requirement
,
)
from
pdm.models.specifiers
import
PySpecSet
,
SpecifierSet
from
pdm.utils
import
allow_all_wheels
,
get_pypi_source
from
pdm.utils
import
allow_all_wheels
if
TYPE_CHECKING
:
from
pdm.models.environment
import
Environment
...
...
@@ -40,7 +40,7 @@ class BaseRepository:
:param sources: a list of sources to download packages from.
:param environment: the bound environment instance.
"""
self
.
sources
=
[
get_pypi_source
()]
+
sources
self
.
sources
=
sources
self
.
environment
=
environment
self
.
_candidate_info_cache
=
context
.
make_candidate_info_cache
()
self
.
_hash_cache
=
context
.
make_hash_cache
()
...
...
pdm/project/core.py
浏览文件 @
f56b4933
...
...
@@ -19,7 +19,7 @@ from pdm.models.requirements import Requirement, parse_requirement, strip_extras
from
pdm.models.specifiers
import
PySpecSet
from
pdm.project.config
import
Config
from
pdm.project.meta
import
PackageMeta
from
pdm.utils
import
find_project_root
from
pdm.utils
import
find_project_root
,
get_pypi_source
if
TYPE_CHECKING
:
from
tomlkit.container
import
Container
...
...
@@ -137,8 +137,11 @@ class Project:
return
self
.
tool_settings
.
get
(
"allow_prereleases"
)
@
property
def
sources
(
self
)
->
Optional
[
List
[
Source
]]:
return
self
.
tool_settings
.
get
(
"source"
)
def
sources
(
self
)
->
List
[
Source
]:
sources
=
self
.
tool_settings
.
get
(
"source"
,
[])
if
not
any
(
source
.
get
(
"name"
)
==
"pypi"
for
source
in
sources
):
sources
.
insert
(
0
,
get_pypi_source
())
return
sources
def
get_repository
(
self
)
->
BaseRepository
:
sources
=
self
.
sources
or
[]
...
...
pyproject.toml
浏览文件 @
f56b4933
...
...
@@ -13,8 +13,12 @@ repository = "https://github.com/pdm-project/pdm"
keywords
=
[
"packaging"
,
"dependency"
,
"workflow"
]
classifiers
=
[
"Development Status :: 3 - Alpha"
,
"Topic :: Software Development :: Build Tools"
,
"Topic :: Software Development :: Libraries :: Python Modules"
"Programming Language :: Python"
,
"Programming Language :: Python :: 3"
,
"Programming Language :: Python :: 3.7"
,
"Programming Language :: Python :: 3.8"
]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录