简体   繁体   English

为什么 pip 安装缺少我的 package 的源代码?

[英]Why is pip install missing source of my package?

I have a private package which I have uploaded to my private devpi server.我有一个私人的 package,我已经上传到我的私人 devpi 服务器。 When I use pip to install it, only the egg folder is installed.我用pip安装时,只安装了egg文件夹。 The source is missing and hence I am unable to use any code or libraries in my package.缺少源代码,因此我无法在我的 package 中使用任何代码或库。

My setup.py :我的setup.py

from setuptools import setup, find_packages

setup(
  name='my-package',
  version=1.0,
  packages=find_packages(),
  install_requires=[
      'requests>=2.21.0',
  ]
)

I am using a venv within Pycharm to do all of this.我在 Pycharm 中使用 venv 来完成所有这些。 Why is this happening?为什么会这样? How can I force pip to download and install the source distribution?如何强制 pip 下载并安装源代码分发版?

[EDIT] When I download the tarball from my devpi server UI, it does NOT contain the source. [编辑]当我从我的 devpi 服务器 UI 下载 tarball 时,它不包含源代码。 Which means that when I upload the package with devpi upload it is not uploading the sdist?这意味着当我使用devpi upload上传 package 时,它没有上传 sdist? I could not find anything on how to force devpi to force to upload an sdist.我找不到任何关于如何强制 devpi 强制上传 sdist 的信息。

Here is the build log:这是构建日志:

running sdist
running egg_info
writing ****.egg-info/PKG-INFO
writing dependency_links to ****.egg-info/dependency_links.txt
writing requirements to ****.egg-info/requires.txt
writing top-level names to ****.egg-info/top_level.txt
reading manifest file '****.egg-info/SOURCES.txt'
writing manifest file '****.egg-info/SOURCES.txt'
running check
warning: Check: missing required meta-data: url

warning: Check: missing meta-data: either (author and author_email) or (maintainer and maintainer_email) must be supplied

creating ...
creating ***.egg-info
creating ***-1.0/client
creating ***-1.0/client/model
copying files to ***-1.0...
copying README.md -> ****-1.0
copying setup.py -> ****-1.0
copying ****.egg-info/PKG-INFO -> ****-1.0/****.egg-info
copying ****.egg-info/SOURCES.txt -> ****-1.0/****.egg-info
copying ****.egg-info/dependency_links.txt -> ****-1.0/****.egg-info
copying ****.egg-info/requires.txt -> ****-1.0/****.egg-info
copying ****.egg-info/top_level.txt -> ****-1.0/****.egg-info
copying the actual source here
Writing ****-1.0/setup.cfg
Creating tar archive
removing '****-1.0' (and everything under it)

This fixed it:这修复了它:

devpi upload dist/pkg-ver.tar.gz

Basically, run it from root of my project.基本上,从我项目的根目录运行它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM