xinyiguan / py2lispIDyOM

A Python package for IDyOM
https://xinyiguan.github.io/py2lispIDyOM/
MIT License
10 stars 3 forks source link

Automating the installation step #12

Closed hayesall closed 2 years ago

hayesall commented 2 years ago

The installation is pretty tricky at the moment, following from the idyom installation instructions.

Recommmendation: Figure out how to automate installation on a common platform (e.g. Ubuntu).

sbcl

This one should be pretty straightforward:

curl -L http://prdownloads.sourceforge.net/sbcl/sbcl-2.2.9-x86-64-linux-binary.tar.bz2 > sbcl-2.2.9-x86-64-linux-binary.tar.bz2
bzip2 -cd sbcl-2.2.9-x86-64-linux-binary.tar.bz2 | tar xvf -
cd sbcl-2.2.9-x86-linux
sudo sh install.sh

quicklisp

This one might be trickier. The quicklisp installation instructions currently suggest installing in interactive mode.

I didn't test it yet (I'm less familiar with sbcl), but using --eval might be one path to follow here:

sbcl --eval '(quicklisp-quickstart:install)'

sqlite3

This one should be easy.

sudo apt install sqlite3

IDyOM

This one feels fairly straightforward after figuring out the username (whoami), and evaluating a few expressions to make sure packages are correctly downloaded.

Here is a rough draft for the fourth step:

echo '(ql:quickload "clsql")' >> .sbclrc
echo '(defun start-idyom ()' >> .sbclrc
echo "  (defvar *idyom-root* \"/home/$(whoami)/idyom/\")" >> .sbclrc
echo "  (ql:quickload \"idyom\")" >> .sbclrc
echo "  (clsql:connect '(\"/home/$(whoami)/idyom/db/database.sqlite\") :if-exists :old :database-type :sqlite3))" >> .sbclrc
xinyiguan commented 2 years ago

Thank you so much for outlining the steps. I've written up a shell script to automate the IDyOM installation process (for MacOS). The instructions are also updated in the README.

hayesall commented 2 years ago

Nice! I do not have a mac to test on, but the setup looks good.

hayesall commented 2 years ago

Following up on #10: now that there's a way to automatically install dependencies, this should be incorporated into the continuous integration settings.

Right now, these lines are missed in the coverage step:

https://github.com/xinyiguan/py2lispIDyOM/blob/5d04e44be3df7a04d41cabf3a8da772a4f85a4d4/py2lispIDyOM/run.py#L113-L125

These lines look like they're among the most important in the package (since this appears to be the main way that Python and sbcl actually interact).

I'll be more confident about testing when this part is in the CI.

xinyiguan commented 2 years ago

I just incorporated the installation to CI and added additional test to cover the .run() method. I changed to only the macos platform in the tests.yml workflow for the test because the install shell script works for (and is only tested on) macos for the moment.