INCF / csa

The Python implementation of the Connection-Set Algebra
GNU General Public License v3.0
13 stars 17 forks source link

automatically install requirements #20

Closed bjuergens closed 4 years ago

bjuergens commented 4 years ago

This PR closes https://github.com/INCF/csa/issues/19

I tested this with this Dockerfile:

FROM ubuntu:18.04
ENV MPLBACKEND=agg
RUN apt-get update && apt-get install -y python-pip git build-essential  autoconf libtool shtool
RUN git clone https://github.com/INCF/libneurosim.git \
    && cd libneurosim \
    && touch README \
    && autoreconf --install --force \
    && autoconf configure.ac \
    && ./configure  --with-python=2  \
    && make && make check && make install

# COPY . /csa
RUN git clone https://github.com/bjuergens/csa.git
WORKDIR /csa
RUN ./autogen.sh
RUN ./configure
RUN make
RUN make check
RUN make install

RUN pip install .
CMD python -c "import csa; print csa.__version__"

Run this dockerfile with: docker build -t csa_test . && docker run -it csa_test

bjuergens commented 4 years ago

for getting the version I followed this example on stackoverflow, but instead of parsing the file as a string, I used the ast module.

mdjurfeldt commented 4 years ago

Many thanks!

Can I ask you to update the code formatting style to conform to what is being used in csa? I'm thinking of line 12 in setup.py which is currently:

__version__ = ast.parse(open("csa/version.py").read()).body[0].value.s

but should be:

__version__ = ast.parse (open ("csa/version.py").read ()).body[0].value.s

?

Best regards, Mikael

bjuergens commented 4 years ago

done