apertium / apertium-get

Download and configure an Apertium language pair (along with its monolingual deps) for development
http://wiki.apertium.org/wiki/Apertium-get
GNU General Public License v3.0
3 stars 3 forks source link

Port to Python #10

Closed mr-martian closed 4 years ago

mr-martian commented 4 years ago

This PR is a port of apertium-get to Python. It should have roughly equivalent behavior, though it will correct wrongly ordered pairs, so apertium-get.py eng-ind will download apertium-ind-eng.

Note that all of the Giella functionality is identical to the bash version and is thus equally broken by the move to Github. It would probably be reasonable to wait until everything is figured out regarding that, at which point I can update this PR.

TinoDidriksen commented 4 years ago

Giella is switched to:

To maintain backwards compat, I recommend checking out e.g. lang-kal to giella-kal

mr-martian commented 4 years ago

Some other changes to be made:

mr-martian commented 4 years ago

Ok, I've figured out how to clone and build Giella repos if giella-core and giella-shared are installed, but it doesn't seem to work if they are built but not installed.

The configure step clones giella-core and giella-shared if they aren't installed, so if configure then fails, might it be reasonable to tell the user to install those and try again?

mr-martian commented 4 years ago

(or I might just be missing something about how to build the giella-core nearby but not installed)

TinoDidriksen commented 4 years ago

Replicate this in code:

git clone https://github.com/giellalt/giella-core
pushd giella-core
autoreconf -fvi
./configure
make
popd
export GIELLA_CORE=$(pwd)/giella-core

git clone https://github.com/giellalt/giella-shared
pushd giella-shared
autoreconf -fvi
./configure
make
popd
export GIELLA_SHARED=$(pwd)/giella-shared

The envvars only need to exist while building the giella language.

mr-martian commented 4 years ago

Current behavior when an existing directory is found is to rerun configure - should I keep this behavior or maybe have it only run configure if it doesn't find a makefile?

TinoDidriksen commented 4 years ago

Yes, always rerun autoreconf -fvi and configure

mr-martian commented 4 years ago

I've restructured it, mainly so that it doesn't try to get the same thing twice. I've also run it through Black and fixed the tests.

Failing tests previously were due to the contents of apertium-trunk have changed slightly.

mr-martian commented 4 years ago

ok, now the tests are failing because Travis can't clone via ssh.

sushain97 commented 4 years ago

We should use HTTPS by default because lots of folks don't necessarily have GitHub SSH set up.

mr-martian commented 4 years ago

ok, I'll flip that

mr-martian commented 4 years ago

The test is now passing on Linux, though on Mac there's what I think is a linking error with PCRE in apertium-preprocess-transfer when building nno-nob.

TinoDidriksen commented 4 years ago

Worked for me on macOS. The PCRE error should only happen if trying to run the precompiled binaries on an older macOS. Anyway, passed all tests on platforms I care about, so merged and made Python default installed.