Pypi& PyPi测试无法找到满足要求的任何下载

时间:2015-03-20 23:17:54

标签: python python-2.7 pip distutils pypi

我正在尝试通过pypi发布软件,而pip可以搜索该库,但无法下载该库。

我怀疑这是setup.py文件的问题,

doclines = __doc__.split("\n")
with open('requirements.txt') as f:
    required = f.read().splitlines()

setup(
    name='Directory_Caching',
    packages=find_packages(),
    version='1.0.6',
    description = doclines[0],
    long_description = "\n".join(doclines[2:]),
    author='Benjamin Schollnick',
    author_email='benjamin@schollnick.net',
    license="MIT",
    maintainer='Benjamin Schollnick',
    maintainer_email='benjamin@schollnick.net',
    platforms=["Any"],
    url='https://github.com/bschollnick/Directory_Caching',
    download_url = 'https://github.com/bschollnick/Directory_Caching/tarball/1.05',
    #install_requires=required,
    #requires=required,
    keywords = ['caching', 'files', 'directories', 'scandir', 'naturalsort'],
    classifiers=filter(None, classifiers.split("\n")),
)

Pypitest正在接受文件,通过注册,并且sdist上传工作正常。

- 注册

nerv:Directory_caching Benjamin$ python setup.py register -r pypitest
running register
running egg_info
deleting Directory_Caching.egg-info/requires.txt
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
running check
Registering Directory_Caching to https://testpypi.python.org/pypi
Server response (200): OK
nerv:Directory_caching Benjamin$ python setup.py sdist upload -r pypitest
running sdist
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt

running check
creating Directory_Caching-1.0.503
creating Directory_Caching-1.0.503/Directory_Caching
creating Directory_Caching-1.0.503/Directory_Caching.egg-info
making hard links in Directory_Caching-1.0.503...
hard linking setup.cfg -> Directory_Caching-1.0.503
hard linking setup.py -> Directory_Caching-1.0.503
hard linking Directory_Caching/__init__.py -> Directory_Caching-1.0.503/Directory_Caching
hard linking Directory_Caching/directory_caching.py -> Directory_Caching-1.0.503/Directory_Caching
hard linking Directory_Caching.egg-info/PKG-INFO -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/SOURCES.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/dependency_links.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/top_level.txt -> Directory_Caching-1.0.503/Directory_Caching.egg-info
copying setup.cfg -> Directory_Caching-1.0.503
Writing Directory_Caching-1.0.503/setup.cfg
Creating tar archive
removing 'Directory_Caching-1.0.503' (and everything under it)
running upload
Submitting dist/Directory_Caching-1.0.503.tar.gz to https://testpypi.python.org/pypi
Server response (200): OK
nerv:Directory_caching Benjamin$ python setup.py register -r pypitest
running register
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
running check
Registering Directory_Caching to https://testpypi.python.org/pypi
Server response (200): OK

上传

nerv:Directory_caching Benjamin$ python setup.py sdist upload -r pypitest
running sdist
running egg_info
writing Directory_Caching.egg-info/PKG-INFO
writing top-level names to Directory_Caching.egg-info/top_level.txt
writing dependency_links to Directory_Caching.egg-info/dependency_links.txt
reading manifest file 'Directory_Caching.egg-info/SOURCES.txt'
writing manifest file 'Directory_Caching.egg-info/SOURCES.txt'
warning: sdist: standard file not found: should have one of README, README.rst, README.txt

running check
creating Directory_Caching-1.0.504
creating Directory_Caching-1.0.504/Directory_Caching
creating Directory_Caching-1.0.504/Directory_Caching.egg-info
making hard links in Directory_Caching-1.0.504...
hard linking setup.cfg -> Directory_Caching-1.0.504
hard linking setup.py -> Directory_Caching-1.0.504
hard linking Directory_Caching/__init__.py -> Directory_Caching-1.0.504/Directory_Caching
hard linking Directory_Caching/directory_caching.py -> Directory_Caching-1.0.504/Directory_Caching
hard linking Directory_Caching.egg-info/PKG-INFO -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/SOURCES.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/dependency_links.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
hard linking Directory_Caching.egg-info/top_level.txt -> Directory_Caching-1.0.504/Directory_Caching.egg-info
copying setup.cfg -> Directory_Caching-1.0.504
Writing Directory_Caching-1.0.504/setup.cfg
Creating tar archive
removing 'Directory_Caching-1.0.504' (and everything under it)
running upload
Submitting dist/Directory_Caching-1.0.504.tar.gz to https://testpypi.python.org/pypi
Server response (200): OK

如果我在pip上运行详细运行,则会出现以下错误?

Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.504 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .504
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.503 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .503
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.502 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .502
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.501 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .501
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.51 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .51
Skipping link https://testpypi.python.org/pypi/Directory_Caching/1.0.5 (from https://testpypi.python.org/pypi/Directory_Caching); unknown archive format: .5

我在Github上设置了标签(https://github.com/bschollnick/Directory_Caching),使用pypi或pypi测试中的链接似乎工作正常。有什么建议吗?

1 个答案:

答案 0 :(得分:0)

我不确定,这是我使用的基本设置,但没有问题。

import os
from distutils.core import setup

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
  name = 'name',
  packages = ['package'],
  version = '1.0.0',
  author = 'your name',
  author_email = 'some_email@gmail.com',
  url = 'github', 
  download_url = 'git download link', 
  keywords = ['keywords'],
  description = 'short description', 
  long_description = read('README.txt'),
  classifiers = [],
)