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 #141

Closed
jerowe opened this issue Aug 27, 2020 · 4 comments
Closed

Can't install precommit toolchain on OSX #141

jerowe opened this issue Aug 27, 2020 · 4 comments

Comments

@jerowe
Copy link

jerowe commented Aug 27, 2020

I don't think this is exactly a sgkit issue, but @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"'
@jeromekelleher
Copy link
Collaborator

@jerowe, @daletovar, can you give us some details about the issues that you hit when installing the pre-commit toolchain please?

@jerowe
Copy link
Author

jerowe commented Aug 27, 2020

@jeromekelleher I don't completely remember except that it was some kind of compiler error. Homebrew is broken on my mac and installing with conda didn't help, but I also didn't try that hard with a conda install.

I could try more with conda if it's a workaround anyone is interested in.

@daletovar
Copy link
Collaborator

When I would run pre-commit it would fail to build the wheel for numcodecs. Specifically it looks like it failed to build the blosc extension.

@jeromekelleher
Copy link
Collaborator

Looks like this is the same issue as #134 then

@hammer hammer closed this as completed Sep 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants