Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
0cad122
import urlparse in py3
malloxpb Jun 6, 2018
71a2a89
py3 sp in setup.py
malloxpb Jun 6, 2018
248dd75
add sp for py3 in cgurl
malloxpb Jun 7, 2018
54dc582
change to relative import
malloxpb Jun 7, 2018
6c915a9
change the name of the functions to sp py3
malloxpb Jun 7, 2018
a2f09b0
correct print command
malloxpb Jun 7, 2018
9e086f6
fix the build error
malloxpb Jun 7, 2018
9c8a185
fix the import error
malloxpb Jun 7, 2018
b40fbc7
put include_package_data back
malloxpb Jun 7, 2018
888a3bf
change the function names back
malloxpb Jun 7, 2018
746d271
rebuild cython
malloxpb Jun 7, 2018
09c07e0
Merge pull request #1 from nctl144/py3sp
malloxpb Jun 7, 2018
74d7493
testing unicode sp
malloxpb Jun 7, 2018
1c389d9
rebuild cython
malloxpb Jun 7, 2018
f4e21ad
indentation
malloxpb Jun 7, 2018
fa7ba59
convert result to unicode on python2
malloxpb Jun 7, 2018
7509bf4
compile cython on py3
malloxpb Jun 7, 2018
0712b11
fix the urllib import
malloxpb Jun 7, 2018
3f0b956
Merge pull request #2 from nctl144/py3sp
malloxpb Jun 7, 2018
92dfbcc
testing unicode sp
malloxpb Jun 7, 2018
1819f78
rebuild cython
malloxpb Jun 7, 2018
7fb618a
indentation
malloxpb Jun 7, 2018
452a430
convert result to unicode on python2
malloxpb Jun 7, 2018
feebe43
compile cython on py3
malloxpb Jun 7, 2018
70f9128
Merge branch 'unicodesp' of https://github.com/nctl144/urlparse4 into…
malloxpb Jun 8, 2018
65d927d
decode in cython
malloxpb Jun 8, 2018
13eb988
compile cython
malloxpb Jun 8, 2018
30f581f
add travis config file
malloxpb Jun 8, 2018
0ea4927
Merge pull request #3 from nctl144/unicodesp
malloxpb Jun 8, 2018
06c658a
update gitignore
malloxpb Jun 8, 2018
26a94c2
add tox config file
malloxpb Jun 8, 2018
3a5dd47
update the test to the latest
malloxpb Jun 11, 2018
5160908
compile on Python 2 first
malloxpb Jun 11, 2018
8af3567
change the env to python 2
malloxpb Jun 11, 2018
a0bc1ff
update the test to use urlparse4
malloxpb Jun 11, 2018
480da47
put urls into the correct place
malloxpb Jun 11, 2018
25c134d
fix the benchmark file location
malloxpb Jun 11, 2018
faa1feb
delete the pytest-cov for now
malloxpb Jun 11, 2018
74b5549
change the test env to py 3
malloxpb Jun 11, 2018
b67aa6f
recompile urlparse4 on py3
malloxpb Jun 11, 2018
ec16b65
Merge pull request #4 from nctl144/travis
malloxpb Jun 11, 2018
e6110d7
support unicode handling for urljoin
malloxpb Jun 11, 2018
b19d0e7
compile cython on py3
malloxpb Jun 11, 2018
2d6de08
Merge pull request #7 from nctl144/unicode_join
malloxpb Jun 11, 2018
734e3d7
fix failing test by importing
malloxpb Jun 11, 2018
e2abab6
import more variables to not fail the test
malloxpb Jun 11, 2018
1ff8b35
test on py3 only for now
malloxpb Jun 11, 2018
31e224c
decode the result to string on Python 3
malloxpb Jun 11, 2018
23c8b3d
compile cython on py3
malloxpb Jun 11, 2018
9b75d98
add the performance test
malloxpb Jun 11, 2018
1f41372
put the test into the right dir
malloxpb Jun 11, 2018
eb8a4bb
Merge pull request #10 from nctl144/add_perf_test
malloxpb Jun 11, 2018
3d7eb0e
fix failing test by importing
malloxpb Jun 11, 2018
95260b4
import more variables to not fail the test
malloxpb Jun 11, 2018
790bd94
test on py3 only for now
malloxpb Jun 11, 2018
168830f
decode the result to string on Python 3
malloxpb Jun 11, 2018
89a71b3
compile cython on py3
malloxpb Jun 11, 2018
6b76ede
Merge branch 'fix_tests' of https://github.com/nctl144/urlparse4 into…
malloxpb Jun 11, 2018
1699be0
do not change test cases
malloxpb Jun 11, 2018
978eada
decode result based on input types
malloxpb Jun 11, 2018
3aa1b38
compile in py3
malloxpb Jun 11, 2018
af5eced
remove tests that are not related
malloxpb Jun 11, 2018
c351048
DRY code
malloxpb Jun 11, 2018
5c28dd6
compile in py3
malloxpb Jun 11, 2018
0924478
update the performance test
malloxpb Jun 12, 2018
4165c4f
update the performance test
malloxpb Jun 12, 2018
55de674
return based on input types (DRY)
malloxpb Jun 12, 2018
3a034c2
recompile cython on py3
malloxpb Jun 12, 2018
23e10ca
fix encoding urljoin without base
malloxpb Jun 12, 2018
9a7d433
recompile cython
malloxpb Jun 12, 2018
325b518
return username, password based on input
malloxpb Jun 12, 2018
9d7f33b
recompile cython py3
malloxpb Jun 12, 2018
0974a1e
reduce the performance test time
malloxpb Jun 12, 2018
8c97272
update mozilla files from chromium
malloxpb Jun 13, 2018
f958e75
import func to compare scheme
malloxpb Jun 13, 2018
66f4828
import scheme constants
malloxpb Jun 13, 2018
de26520
import the rest of the functions in urlparse
malloxpb Jun 13, 2018
efa4d52
Define isstandard func
malloxpb Jun 13, 2018
b51b05d
rename the file to its true name
malloxpb Jun 13, 2018
9054383
delete the original file
malloxpb Jun 13, 2018
253ff61
parse urls based on their type
malloxpb Jun 13, 2018
757603f
compile cython py3
malloxpb Jun 13, 2018
0a586b0
fix return error
malloxpb Jun 13, 2018
6b55a9e
recompile cython py3
malloxpb Jun 13, 2018
106eb0f
skip deprecated tests
malloxpb Jun 14, 2018
21af6e9
skip other tests for now
malloxpb Jun 14, 2018
15f6d2a
skip the quoter test
malloxpb Jun 14, 2018
4712e73
put the test url back
malloxpb Jun 14, 2018
9f3628f
add py3.5 to test
malloxpb Jun 14, 2018
7144548
import func to compare scheme
malloxpb Jun 13, 2018
caaafef
import scheme constants
malloxpb Jun 13, 2018
93bb8b3
import the rest of the functions in urlparse
malloxpb Jun 13, 2018
f36681f
Define isstandard func
malloxpb Jun 13, 2018
bc4253c
rename the file to its true name
malloxpb Jun 13, 2018
ad7de66
delete the original file
malloxpb Jun 13, 2018
19126e2
parse urls based on their type
malloxpb Jun 13, 2018
0bb23fa
compile cython py3
malloxpb Jun 13, 2018
222a80c
fix return error
malloxpb Jun 13, 2018
dba7798
recompile cython py3
malloxpb Jun 13, 2018
2de8884
recompile cython py3
malloxpb Jun 14, 2018
9cb095b
Merge branch 'fix_split' of https://github.com/nctl144/urlparse4 into…
malloxpb Jun 14, 2018
3effa97
recompile cython, resolve merge conflicts
malloxpb Jun 14, 2018
0bc77f4
mark as todo
malloxpb Jun 14, 2018
0f8428d
update third_party files
malloxpb Jun 14, 2018
8f160ae
return result based on input type
malloxpb Jun 14, 2018
e0e4a97
compile cython
malloxpb Jun 14, 2018
3c5f21c
skip mailto tests for now
malloxpb Jun 14, 2018
3ece971
add note to discuss
malloxpb Jun 14, 2018
507d427
remove deprecation tests
malloxpb Jun 15, 2018
70da959
avoid repetition
malloxpb Jun 15, 2018
455f810
avoid repetition and indentation
malloxpb Jun 15, 2018
37f39c4
shorten the code
malloxpb Jun 15, 2018
61de690
recompile cython py3
malloxpb Jun 15, 2018
f9bbeb3
rename variables
malloxpb Jun 15, 2018
eaec0a9
move code inside main func, move encode outside timer
malloxpb Jun 15, 2018
9f1a6be
fallback to stdlib when failed to parse
malloxpb Jun 15, 2018
4b7c716
recompile cython
malloxpb Jun 15, 2018
89378bf
use argparse instead
malloxpb Jun 15, 2018
7f57de6
indentation
malloxpb Jun 15, 2018
5d66f3f
std split url based on input type
malloxpb Jun 15, 2018
409129f
recompile Cython
malloxpb Jun 15, 2018
3abf155
Merge pull request #13 from nctl144/fix_split
malloxpb Jun 15, 2018
4d6870a
add urlparse function from stdlib
malloxpb Jun 15, 2018
40e96aa
add scheme option for urlsplit
malloxpb Jun 15, 2018
893bdc3
recompile cython py3
malloxpb Jun 15, 2018
2f01138
add test which includes extra func input for urlsplit
malloxpb Jun 18, 2018
770a058
copy urlparse source from urllib
malloxpb Jun 18, 2018
29cb1aa
compile cython
malloxpb Jun 18, 2018
1570854
add performance test for urlparse
malloxpb Jun 18, 2018
00a33ae
add urlparse into urlparse4
malloxpb Jun 18, 2018
ab04c54
adapt urlparse to the proj
malloxpb Jun 18, 2018
bdcee5b
compile cython
malloxpb Jun 18, 2018
56418d0
reorganize code
malloxpb Jun 19, 2018
762b03a
move class methods to a func
malloxpb Jun 19, 2018
a2de522
DRY code
malloxpb Jun 19, 2018
9bb69cc
prep for creating extra classes
malloxpb Jun 19, 2018
88ae788
add note to the func
malloxpb Jun 19, 2018
f4a487c
add docstring to the func
malloxpb Jun 19, 2018
23f52f1
reorganize the code
malloxpb Jun 19, 2018
39e2de0
use the classes to inherit extra prop
malloxpb Jun 19, 2018
b2c0703
correct function type
malloxpb Jun 19, 2018
01a7de6
add extra attributes
malloxpb Jun 19, 2018
7a4878c
compile in cython
malloxpb Jun 19, 2018
e05fae9
correct class name
malloxpb Jun 19, 2018
6d510b1
recompile cython
malloxpb Jun 19, 2018
5007f00
re-correct class method call
malloxpb Jun 19, 2018
088655c
recompile cython
malloxpb Jun 19, 2018
0a8fbde
correct the get attr func
malloxpb Jun 19, 2018
f761972
compile cython
malloxpb Jun 19, 2018
fc63c56
put code into funcs
malloxpb Jun 19, 2018
9a6a328
compile cython
malloxpb Jun 19, 2018
c3fffe4
make the parsed result named tuple work
malloxpb Jun 20, 2018
0d2ca05
enable params property for urlparse
malloxpb Jun 20, 2018
005facd
reorganize code
malloxpb Jun 20, 2018
6e63818
compile cython
malloxpb Jun 20, 2018
98d848f
Merge branch 'urlparse_fix' into urlparse
malloxpb Jun 20, 2018
33fe4dc
recompile
malloxpb Jun 20, 2018
37576c8
add some notes
malloxpb Jun 20, 2018
f8c9a99
this test is failed as expected
malloxpb Jun 20, 2018
e55cd84
fix path parsing func
malloxpb Jun 20, 2018
42a9e2d
compile cython
malloxpb Jun 20, 2018
505cce2
fix params type
malloxpb Jun 20, 2018
0da8526
compile cython
malloxpb Jun 20, 2018
437729e
mark test as failed and state reason
malloxpb Jun 20, 2018
6a5a13e
skip no scheme test for now
malloxpb Jun 20, 2018
a0a1ee8
move func to the right place
malloxpb Jun 20, 2018
9224e6b
fix hostname issue
malloxpb Jun 20, 2018
d46dfe9
cython compile
malloxpb Jun 20, 2018
9c46280
marked the test as failed for now
malloxpb Jun 20, 2018
5807186
recompile cython
malloxpb Jun 20, 2018
622d510
cython some functions
malloxpb Jun 21, 2018
fa9a2a5
use canonicalize from gurl
malloxpb Jun 21, 2018
899297d
canonicalize url correctly
malloxpb Jun 22, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,11 @@
/tmp
/MANIFEST
/urlparse4/*.html
/dist
/dist

# Unit test / coverage reports
.coverage
.tox
nosetests.xml
htmlcov
.pytest_cache
17 changes: 17 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
language: python
sudo: false
branches:
only:
- master
- /^\d\.\d+$/
- /^\d\.\d+\.\d+(rc\d+|\.dev\d+)?$/
matrix:
include:
- python: 3.5
env: TOXENV=py35
- python: 3.6
env: TOXENV=py36
install:
- pip install -U pip tox
script:
- tox
69 changes: 69 additions & 0 deletions benchmarks/performance_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
from urlparse4 import urlsplit, urljoin, urlparse
from timeit import default_timer as timer

import argparse


def main():
parser = argparse.ArgumentParser(description='Measure the time of urlsplit and urljoin')
parser.add_argument('--encode', action='store_true',
help='encode the urls (default: False)')
args = parser.parse_args()

encode = args.encode

urlparse_time = 0

for i in range(5):
with open('urls/chromiumUrls.txt') as f:
for url in f:
if encode:
url = url.encode()

start = timer()
a = urlparse(url)
end = timer()

urlparse_time += end - start

print("the urlparse time is", urlparse_time / 5, "seconds")

urlsplit_time = 0

for i in range(5):
with open('urls/chromiumUrls.txt') as f:
for url in f:
if encode:
url = url.encode()

start = timer()
a = urlsplit(url)
end = timer()

urlsplit_time += end - start

print("the urlsplit time is", urlsplit_time / 5, "seconds")


urljoin_time = 0

for i in range(5):
with open('urls/chromiumUrls.txt') as f:
for url in f:
partial_url = "/asd"

if encode:
url = url.encode()
partial_url = partial_url.encode()

start = timer()
a = urljoin(url, partial_url)
end = timer()

urljoin_time += end - start

print("the urljoin time is", urljoin_time / 5, "seconds")


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion benchmarks/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

URLS = []
for fp in os.listdir("tests/urls/"):
with open("tests/urls/%s" % fp) as f:
with open("urls/%s" % fp) as f:
URLS += f.readlines()

data = []
Expand Down
Loading