russ- / pychallonge

Python bindings for the CHALLONGE! API
http://challonge.com/api
BSD 2-Clause "Simplified" License
49 stars 19 forks source link

Python 3.3 #4

Closed oddballbutler closed 3 years ago

oddballbutler commented 10 years ago

Does pychallonge work with Python 3.3? I keep getting this error when trying to install

    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "E:\pychallonge\src\pychallonge\setup.py", line 2, in <module>
        import challonge
      File ".\challonge\__init__.py", line 4, in <module>
        import tournaments, matches, participants
    ImportError: No module named 'tournaments'
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "E:\pychallonge\src\pychallonge\setup.py", line 2, in <module>

    import challonge

  File ".\challonge\__init__.py", line 4, in <module>

    import tournaments, matches, participants

ImportError: No module named 'tournaments'

I have successfully installed and used pychallonge with Python 2.7

russ- commented 10 years ago

It sounds like it doesn't. I've no experience with Python 3, and no longer have a Python dev env. If it is a trivial problem, feel free to submit a PR.

oddballbutler commented 10 years ago

So I was able to modify it and get it to work, but I had to update to dateutil-2.2 because dateutil-1.5 doesn't work in Python 3. Is there any particular reason why you needed to use dateutil-1.5 instead of the later versions?

russ- commented 10 years ago

The code is ~2 years older than dateutil 2.2 :) If it's not too much trouble, can you test in 2.7 with dateutil 2.2? My expectation is it will work, but worth checking. If it works, feel free to send a PR to update requirements.txt and the blob in README.md.

ghost commented 5 years ago

I just tried to run the tests on python 3.7.3 and got the following:

..........F.F......
======================================================================
FAIL: test_index (__main__.TournamentsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 51, in test_index
    self.assertEqual(self.t, ts[0])
AssertionError: {'id'[307 chars] 15, 21, 13, 58, tzinfo=<iso8601.Utc>), 'updat[2100 chars]alse} != {'id'[307 chars] 15, 17, 13, 58, tzinfo=<FixedOffset '-04:00' [2206 chars]alse}
Diff is 3070 characters long. Set self.maxDiff to None to see it.

======================================================================
FAIL: test_index_filter_by_state (__main__.TournamentsTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "tests.py", line 57, in test_index_filter_by_state
    self.assertEqual(self.t, ts[0])
AssertionError: {'id'[1968 chars]'\n  ', 'auto-assign-stations': None, 'only-st[521 chars]alse} != {'id'[1968 chars]'\n    ', 'auto-assign-stations': None, 'only-[523 chars]alse}
Diff is 2880 characters long. Set self.maxDiff to None to see it.

----------------------------------------------------------------------
Ran 19 tests in 37.008s

FAILED (failures=2)

the tests are failing due to a extra space after the \n in the output as follows: non-elimination-tournament-data": "\n ",

ZEDGR commented 5 years ago

@iGeekuPlay If you want to try my fork because I think @russ- is not maintaining this project anymore.

https://github.com/ZEDGR/pychal

ghost commented 5 years ago

@ZEDGR thanks ran and got the following.

......ss.....sss.....s..................
----------------------------------------------------------------------
Ran 40 tests in 77.261s

OK (skipped=6)
ZEDGR commented 5 years ago

@iGeekuPlay Thanks for using my module

The output that you see is normal because the attachment endpoints are not working and returning Internal Server Error. These errors are from Challonge and I have reported them in the past. Therefore in the tests.py I am skipping those 6 tests. For more info read the section API Issues at the README file

https://github.com/ZEDGR/pychal#api-issues