Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't install precommit toolchain on OSX #171

Closed
quansight-bot opened this issue Aug 27, 2020 · 0 comments
Closed

Can't install precommit toolchain on OSX #171

quansight-bot opened this issue Aug 27, 2020 · 0 comments

Comments

@quansight-bot
Copy link

quansight-bot commented Aug 27, 2020

Issue metadata

Issue description

Issue metadata

Issue description

Issue metadata

Issue description

Issue metadata

Issue description

I don't think this is exactly a sgkit issue, but [[[@daletovar](https://github.com/daletovar)](https://github.com/daletovar)](https://github.com/daletovar) and I both encountered errors when trying to install the precommit toolchain on a mac.

For a work around I used this dockerfile.

FROM python:3.8.5-buster
RUN mkdir /project
WORKDIR /project
ENV LANG=C.UTF-8 LC_ALL=C.UTF-8
RUN apt-get update --fix-missing && \
    apt-get install -y wget bzip2 ca-certificates curl git && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*
COPY requirements-dev.txt /project/requirements-dev.txt
COPY requirements.txt /project/requirements.txt
RUN python -m pip install --upgrade pip && \
    pip install -r requirements.txt -r requirements-dev.txt
CMD bash -c "cd /project/sgkit && \
        python -m pip install --upgrade pip && \
        pip install -r requirements.txt -r requirements-dev.txt && \
        cd docs; \
        make html SPHINXOPTS='-W --keep-going' && \
        cd .. && \
        pytest -v --cov=sgkit --cov-report=term-missin g&& \
        pre-commit run --all-files"

Run this once to build

docker build -t sgkit-dev .
docker volume create sgkit-precommit-cache

Run this to test, lint, and run precommit hooks

docker run -it \
    -v sgkit-precommit-cache:/root/.cache -v $HOME/.gitconfig:/root/.gitconfig -v $(pwd):/project/sgkit sgkit-dev

Run this to commit

docker run -it \
    -v sgkit-precommit-cache:/root/.cache -v $HOME/.gitconfig:/root/.gitconfig -v $(pwd):/project/sgkit \
    bash -c 'cd /project/sgkit; git commit -m "My commit msg"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant