# 设置 PyPI 镜像源,默认是走的pip的pip.ini设置的来源
[[tool.poetry.source]]
name = "douban"
url = "https://pypi.doubanio.com/simple/"
[tool.poetry.dependencies]
# 使用git仓库:
requests = { git = "https://github.com/requests/requests.git" }
# 使用本地路径:
# directory
my-package = { path = "../my-package/", develop = false }
# file
my-package = { path = "../my-package/dist/my-package-0.1.0.tar.gz" }
# URL
my-package = { url = "https://example.com/my-package-0.1.0.tar.gz" }
[tool.poetry.dependencies]
# python限制:
pathlib2 = { version = "^2.2", python = "~2.7" }
# 指定版本和运行环境
pathlib2 = { version = "^2.2", markers = "python_version ~= '2.7' or sys_platform == 'win32'" }
# 根据py版本来选择版本
foo = [
{version = "<=1.9", python = "^2.7"},
{version = "^2.0", python = "^3.4"}
]
# 如果限制很多,也可单独写一个模块
[tool.poetry.group.dev.dependencies.black]
version = "19.10b0"
allow-prereleases = true
python = "^3.6"
markers = "platform_python_implementation == 'CPython'"