Skip to content

Commit

Permalink
feat: run flake8 in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
j-abi authored and Hartorn committed Nov 4, 2019
1 parent ae3098c commit e72d416
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
22 changes: 22 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
version: 2
jobs:
lint-code:
machine:
image: circleci/classic:latest
working_directory: ~/tabnet
resource_class: medium
steps:
- checkout
- run:
name: LintCode
command: |
make build
make install
make lint
workflows:
version: 2
CI-tabnet:
jobs:
- lint-code
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
data/
.ipynb_checkpoints/
*.pt
*~

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
FROM python:3.7-slim-buster
RUN apt update && apt install curl make git -y
RUN apt update && apt install curl make git -y
RUN curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python
ENV SHELL /bin/bash -l

Expand All @@ -10,5 +10,6 @@ ENV JUPYTER_CONFIG_DIR /work/.cache/jupyter/config

RUN $HOME/.poetry/bin/poetry config settings.virtualenvs.path $POETRY_CACHE

# ENTRYPOINT ["poetry", "run"]
ENV PATH /root/.poetry/bin:/bin:/usr/local/bin:/usr/bin

CMD ["bash", "-l"]
9 changes: 9 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ WARN_COLOR=\\e[33m
PORT=8889
.SILENT: ;
default: help; # default target
DOCKER_RUN = docker run --rm -v ${FOLDER}:/work -w /work --entrypoint bash -lc python-poetry:latest -c

IMAGE_NAME=python-poetry:latest

Expand All @@ -23,6 +24,14 @@ start: build
docker run --rm -it -v ${FOLDER}:/work -w /work -p ${PORT}:${PORT} -e "JUPYTER_PORT=${PORT}" ${IMAGE_NAME}
.PHONY: start

install: build
$(DOCKER_RUN) 'poetry install'
.PHONY: install

lint:
$(DOCKER_RUN) 'poetry run flake8'
.PHONY: lint

notebook:
poetry run jupyter notebook --allow-root --ip 0.0.0.0 --port ${PORT} --no-browser --notebook-dir .
.PHONY: notebook
Expand Down

0 comments on commit e72d416

Please # to comment.