build: 将 pcse 本地路径依赖改为本地 vendor wheel 包
- 在 Dockerfile 中复制 vendor/ 目录,确保镜像构建时可用本地 wheel - pyproject.toml 中将 pcse 依赖从 file:///job/pcse 固定为 ==6.0.12 - 配置 uv find-links 指向 ./vendor,解析本地 wheel 源 - 新增 vendor/pcse-6.0.12-py3-none-any.whl,避免依赖外部绝对路径
This commit is contained in:
@@ -11,8 +11,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
curl \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# 复制项目配置文件
|
||||
# 复制项目配置文件与本地 wheel 依赖
|
||||
COPY pyproject.toml justfile ./
|
||||
COPY vendor/ ./vendor/
|
||||
|
||||
# 配置 uv 使用阿里云镜像源
|
||||
ENV UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ \
|
||||
|
||||
@@ -9,9 +9,12 @@ dependencies = [
|
||||
"plotly>=6.5.0",
|
||||
"pandas>=2.0.0",
|
||||
"numpy>=2.0.0",
|
||||
"pcse @ file:///job/pcse",
|
||||
"pcse==6.0.12",
|
||||
]
|
||||
|
||||
[tool.uv]
|
||||
find-links = ["./vendor"]
|
||||
|
||||
[[tool.uv.index]]
|
||||
url = "https://mirrors.aliyun.com/pypi/simple"
|
||||
default = true
|
||||
|
||||
17
uv.lock
generated
17
uv.lock
generated
@@ -280,7 +280,7 @@ dependencies = [
|
||||
requires-dist = [
|
||||
{ name = "numpy", specifier = ">=2.0.0" },
|
||||
{ name = "pandas", specifier = ">=2.0.0" },
|
||||
{ name = "pcse", directory = "../pcse" },
|
||||
{ name = "pcse", specifier = "==6.0.12" },
|
||||
{ name = "plotly", specifier = ">=6.5.0" },
|
||||
{ name = "streamlit", specifier = ">=1.52.0" },
|
||||
]
|
||||
@@ -494,7 +494,7 @@ wheels = [
|
||||
[[package]]
|
||||
name = "pcse"
|
||||
version = "6.0.12"
|
||||
source = { directory = "../pcse" }
|
||||
source = { registry = "vendor" }
|
||||
dependencies = [
|
||||
{ name = "dotmap" },
|
||||
{ name = "openpyxl" },
|
||||
@@ -504,16 +504,9 @@ dependencies = [
|
||||
{ name = "requests" },
|
||||
{ name = "traitlets-pcse" },
|
||||
]
|
||||
|
||||
[package.metadata]
|
||||
requires-dist = [
|
||||
{ name = "dotmap", specifier = ">=1.3" },
|
||||
{ name = "openpyxl", specifier = ">=3.0" },
|
||||
{ name = "pandas", specifier = ">=2.0" },
|
||||
{ name = "pydispatcher", specifier = ">=2.0.7" },
|
||||
{ name = "pyyaml", specifier = ">=5.1" },
|
||||
{ name = "requests", specifier = ">=2.0" },
|
||||
{ name = "traitlets-pcse", specifier = "==5.0.0.dev0" },
|
||||
wheels = [
|
||||
{ path = "pcse-6.0.12-py3-none-any.whl" },
|
||||
{ path = "pcse-6.0.12-py3-none-any.whl" },
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
4
vendor/.gitignore
vendored
Normal file
4
vendor/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
||||
# 默认忽略 vendor 下的所有内容,但保留 pcse wheel 和本文件
|
||||
*
|
||||
!pcse-6.0.12-py3-none-any.whl
|
||||
!.gitignore
|
||||
BIN
vendor/pcse-6.0.12-py3-none-any.whl
vendored
Normal file
BIN
vendor/pcse-6.0.12-py3-none-any.whl
vendored
Normal file
Binary file not shown.
Reference in New Issue
Block a user