建造上游源区的车轮

发布于 2025-01-26 08:13:05 字数 448 浏览 2 评论 0原文

背景:

我的环境在非标准架构上运行,因此在执行PIP安装时,它通常必须从其SDISTS构建依赖关系的车轮。我想限制必须发生的次数并加快构建的速度,尤其是对于具有C扩展的依赖项。

我确实可以访问一个可以上传SDIST或车轮的私人PYPI索引,因此我认为我可以每周运行,这可以预编译车轮的耗时较高的依赖项,并将这些车轮上传到我的私人索引。

问题:

鉴于依赖关系和版本的名称,我可以为该依赖项下载SDIST的最简单方法是什么?例如,我的形象类似:

wget $PIP_INDEX_URL/some/index/package_version.tar
tar xf package_version.tar
python -m build -w -o dist/ .
twine upload --repository private-pypi dist/*

Background:

My environment runs on a non-standard architecture, so when doing pip install, it often has to build wheels for dependencies from their sdists. I want to limit the amount of times this has to happen and speed up my builds, especially for dependencies with C extensions.

I do have access to a private PyPI index where I can upload sdists or wheels, so I was thinking I could have a weekly job running which pre-compiles the wheels of the more time consuming dependencies and upload these wheels to my private index.

Question:

Given the name of a dependency and version, what is the easiest way I can download the sdist for that dependency and build the wheel? e.g. I image something like:

wget $PIP_INDEX_URL/some/index/package_version.tar
tar xf package_version.tar
python -m build -w -o dist/ .
twine upload --repository private-pypi dist/*

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

无边思念无边月 2025-02-02 08:13:05

能够解决此用法pip wheelpip下载,多亏@博士学位。它很简单:

pip download --no-binary=:all: --no-deps ${PACKAGE}==${VERSION}
pip wheel --no-deps ${PACKAGE}-${VERSION}.tar.gz 
twine upload --repository private-pypi ./*

Was able to solve this use pip wheel combined with pip download, thanks to @phd. Its as simple as:

pip download --no-binary=:all: --no-deps ${PACKAGE}==${VERSION}
pip wheel --no-deps ${PACKAGE}-${VERSION}.tar.gz 
twine upload --repository private-pypi ./*
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文