-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Installing packages that references an git repository in requirements.txt fails. #1052
Comments
Furthermore, don't load a |
As much as that is said I know of a few packages that use an requirements.txt file to install dependencies when you pip install it (discord.py being one of said packages). I guess I could modify the code to where if it finds an Edit: here is my work arround setup.py. from setuptools import setup
from setuptools.extension import Extension
import sys
def get_requirements(remove_links=True):
"""
lists the requirements to install.
"""
requirements = []
try:
with open('requirements.txt') as f:
requirements = f.read().splitlines()
except Exception as ex:
with open('DecoraterBotUtils.egg-info\requires.txt') as f:
requirements = f.read().splitlines()
if remove_links:
for requirement in requirements:
# git repository url.
if requirement.startswith("git+"):
requirements.remove(requirement)
# subversion repository url.
if requirement.startswith("svn+"):
requirements.remove(requirement)
# mercurial repository url.
if requirement.startswith("hg+"):
requirements.remove(requirement)
return requirements
def get_links():
"""
gets URL Dependency links.
"""
links_list = get_requirements(remove_links=False)
for link in links_list:
keep_link = False
already_removed = False
# git repository url.
if not link.startswith("git+"):
if not link.startswith("svn+"):
if not link.startswith("hg+"):
links_list.remove(link)
already_removed = True
else:
keep_link = True
if not keep_link and not already_removed:
links_list.remove(link)
already_removed = True
else:
keep_link = True
if not keep_link and not already_removed:
links_list.remove(link)
return links_list
def get_version():
"""
returns version.
"""
return '0.0.1'
def get_extensions():
"""
lists the extensions to build with an compiler.
"""
if sys.platform != 'cygwin':
BotErrors = Extension(
'DecoraterBotUtils.BotErrors', [
'DecoraterBotUtils/BotErrors.c'])
else:
BotErrors = Extension(
'DecoraterBotUtils.BotErrors',
library_dirs=['/usr/local/bin'],
sources=['DecoraterBotUtils/BotErrors.c'])
return [BotErrors]
if not get_version():
raise RuntimeError('version is not set')
try:
with open('README.rst') as f:
readme = f.read()
except FileNotFoundError:
readme = ""
setup(name='DecoraterBotUtils',
author='Decorater',
author_email='[email protected]',
url='https://github.com/DecoraterBot-devs/DecoraterBotUtils',
bugtrack_url='https://github.com/DecoraterBot-devs/DecoraterBotUtils/issues',
version=get_version(),
packages=['DecoraterBotUtils'],
ext_modules=get_extensions(),
license='MIT',
description='This package is for bringing various things to DecoraterBot.',
long_description=readme,
maintainer_email='[email protected]',
download_url='https://github.com/DecoraterBot-devs/DecoraterBotUtils',
include_package_data=True,
install_requires=get_requirements(),
dependency_links=get_links(),
platforms='Any',
classifiers=[
'Development Status :: 5 - Production/Stable',
'Intended Audience :: Developers',
'License :: OSI Approved :: MIT License',
'Natural Language :: English',
'Operating System :: OS Independent',
'Programming Language :: C',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries',
'Topic :: Software Development :: Libraries :: Python Modules',
]
) |
We were able to make it work only using pypa/pip#3610 (comment) |
1 similar comment
We were able to make it work only using pypa/pip#3610 (comment) |
Here is an example package's
reuirements.txt
andsetup.py
that is hosted on github only that fails every time it is attempted to be installed using pip.Also happens when running setup.py directly without pip.
requirements.txt:
setup.py:
output with pip:
output without pip:
When entering the
get_requirements
and executing it directly in python's interactive mode:In interactive mode it works as expected (without executing setuptools) but in pip for some reason it fails when it should not fail. Unless setuptools cannot process the vcs's properly that pip gladly supports and is able to take in and process just fine.
The text was updated successfully, but these errors were encountered: