emanjavacas / pie

A fully-fledge PyTorch package for Morphological Analysis, tailored to morphologically rich and historical languages.
MIT License
22 stars 10 forks source link

Make Pie installable from pip and update PyTorch #19

Closed PonteIneptique closed 5 years ago

PonteIneptique commented 5 years ago

Overall, I think it's a great step into making Pie usable in research pipelines !

PonteIneptique commented 5 years ago

Just updated the PR to target /dev instead of master. You can test this in any virtualenv using pip install https://github.com/PonteIneptique/pie/archive/setup_py.zip

emanjavacas commented 5 years ago

Thanks, I've added some comments. I am a bit busy now to test it (hopefully next week). I like it overall but there is a bit of code reduplication that I'd prefer to cut out (basically adding pie to path manually in each script and the commit_build.py). If you can respond to the comments we can move the discussion over there.

On Wed, Feb 20, 2019 at 1:32 PM Thibault Clérice notifications@github.com wrote:

Just updated the PR to target /dev instead of master. You can test this in any virtualenv using pip install https://github.com/PonteIneptique/pie/archive/setup_py.zip

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/emanjavacas/pie/pull/19#issuecomment-465555244, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6Ho43X-fPPkVpJ6CTsWuBxpIjZ4g4Kks5vPUBBgaJpZM4bFGGJ .

-- Enrique Manjavacas

PonteIneptique commented 5 years ago

and thanks for the quick answer.

PonteIneptique commented 5 years ago

Updated according to our current discussion. The rest will come with your decision upon commit_build and requirements.txt

PonteIneptique commented 5 years ago

I did not make any notice but the PR is done on my end ;)

emanjavacas commented 5 years ago

Hey, I am testing it. Just did pip install https://github.com/PonteIneptique/pie/archive/setup_py.zip which installed fine. I am now trying some of the scripts with pie evaluate, etc... but keep getting:

Traceback (most recent call last):
  File "/home/manjavacas/code/python/test/bin/pie", line 11, in <module>
    load_entry_point('pie==0.2.0a1', 'console_scripts', 'pie')()
  File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/__init__.py", line 487, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2728, in load_entry_point
    return ep.load()
  File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2346, in load
    return self.resolve()
  File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2352, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
ModuleNotFoundError: No module named 'pie.scripts'

Could you look into it and perhaps give a MWE? Also it'd be cool to write a help on the available commands if you install through pip: perhaps pie help or just when typing pie. But not sure if that'd be too much work?

PonteIneptique commented 5 years ago

You can do pie --help. For the other issues, it seems weird. I am afk the next 10 days but will try to have a look

Le jeudi 28 février 2019, Enrique Manjavacas notifications@github.com a écrit :

Hey, I am testing it. Just did pip install https://github.com/ PonteIneptique/pie/archive/setup_py.zip which installed fine. I am now trying some of the scripts with pie evaluate, etc... but keep getting:

Traceback (most recent call last): File "/home/manjavacas/code/python/test/bin/pie", line 11, in load_entry_point('pie==0.2.0a1', 'console_scripts', 'pie')() File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/init.py", line 487, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/init.py", line 2728, in load_entry_point return ep.load() File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/init.py", line 2346, in load return self.resolve() File "/home/manjavacas/code/python/test/lib/python3.6/site-packages/pkg_resources/init.py", line 2352, in resolve module = import(self.module_name, fromlist=['name'], level=0) ModuleNotFoundError: No module named 'pie.scripts'

Could you look into it and perhaps give a MWE? Also it'd be cool to write a help on the available commands if you install through pip: perhaps pie help or just when typing pie. But not sure if that'd be too much work?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/emanjavacas/pie/pull/19#issuecomment-468407015, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1yZvxgaVRqeRI7XEo-fdivjr94_oYaks5vSC9MgaJpZM4bFGGJ .

PonteIneptique commented 5 years ago

I am unable to replicate your issue right now, before the flight. My process is :

virtualenv pieenv -p python3.6
source pieenv/bin/activate
pip install https://github.com/PonteIneptique/pie/archive/setup_py.zip
pie --help # Gets the available commands
pie tag ./path/to/model path/to/text.txt

And it just runs. I have tried on two different linux machine but did not try on Mac.

emanjavacas commented 5 years ago

Hi,

sorry it was my bad, python was picking my local version of pie in the python path. It works now, but I keep getting the warning:

fatal: not a git repository (or any of the parent directories): .git
WARNING:root:
    It seems like you download `pie` instead of git-cloning it or
installing it with pip.
    We won't be able to check compatibility between pretrained models and
`pie` version

although I did pip-installed it. Once that's done we can submit it to pypi. Thanks for this PR!

On Fri, Mar 1, 2019 at 8:02 AM Thibault Clérice notifications@github.com wrote:

I am unable to replicate your issue right now, before the flight. My process is :

virtualenv pieenv -p python3.6source pieenv/bin/activate pip install https://github.com/PonteIneptique/pie/archive/setup_py.zip pie --help # Gets the available commands pie tag ./path/to/model path/to/text.txt

And it just runs. I have tried on two different linux machine but did not try on Mac.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/emanjavacas/pie/pull/19#issuecomment-468565245, or mute the thread https://github.com/notifications/unsubscribe-auth/AF6Ho-jnp3jJ5-c4OiLFn13rg98EU70Nks5vSNCAgaJpZM4bFGGJ .

-- Enrique Manjavacas

PonteIneptique commented 5 years ago

This should go away as soon as you'll do python setup.py upload as the upload script will add the current commit sha to the python file. Installing it via archive download cannot do that :) That's also a reason why I added the a0 at the end of the version, to be sure this would work before releasing a stable 0.2.0.

PonteIneptique commented 5 years ago

Referring to this : https://github.com/emanjavacas/pie/blob/96dab614c6d62c9a60ec8209f71b9af4f30d11e5/setup.py#L92-L98

Note that the upload could be tied with Travis which would be quite cool. This is how I did for numerous of my libraries, to avoid duplicating releasing efforts.

emanjavacas commented 5 years ago

merged!

PonteIneptique commented 5 years ago

Regarding one of your last comment, updating the Readme for the right command could be a good idea.

Le ven. 1 mars 2019 à 12:03 PM, Enrique Manjavacas notifications@github.com a écrit :

merged!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/emanjavacas/pie/pull/19#issuecomment-468628942, or mute the thread https://github.com/notifications/unsubscribe-auth/AB1yZnnkYqXcrAfXgk2jNoqp0CdvnPRzks5vSQjpgaJpZM4bFGGJ .