Files
MemRelay/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/内网 PyPI 源体系(pypiserver + 离线工具 + 网页管理).md
T

20 lines
1.7 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
title: 内网 PyPI 源体系(pypiserver + 离线工具 + 网页管理)
type: fact
permalink: main/projects/d5a7f581-c442-4554-87b9-ee723b8b0258/内网-py-pi-源体系-pypiserver-离线工具-网页管理
stable_id: 77949bba-f7b8-4fc0-859d-70f415614148
scope: project
project_id: d5a7f581-c442-4554-87b9-ee723b8b0258
memory_type: fact
status: active
revision: 1
restored_from_commit: 6a6a895eafcca6052e81a14fca103a42635dd1c2
created_at: '2026-09-23T15:09:34.526216+00:00'
updated_at: '2026-09-23T15:09:34.526276+00:00'
tags:
- pypi
- offline
- packages
---
线上 metrix-pypiserver 容器(packaging/pypiserver/Dockerfile 基于本地 python:3.13.11-slim),包目录 /opt/pypiserver/packages,对外 18280。使用方:脚本容器/终端走系统设置 script_pip_index_url=http://172.17.0.1:18280/simple/ + trusted_host=172.17.0.1(容器内不能直连宿主 LAN IP 映射端口,必须走网桥网关);开发机也无法直连 18280,核对包列表走 Metrix API /api/pypi/packages。加包工具 scripts/pypi_mirror.py:download(pip download,cp311/312/313 × manylinux_2_17,支持 -r requirements)/ upload(paramiko SFTP,跳过同名同大小,--clean 上完清空 temp/wheelhouse,支持 .whl+.tar.gz)/ status;无参数进交互菜单。网页「内网源」模块(前后端 pypi):列表/搜索/上传/按版本删除,后端是 pypiserver 轻代理(无库表,:action=file_upload/remove_pkg),设置项 pypi_server_url=http://172.17.0.1:18280。库存(2026-08-13):115 包/186 文件,覆盖数据解析/文件/并行/FTP⁄SFTP⁄SSH/异步/HTTP/压缩/pyzmq/FastAPI 全家桶/数据库驱动/ORM(sqlalchemy⁄django⁄sqlmodel⁄tortoise⁄peewee⁄pony⁄mongoengine⁄databases⁄asyncpg⁄aiosqlite)及依赖。