Skip to content

Commit 49c4f21

Browse files
开发环境搭建好了
1 parent 0134485 commit 49c4f21

File tree

6 files changed

+50
-7
lines changed

6 files changed

+50
-7
lines changed

Diff for: .devcontainer/Dockerfile

+10
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,16 @@ ENV TZ=UTC
66
# Set up work directory
77
WORKDIR /workspace
88

9+
# 删除原有的 apt 源配置
10+
RUN rm -rf /etc/apt/sources.list.d/*
11+
12+
# 设置新的 apt 源
13+
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm main contrib non-free" > /etc/apt/sources.list
14+
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian bookworm-updates main contrib non-free" >> /etc/apt/sources.list
15+
RUN echo "deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list
16+
17+
18+
919
# Install additional dev dependencies
1020
RUN apt-get update && apt-get install -y \
1121
zsh \

Diff for: .devcontainer/devcontainer.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,4 @@
7777
"type": "volume"
7878
}
7979
]
80-
}
80+
}

Diff for: Makefile

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,15 +61,15 @@ help: ## show this help message
6161

6262
reinstall_backend: ## forces reinstall all dependencies (no caching)
6363
@echo 'Installing backend dependencies'
64-
@uv sync -n --reinstall --frozen
64+
@uv sync -n --reinstall --frozen --index-url https://pypi.tuna.tsinghua.edu.cn/simple
6565

6666
install_backend: ## install the backend dependencies
6767
@echo 'Installing backend dependencies'
68-
@uv sync --frozen $(EXTRA_ARGS)
68+
@uv sync --frozen $(EXTRA_ARGS) --index-url https://pypi.tuna.tsinghua.edu.cn/simple
6969

7070
install_frontend: ## install the frontend dependencies
7171
@echo 'Installing frontend dependencies'
72-
@cd src/frontend && npm install > /dev/null 2>&1
72+
@cd src/frontend && npm install --registry https://registry.npmmirror.com > /dev/null 2>&1
7373

7474
build_frontend: ## build the frontend static files
7575
@echo '==== Starting frontend build ===='
@@ -115,7 +115,7 @@ clean_all: clean_python_cache clean_npm_cache # clean all caches and temporary d
115115
@echo "$(GREEN)All caches and temporary directories cleaned.$(NC)"
116116

117117
setup_uv: ## install poetry using pipx
118-
pipx install uv
118+
pipx install uv --index-url https://pypi.tuna.tsinghua.edu.cn/simple
119119

120120
add:
121121
@echo 'Adding dependencies'
@@ -213,10 +213,10 @@ lint: install_backend ## run linters
213213
@uv run mypy --namespace-packages -p "langflow"
214214

215215
install_frontendci:
216-
@cd src/frontend && npm ci > /dev/null 2>&1
216+
@cd src/frontend && npm ci --registry https://registry.npmmirror.com > /dev/null 2>&1
217217

218218
install_frontendc:
219-
@cd src/frontend && $(call CLEAR_DIRS,node_modules) && rm -f package-lock.json && npm install > /dev/null 2>&1
219+
@cd src/frontend && $(call CLEAR_DIRS,node_modules) && rm -f package-lock.json && npm install --registry https://registry.npmmirror.com > /dev/null 2>&1
220220

221221
run_frontend: ## run the frontend
222222
@-kill -9 `lsof -t -i:3000`
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# from langflow.field_typing import Data
2+
from langflow.custom import Component
3+
from langflow.io import MessageTextInput, Output
4+
from langflow.schema import Data
5+
6+
7+
class PensionPolicy(Component):
8+
display_name = "养老金政策"
9+
description = "养老金政策"
10+
documentation: str = "https://docs.langflow.org/components-custom-components"
11+
icon = "code"
12+
name = "PensionPolicy"
13+
14+
inputs = [
15+
MessageTextInput(
16+
name="input_value",
17+
display_name="Input Value",
18+
info="这是一个测试输入",
19+
value="请输入你的问题",
20+
tool_mode=False,
21+
),
22+
]
23+
24+
outputs = [
25+
Output(display_name="Output", name="output", method="build_output"),
26+
]
27+
28+
def build_output(self) -> Data:
29+
data = Data(value=self.input_value)
30+
self.status = data
31+
return data

Diff for: src/backend/start.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd ../../ && make backend

Diff for: src/frontend/start-frontend.sh

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
cd ../../ && make frontend

0 commit comments

Comments
 (0)