Skip to content

Commit

Permalink
fix using url in requirements (ali5h#55)
Browse files Browse the repository at this point in the history
fixes ali5h#3
  • Loading branch information
ali5h authored Feb 1, 2021
1 parent 5288b73 commit 1217614
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
1 change: 1 addition & 0 deletions examples/tests/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ python_dateutil

xgboost
prometheus_client
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_sm==2.3.1
12 changes: 12 additions & 0 deletions examples/tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
attrs==20.3.0
azure-core==1.9.0
azure-storage-blob==12.6.0
blis==0.7.4
cachetools==4.1.1
catalogue==1.0.0
certifi==2020.11.8
cffi==1.14.3
chardet==3.0.4
cryptography==3.2.1
cymem==2.0.5
https://github.com/explosion/spacy-models/releases/download/en_core_web_sm-2.3.1/en_core_web_sm-2.3.1.tar.gz#egg=en_core_web_sm==2.3.1
google-api-core[grpc]==1.23.0
google-auth==1.23.0
google-cloud-language==2.0.0
Expand All @@ -17,11 +21,14 @@ isodate==0.6.0
libcst==0.3.13
mock==4.0.2
msrest==0.6.19
murmurhash==1.0.5
mypy-extensions==0.4.3
numpy==1.19.4
oauthlib==3.1.0
packaging==20.4
plac==1.1.3
pluggy==0.13.1
preshed==3.0.5
prometheus-client==0.9.0
proto-plus==1.11.0
protobuf==3.14.0
Expand All @@ -39,10 +46,15 @@ requests==2.25.0
rsa==4.6
scipy==1.5.4
six==1.15.0
spacy==2.3.5
srsly==1.0.5
thinc==7.4.5
toml==0.10.2
tqdm==4.56.0
typing-extensions==3.7.4.3
typing-inspect==0.6.0
urllib3==1.26.2
wasabi==0.8.2
xgboost==1.2.0

# The following packages are considered to be unsafe in a requirements file:
Expand Down
10 changes: 3 additions & 7 deletions src/piptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,11 @@
import os
import re
import sys
from collections import OrderedDict

from pip._internal.network.session import PipSession
from pip._internal.req.constructors import install_req_from_parsed_requirement
from pip._internal.req.req_file import parse_requirements
from pip._vendor.packaging.requirements import Requirement

try:
from collections import OrderedDict
except ImportError:
OrderedDict = dict


def clean_name(name):
Expand Down Expand Up @@ -48,7 +44,7 @@ def as_tuple(preq):
Pulls out the (name: str, version:str, extras:(str)) tuple from
the pinned ParsedRequirement.
"""
req = Requirement(preq.requirement)
req = install_req_from_parsed_requirement(preq)
if not is_pinned_requirement(req, preq.is_editable):
raise TypeError(
(
Expand Down

0 comments on commit 1217614

Please sign in to comment.