forked from Archives/langchain
enable test + lint on docker
This commit is contained in:
parent
c858472d2a
commit
e1bf5d2f09
@ -65,7 +65,7 @@ COPY poetry.* pyproject.toml ./
|
|||||||
|
|
||||||
RUN mkdir /pip-prefix
|
RUN mkdir /pip-prefix
|
||||||
|
|
||||||
RUN poetry export $POETRY_EXTRA_PACKAGES --with dev -f requirements.txt --output requirements.txt --without-hashes && \
|
RUN poetry export $POETRY_EXTRA_PACKAGES --with dev,test,lint -f requirements.txt --output requirements.txt --without-hashes && \
|
||||||
pip install --no-cache-dir --disable-pip-version-check --prefix /pip-prefix -r requirements.txt
|
pip install --no-cache-dir --disable-pip-version-check --prefix /pip-prefix -r requirements.txt
|
||||||
|
|
||||||
|
|
||||||
|
@ -50,3 +50,15 @@ docker.force_build: $(DOCKER_SRC)
|
|||||||
|
|
||||||
docker.clean:
|
docker.clean:
|
||||||
docker rmi $(DOCKER_IMAGE_NAME):$(GIT_HASH) $(DOCKER_IMAGE_NAME):latest
|
docker rmi $(DOCKER_IMAGE_NAME):$(GIT_HASH) $(DOCKER_IMAGE_NAME):latest
|
||||||
|
|
||||||
|
docker.test: docker.build
|
||||||
|
docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH) \
|
||||||
|
pytest /src/tests/unit_tests
|
||||||
|
|
||||||
|
docker.lint: docker.build
|
||||||
|
$(eval DOCKER_CMD = docker run --rm -it -u lchain -v $(ROOTDIR):/src $(DOCKER_IMAGE_NAME):$(GIT_HASH))
|
||||||
|
|
||||||
|
$(DOCKER_CMD) mypy /src
|
||||||
|
$(DOCKER_CMD) black /src --check
|
||||||
|
$(DOCKER_CMD) isort /src --check
|
||||||
|
$(DOCKER_CMD) flake8 /src --check
|
||||||
|
Loading…
Reference in New Issue
Block a user