Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
后端镜像
Pdm
提交
b6c1c3d3
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,发现更多精彩内容 >>
未验证
提交
b6c1c3d3
编写于
12月 22, 2020
作者:
F
Frost Ming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add config items
Close #202
上级
1a4db10a
变更
6
隐藏空白更改
内联
并排
Showing
6 changed file
with
14 addition
and
9 deletion
+14
-9
docs/docs/project.md
docs/docs/project.md
+3
-1
news/202.feature
news/202.feature
+1
-0
pdm/cli/commands/add.py
pdm/cli/commands/add.py
+2
-2
pdm/cli/commands/update.py
pdm/cli/commands/update.py
+2
-2
pdm/cli/options.py
pdm/cli/options.py
+0
-4
pdm/project/config.py
pdm/project/config.py
+6
-0
未找到文件。
docs/docs/project.md
浏览文件 @
b6c1c3d3
...
...
@@ -115,7 +115,7 @@ If you want global project to track another project file other than `~/.pdm/glob
project path following
`-g/--global`
.
!!! danger "NOTE"
Be careful with
`remove`
and
`sync --clean`
commands when global project is used. Because it may remove packages installed in your system Python.
Be careful with
`remove`
and
`sync --clean`
commands when global project is used. Because it may remove packages installed in your system Python.
## Working with a virtualenv
...
...
@@ -160,6 +160,8 @@ $ pdm export -o requirements.txt
|
`pypi.url`
| The URL of PyPI mirror | Read
`index-url`
in
`pip.conf`
, or
`https://pypi.org/simple`
if not found | Yes |
`PDM_PYPI_URL`
|
|
`pypi.verify_ssl`
| Verify SSL certificate when query PyPI | Read
`trusted-hosts`
in
`pip.conf`
, defaults to
`True`
| Yes | |
|
`pypi.json_api`
| Consult PyPI's JSON API for package metadata |
`False`
| Yes |
`PDM_PYPI_JSON_API`
|
|
`strategy.save`
| Specify how to save versions when a package is added |
`compatible`
(can be:
`exact`
,
`wildcard`
) | Yes | |
|
`strategy.update`
| The default strategy for updating packages |
`reuse`
(can be :
`eager`
) | Yes | |
_If the env var is set, the value will take precendence over what is saved in the config file._
...
...
news/202.feature
0 → 100644
浏览文件 @
b6c1c3d3
Make
update
strategy
and
save
strategy
configurable
in
pdm
config.
pdm/cli/commands/add.py
浏览文件 @
b6c1c3d3
...
...
@@ -37,8 +37,8 @@ class Command(BaseCommand):
dev
=
options
.
dev
,
section
=
options
.
section
,
sync
=
options
.
sync
,
save
=
options
.
save_strategy
,
strategy
=
options
.
update_strategy
,
save
=
options
.
save_strategy
or
project
.
config
[
"strategy.save"
]
,
strategy
=
options
.
update_strategy
or
project
.
config
[
"strategy.update"
]
,
editables
=
options
.
editables
,
packages
=
options
.
packages
,
)
pdm/cli/commands/update.py
浏览文件 @
b6c1c3d3
...
...
@@ -30,8 +30,8 @@ class Command(BaseCommand):
dev
=
options
.
dev
,
sections
=
options
.
sections
,
default
=
options
.
default
,
save
=
options
.
save_strategy
,
strategy
=
options
.
update_strategy
,
save
=
options
.
save_strategy
or
project
.
config
[
"strategy.save"
]
,
strategy
=
options
.
update_strategy
or
project
.
config
[
"strategy.update"
]
,
unconstrained
=
options
.
unconstrained
,
packages
=
options
.
packages
,
)
pdm/cli/options.py
浏览文件 @
b6c1c3d3
...
...
@@ -109,7 +109,6 @@ save_strategy_group.add_argument(
dest
=
"save_strategy"
,
const
=
"compatible"
,
help
=
"Save compatible version specifiers"
,
default
=
"compatible"
,
)
save_strategy_group
.
add_argument
(
"--save-wildcard"
,
...
...
@@ -117,7 +116,6 @@ save_strategy_group.add_argument(
dest
=
"save_strategy"
,
const
=
"wildcard"
,
help
=
"Save wildcard version specifiers"
,
default
=
"compatible"
,
)
save_strategy_group
.
add_argument
(
"--save-exact"
,
...
...
@@ -125,7 +123,6 @@ save_strategy_group.add_argument(
dest
=
"save_strategy"
,
const
=
"exact"
,
help
=
"Save exact version specifiers"
,
default
=
"compatible"
,
)
update_strategy_group
=
ArgumentGroup
(
"update_strategy"
,
is_mutually_exclusive
=
True
)
...
...
@@ -134,7 +131,6 @@ update_strategy_group.add_argument(
action
=
"store_const"
,
dest
=
"update_strategy"
,
const
=
"reuse"
,
default
=
"reuse"
,
help
=
"Reuse pinned versions already present in lock file if possible"
,
)
update_strategy_group
.
add_argument
(
...
...
pdm/project/config.py
浏览文件 @
b6c1c3d3
...
...
@@ -79,6 +79,12 @@ class Config(MutableMapping):
True
,
"PDM_AUTO_GLOBAL"
,
),
"strategy.update"
:
ConfigItem
(
"The default strategy for updating packages"
,
"reuse"
,
False
),
"strategy.save"
:
ConfigItem
(
"Specify how to save versions when a package is added"
,
"compatible"
,
False
),
"parallel_install"
:
ConfigItem
(
"Whether to perform installation and uninstallation in parallel"
,
True
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录