1
0
mirror of https://github.com/balkian/bitter.git synced 2024-12-22 08:28:12 +00:00

Fix pip installation

This commit is contained in:
J. Fernando Sánchez 2018-08-21 12:54:25 +02:00
parent 5199d5b5aa
commit dd662acd22
2 changed files with 11 additions and 14 deletions

View File

@ -516,7 +516,7 @@ def user_download_batch(wq, batch):
try:
user_ids.append(int(elem))
except ValueError:
screen_names.append(elem)
screen_names.append(elem.lower())
print('Downloading: {} - {}'.format(user_ids, screen_names))
users = wq.users.lookup(user_id=",".join(user_ids), screen_name=",".join(screen_names))
found_ids = []
@ -526,7 +526,7 @@ def user_download_batch(wq, batch):
if uid in user_ids:
found_ids.append(uid)
yield (uid, user)
uname = user['screen_name']
uname = user['screen_name'].lower()
if uname in screen_names:
found_names.append(uname)
yield (uname, user)

View File

@ -1,17 +1,14 @@
import pip
from setuptools import setup
from pip.req import parse_requirements
# parse_requirements() returns generator of pip.req.InstallRequirement objects
# pip 6 introduces the *required* session argument
try:
install_reqs = parse_requirements("requirements.txt", session=pip.download.PipSession())
py2_reqs = parse_requirements("requirements-py2.txt", session=pip.download.PipSession())
test_reqs = parse_requirements("test-requirements.txt", session=pip.download.PipSession())
except AttributeError:
def parse_requirements(filename):
""" load requirements from a pip requirements file """
with open(filename, 'r') as f:
lineiter = list(line.strip() for line in f)
return [line for line in lineiter if line and not line.startswith("#")]
install_reqs = parse_requirements("requirements.txt")
py2_reqs = parse_requirements("requirements-py2.txt")
test_reqs = parse_requirements("test-requirements.txt")
extra_reqs = parse_requirements("extra-requirements.txt")
import sys
import os