Skip to content
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

req support for Python 3 #3

Closed
paregorios opened this issue Jun 21, 2018 · 11 comments
Closed

req support for Python 3 #3

paregorios opened this issue Jun 21, 2018 · 11 comments

Comments

@paregorios
Copy link

paregorios commented Jun 21, 2018

Evidently this package only works with Python 2. The diagnostic error is that install with pip under Python 3.6.5 OSX El Capitan (10.11.6) fails:

$ pip install hucitlib
Collecting hucitlib
  Downloading https://files.pythonhosted.org/packages/80/8a/768433eba0d9ae07efae3b4f170a6c15dd9484296ab5c05aba292fe91c17/hucitlib-0.2.8.tar.gz (1.9MB)
    100% |████████████████████████████████| 1.9MB 1.7MB/s 
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/z8/2zsyr5dn2cl06wl3fwz3f2_00000gp/T/pip-install-mr7vicxo/hucitlib/setup.py", line 5, in <module>
        execfile('{0}/__version__.py'.format(NAME))
    NameError: name 'execfile' is not defined
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/z8/2zsyr5dn2cl06wl3fwz3f2_00000gp/T/pip-install-mr7vicxo/hucitlib/

Also cannot use git clone and setup.py. Same error:

$ git clone https://github.com/mromanello/hucit_kb.git
Cloning into 'hucit_kb'...
remote: Counting objects: 590, done.
remote: Total 590 (delta 0), reused 0 (delta 0), pack-reused 590
Receiving objects: 100% (590/590), 6.29 MiB | 3.23 MiB/s, done.
Resolving deltas: 100% (326/326), done.
$ cd hucit_kb/
$ python setup.py install
Traceback (most recent call last):
  File "setup.py", line 5, in <module>
    execfile('{0}/__version__.py'.format(NAME))
NameError: name 'execfile' is not defined
@paregorios paregorios changed the title python setup.py install fails on NameError req support for Python 3 Jun 21, 2018
@paregorios
Copy link
Author

I'm going to take a shot at this in https://github.com/paregorios/hucit_kb/tree/python3 and will issue a PR if successful.

@paregorios
Copy link
Author

Nope. This is blocked at least by the dependency on Surf, which seems only to be available for 2.x. They have an FR for Python 3, but that work seems to have stalled in 2016 (sic).

I note here that official support for Python 2 ends on 1 January 2020.

@paregorios
Copy link
Author

I've spent a couple hours trying to upgrade Surf to python 3 and the errors I'm getitng from its tests are beyond my ability to resolve. So this is a dead end for me.

@mromanello
Copy link
Owner

mromanello commented Jun 22, 2018

ok, after having run the tests for this branch I believe this is where something goes wrong: https://github.com/cosminbasca/surfrdf/blob/master/surf/util.py#L321-L349

it's the function responsible for mapping values to their rdflib equivalent and, for some reason, it's casting a unicode string into a base64Binary.

well, actually it may be a bit more complicated than that. What I wrote above was true for py32, later versions throw more obscure exceptions...

@PonteIneptique
Copy link

@PonteIneptique
Copy link

(I am saying this way because I am super happy about it :p )

@PonteIneptique
Copy link

PonteIneptique commented Sep 11, 2018

Note that if this works, I expect to see Hucit really soon in Py3 :D

@mromanello
Copy link
Owner

@PonteIneptique this is fantastic news! so glad and thankful that you got bored ;-) I hope your PR will soon be merged into the main branch, otherwise I'll be happy to use your fork.

And, yes, this was the issue keeping me from migrating my whole citation-extraction framework to Py3.

@PonteIneptique
Copy link

Note, if you want to try to move to Py3, you can install using pip install https://github.com/PonteIneptique/surfrdf/archive/master.zip. This can be a way to start dev :) (Not that I am pushing you. Not really at least. Well... hehe)

@mromanello
Copy link
Owner

mromanello commented Feb 14, 2019

@paregorios @PonteIneptique It took a loooong time, but I'm happy to report that a first version of hucitlib now supports Python 3. 🎉

As I haven't found a way yet to install Thibault's surf from setup.py (suggestions welcome!) you will need to clone this repo, check out branch issue-3/py3 and install it from there after running pip install -r requirements.txt.

Unfortunately, this branch cannot (yet) being merged into master as I have another library (my CitationExtractor) relying on hucitlib which still needs to be ported to Python 3.

Big kudos to @PonteIneptique for his Py3 port of surfrdf without which there wouldn't have been Py3 support for hucitlib 🙏

@mromanello
Copy link
Owner

issue-3/py3 has been now merged with master, so the library runs works under Py3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants