apertium / apertium-python

now you can even use apertium from python
GNU General Public License v3.0
31 stars 27 forks source link

Windows Script Isolated PR #33

Closed orgh0 closed 5 years ago

orgh0 commented 6 years ago

The following has the windows.py script which when run should setup apertium+python to work from it's repo directory.

sushain97 commented 6 years ago

Good to see a mostly isolated PR. I think there are still a number of unrelated changes that slipped in.

to work from it's repo directory.

Installing from source is unfortunately not a great experience. This needs to be wrapped into the pip install script.

We also can't add a random dependency on 7z. There aren't any reputable Python libraries out there (packaged on pip) that can extract debian archives?

sushain97 commented 6 years ago

Also, I think this PR should pass all checks since in theory it adds support for Windows on appveyor and doesn't break Linux support.

orgh0 commented 6 years ago

I tried looking for one. Couldn't find any. Also another interesting observation. Appveyor seemed to have 7z run properly.

Strange, don't you think?

On Tue, Aug 7, 2018, 2:34 AM Sushain Cherivirala notifications@github.com wrote:

Good to see a mostly isolated PR. I think there are still a number of unrelated changes that slipped in.

to work from it's repo directory.

Installing from source is unfortunately not a great experience. This needs to be wrapped into the pip install script.

We also can't add a random dependency on 7z. There aren't any reputable Python libraries out there (packaged on pip) that can extract debian archives?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apertium/apertium-python/pull/33#issuecomment-410852569, or mute the thread https://github.com/notifications/unsubscribe-auth/AVVjFME6N8BVRt0qzuXGYPnWre4fIt6iks5uOK9NgaJpZM4Vw8zF .

orgh0 commented 6 years ago

@sushain,

There's an issue with apertium-all-dev right now according to Tino. The binaries should work without any compilation once the lt-toolbox weights feature is fixed.

On Tue, Aug 7, 2018, 2:35 AM Sushain Cherivirala notifications@github.com wrote:

Also, I think this PR should pass all checks since in theory it adds support for Windows on appveyor and doesn't break Linux support.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/apertium/apertium-python/pull/33#issuecomment-410852797, or mute the thread https://github.com/notifications/unsubscribe-auth/AVVjFExYK1SKAu5kKCYXEP66PPTd9BWzks5uOK-EgaJpZM4Vw8zF .

sushain97 commented 6 years ago

I tried looking for one. Couldn't find any.

Have you tried https://packages.debian.org/sid/python-debian?

There's also http://unix-ar.readthedocs.io/en/latest/ that could be vendor'd if its license is compatible.

There are also a number of others I saw that might be fruitful.

There's an issue with apertium-all-dev right now according to Tino.

That isn't the issue here:

https://ci.appveyor.com/project/apertium/apertium-python/build/1.0.194/job/j2qdh54xxt9vaqrw#L91

orgh0 commented 6 years ago

@sushain97

The packages aren't available for windows. I'm trying to look at other things that can be done.

coveralls commented 6 years ago

Pull Request Test Coverage Report for Build 217


Changes Missing Coverage Covered Lines Changed/Added Lines %
apertium/init.py 6 8 75.0%
apertium/analysis/init.py 5 7 71.43%
<!-- Total: 11 15 73.33% -->
Totals Coverage Status
Change from base Build 159: 0.4%
Covered Lines: 592
Relevant Lines: 732

💛 - Coveralls
orgh0 commented 6 years ago

@sushain97 The appveyor build passes :)

sushain97 commented 6 years ago

Awesome! Could you convert this to being in a setup.py's install target? Then, both Linux and Windows should just run python3 setup.py install and then test without having to install any dependencies before hand. As far as the pair installation goes, that should be a separate command. Maybe something like python3 -m apertium install eng (we should at some point look into making this interface work for other options but that's another ticket).

I'm OK with pushing removing the 7z dependency to another ticket as well but as I've been saying, this interface should be all wrapped up in setup.py. Otherwise, users would have to clone the repo instead of using a normal Python installation method.

Finally, just asking users to set the PATH for each usage of the script is not sustainable. We need to modify the registry using something like what's described in https://stackoverflow.com/questions/1085852/interface-for-modifying-windows-environment-variables-from-python on install. I believe there's a way to get pkg_resources to provide you the absolute path where things get installed after setup.py install runs.

orgh0 commented 6 years ago

@sushain97 , I wanted to make an initial script first to check if at all this method would work fine or not. So, now it's going to be a lot easier for me to write a setup.py.

I've gone through the docs for the same and that's what I'll be doing now.

orgh0 commented 6 years ago

@sushain97 making of the setup.py can be a good GCI task don't you think?

sushain97 commented 6 years ago

This one is also on the list, a little broken up.

On Fri, Sep 21, 2018, 9:06 AM Arghya Bhatttacharya notifications@github.com wrote:

@sushain97 https://github.com/sushain97 making of the setup.py can be a good GCI task don't you think?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apertium/apertium-python/pull/33#issuecomment-423587322, or mute the thread https://github.com/notifications/unsubscribe-auth/AEBEfiCCvQKE9JbWB_YdG1b9TSOTUNzlks5udQ5mgaJpZM4Vw8zF .

timkabot commented 5 years ago

How should i use lt-comp on windows?

timkabot commented 5 years ago

coultd you provide some examples about compilation plz

orgh0 commented 5 years ago

@timkabot.

Once apertium is set up on Windows the process and usage of lt-comp is pretty much the same.

The windows.py script should set up Apertium for you on your machine.

Following which running Apertium lt-comp would be as trivial as it is on Linux/Mac OS