devpi process提供了一种程序化API来创建和使用devpi服务器进程
项目描述
devpi-process
允许您创建具有索引的 devpi 服务器进程,并可以程序化地将工件上传到该进程。
安装
pip install devpi-process
使用
from pathlib import Path
from devpi_process import Index, IndexServer
with IndexServer(Path("server-dir")) as server:
# create an index mirroring an Artifactory instance
magic_index_url = "https://magic.com/artifactory/api/pypi/magic-pypi/simple"
base_name = "magic"
server.create_index(base_name, "type=mirror", f"mirror_url={magic_index_url}")
# create a dev index server that bases of magic PyPI, and upload a wheel to it
dev: Index = server.create_index("dev", f"bases={server.user}/{base_name}")
dev.upload("magic-2.24.0-py3-none-any.whl")
assert dev.url # point the tool consuming the index server to this