-
-
Notifications
You must be signed in to change notification settings - Fork 250
Adding proxy API's for etherscan #35
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
Conversation
@corpetty recommended that we stick to python3.6 What is your opinion ? |
I agree that sticking with at least >= 3.6 is at least my preference. I'd like to make sure that this doesn't break other's use of it. @AndreMiras @taylorjdawson do you need python versions before 3.6? |
Thanks for asking, my app is running on Python 3.6, but indeed normally libraries should have quite wide support to different python versions. And this is currently enforced with tox checking for 2 and 3 https://github.com/corpetty/py-etherscan-api/blob/f3cd702/tox.ini |
@corpetty Nope, I am fine if we drop it too. |
Please also drop Python2.7 from |
@agatsoh please remove 2.7 from tox.ini and travis.yaml and re-PR |
@agatsoh The naming of 'check_keys_api' is somewhat ambiguous. I feel like adding comments would be valuable here (and eventually required w/ linting integration). |
@corpetty Why did that check fail? |
@@ -13,8 +13,8 @@ def test_get_most_recent_block(self): | |||
api = Proxies(api_key=API_KEY) | |||
# currently raises an exception even though it should not, see: | |||
# https://github.com/corpetty/py-etherscan-api/issues/32 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We forgot to remove that comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am currently working on cleaning up the code a bit. I'll remove that in my pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great thanks!
Also I'm not getting why Travis didn't fail on the linter when it should have complained. Running tox
locally I see some valid complain.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So just remove the comment then?
Also, If the proxy apis fail you get this:
{
jsonrpc: "2.0",
id: 1,
error: {
code: -32602,
message: "[some error message]"
}
}
I don't think this is accounted for in this PR. However, I think #8 would fix this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the linter still just pointing at the tests folder only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes the two lines comments were with a self.assertRaises(EmptyResponse)
to describe a bug. But the bug was fixed and assert removed in 06f7b04, but the comment was left. So yes basically just removing that two comment is enough.
Also you can delete the print
, I don't think we need print
in unit tests. Plus I think we should avoid making actual network calls, but actual mock it, but that's a different story.
I'm not sure regarding the rainy scenario. with error code and message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True for the linter it's currently only tests folder, but that one is also failing. e.g. tests/test_proxies.py:4:1: F401 'etherscan.client.EmptyResponse' imported but unused
https://github.com/corpetty/py-etherscan-api/blob/06f7b04/tests/test_proxies.py#L4 and other couple of more. So really not sure why Travis didn't catch these obvious ones.
They don't pop up when you run tox
on your dev env?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran flake8?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No I ran tox
that rans flake8
for you.
tox
GLOB sdist-make: /home/andre/workspace/py-etherscan-api/setup.py
pep8 inst-nodeps: /home/andre/workspace/py-etherscan-api/.tox/dist/py_etherscan_api-0.7.0.zip
pep8 installed: certifi==2018.4.16,chardet==3.0.4,flake8==3.5.0,idna==2.6,mccabe==0.6.1,py-etherscan-api==0.7.0,pycodestyle==2.3.1,pyflakes==1.6.0,requests==2.18.4,urllib3==1.22
pep8 runtests: PYTHONHASHSEED='913872812'
pep8 runtests: commands[0] | flake8 tests/
tests/test_proxies.py:4:1: F401 'etherscan.client.EmptyResponse' imported but unused
tests/test_proxies.py:20:1: W391 blank line at end of file
tests/test_proxies.py:20:1: W293 blank line contains whitespace
ERROR: InvocationError: '/home/andre/workspace/py-etherscan-api/.tox/pep8/bin/flake8 tests/'
py3 inst-nodeps: /home/andre/workspace/py-etherscan-api/.tox/dist/py_etherscan_api-0.7.0.zip
py3 installed: atomicwrites==1.1.5,attrs==18.1.0,certifi==2018.4.16,chardet==3.0.4,idna==2.6,more-itertools==4.2.0,pluggy==0.6.0,py==1.5.3,py-etherscan-api==0.7.0,pytest==3.6.2,requests==2.18.4,six==1.11.0,typing==3.6.4,urllib3==1.22
py3 runtests: PYTHONHASHSEED='913872812'
py3 runtests: commands[0] | python -m unittest discover --start-directory=tests/
5848317
/usr/lib/python3.6/unittest/case.py:605: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.130', 42938), raddr=('23.111.151.66', 443)>
testMethod()
./usr/lib/python3.6/unittest/case.py:605: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.130', 42940), raddr=('23.111.151.66', 443)>
testMethod()
./usr/lib/python3.6/unittest/case.py:605: ResourceWarning: unclosed <ssl.SSLSocket fd=3, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('192.168.1.130', 42942), raddr=('23.111.151.66', 443)>
testMethod()
.
----------------------------------------------------------------------
Ran 3 tests in 2.913s
OK
_____________________________________________________________________________________________________________________________________ summary _____________________________________________________________________________________________________________________________________
ERROR: pep8: commands failed
py3: commands succeeded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay just ran that. Got the same results. When should we switch flake8 to the whole directory?
Great! Still don't know why Travis didn't complain about it. It should be
turned on when another pull request fixes the errors :)
El lun., 25 jun. 2018 0:32, Taylor Dawson <notifications@github.com>
escribió:
… ***@***.**** commented on this pull request.
------------------------------
In tests/test_proxies.py
<#35 (comment)>
:
> @@ -13,8 +13,8 @@ def test_get_most_recent_block(self):
api = Proxies(api_key=API_KEY)
# currently raises an exception even though it should not, see:
# #32
Okay just ran that. Got the same results. When should we switch flake8 to
the whole directory?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABhjU9ROarsQLRYSQp6BuSd-DVDdyvgks5uABOSgaJpZM4Uifo9>
.
|
We should have a slack/discord. Which would you guys prefer? |
I like gitter :)
El lun., 25 jun. 2018 1:18, Taylor Dawson <notifications@github.com>
escribió:
… We should have a slack/discord. Which would you guys prefer?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABhjVK40SSkJFzlHyn0KhxFIGJ0noEIks5uAB4ygaJpZM4Uifo9>
.
|
Works for me! Do you want to create one and invite us?
On Sun, 24 Jun 2018 at 16:23 Andre Miras ***@***.***> wrote:
I like gitter :)
El lun., 25 jun. 2018 1:18, Taylor Dawson ***@***.***>
escribió:
> We should have a slack/discord. Which would you guys prefer?
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <
#35 (comment)
>,
> or mute the thread
> <
https://github.com/notifications/unsubscribe-auth/AABhjVK40SSkJFzlHyn0KhxFIGJ0noEIks5uAB4ygaJpZM4Uifo9
>
> .
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#35 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AcSpxFaXFEIXCdtPp8K6CChyLY8KXFbvks5uAB90gaJpZM4Uifo9>
.
--
TAYLOR J. DAWSON
Computer Science and Math,
George Fox University
<https://github.com/taylorjdawson> <https://twitter.com/TaylorJDawson_>
<https://www.linkedin.com/in/taylorjamesdawson/>
<http://taylorjdawson.com/>
|
I was imagining the project to have his own gitter room. From what I remember, all it needs is the maintainer @corpetty to authenticate to https://gitter.im/ and pick a room. Then gitter bot will come with a pull request to add the gitter badge to the project README. |
Hi I am extending the API's for proxy and will help for any other things in my free time. I will also write the remaining API's onceI find time.