Pip: `setup.py`の'install_requires'のVCSリンクが機能しない

作成日 2020年04月21日  ·  3コメント  ·  ソース: pypa/pip

環境

  • pipバージョン:20.0.2
  • Pythonバージョン:3.8
  • OS:Debian GNU / Linux 10(バスター)

説明

git+git://github.com/...などのsetup.pyファイルの'install_requires'セクションでVCS要件指定子を使用したいと思います。

python setup.py install --userは次のエラーメッセージで失敗します:

goblinセットアップコマンドのエラー:「install_requires」は、有効なプロジェクト/バージョン要件指定子を含む文字列または文字列のリストである必要があります。 無効な要件、「'+ git://g '」での解析エラー

予想される行動

インストールが成功し、 setup.pyで指定されているとおりに依存関係をインストールすることを期待します。

再現する方法

https://github.com/kkom/goblin/blob/4d112b95dfd2374363b4617b08d3f0689957ea73/setup.pyからこのsetup.pyファイルを使用します。

"""Python toolkit for Tinker Pop 3 Gremlin Server."""

import os
from setuptools import find_packages, setup


__author__ = 'Jeffrey Phillips Freeman'
__email__ = '[email protected]'
__license__ = 'Apache License, Version 2.0'
__copyright__ = 'Copyright 2017, CleverThis, Inc. and contributors'
__credits__ = ['David M. Brown - Project founder']

with open("README.md", "r") as fh:
    long_description = fh.read()

setup(
    name='goblin',
    version='2.2.4',
    license=__license__,
    author=__author__,
    author_email=__email__,
    description='Goblin OGM for the Tinkerpop 3 Stack,',
    long_description_content_type="text/markdown",
    long_description=long_description,
    url='http://goblin-ogm.com',
    download_url='https://github.com/goblin-ogm/goblin/archive/v2.2.4.tar.gz',
    include_package_data=True,
    keywords=['Tinkerpop', 'Tinkerpop3', 'gremlin', 'gremlin-python', 'asyncio', 'graphdb', 'ogm', 'orm'],
    packages=find_packages(),
    python_requires='>=3.5',
    install_requires=[
        'git+git://github.com/kkom/aiogremlin.git<strong i="31">@301c9d1dd0cf07b50934c8df2b51084acea86cd7</strong>',
    ],
    test_suite='tests',
    setup_requires=[
        'pytest-runner>=2.6.2',
    ],
    tests_require=['check-manifest>=0.25',
                   'isort>=4.2.2',
                   'pydocstyle>=1.0.0',
                   'pytest-asyncio>=0.8.0',
                   'pytest-cache>=1.0',
                   'pytest-cov>=2.5.1',
                   'pytest-pep8>=1.0.6',
                   'pytest-timeout>=1.3.4',
                   'pytest>=3.2.1',
                   'uvloop>=0.8.1',
                   'mock'],
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: Apache Software License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
        'Programming Language :: Python :: 3.7',
        'Programming Language :: Python :: 3.8',
        # uncomment if you test on these interpreters:
        # 'Programming Language :: Python :: Implementation :: IronPython',
        # 'Programming Language :: Python :: Implementation :: Jython',
        # 'Programming Language :: Python :: Implementation :: Stackless',
        'Programming Language :: Python :: Implementation :: PyPy'
    ]
)

出力

root<strong i="36">@d6698cc1fa7a</strong>:/workspaces/goblin# python setup.py install --user
error in goblin setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "'+git://g'"

追記

'install_requires'に依存関係を正確に固定することは、完全なアンチパターンであることを認識しています。

aiogremlinのブロッキングバグを修正しているという理由だけでそれを行っています。これは、プログラムで使用しているパッケージであるgoblinの依存関係です。

興味があれば、私はこの問題を別の方法で解決しようとしています: https ://github.com/jazzband/pip-tools/issues/1111

triage

最も参考になるコメント

こんにちは。VCS依存関係の正しい形式はinstall_requires=['aiogremlin @ git+...だと思います。 さらに、セキュリティ上の理由からgit+gitの使用はお勧めしません(8f0dbec5734c5197c3b7070987814b584e3f31a6)。GitHubの場合は、代わりにgit+httpsを使用することをお勧めします。 うまくいけば、これはあなたのために問題を解決します。

全てのコメント3件

こんにちは。VCS依存関係の正しい形式はinstall_requires=['aiogremlin @ git+...だと思います。 さらに、セキュリティ上の理由からgit+gitの使用はお勧めしません(8f0dbec5734c5197c3b7070987814b584e3f31a6)。GitHubの場合は、代わりにgit+httpsを使用することをお勧めします。 うまくいけば、これはあなたのために問題を解決します。

@McSinyxに感謝します、これはそれを解決しました!

そしてそうです- httpsを使用することによるセキュリティの向上についての良い点です!

実際、あなたの解決策は他の問題に関する私の問題も解決します: https ://github.com/jazzband/pip-tools/issues/1111

トリプルウィン! ありがとう@McSinyx!

このページは役に立ちましたか?
0 / 5 - 0 評価