diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 935480a..a613035 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -8,6 +8,8 @@ stages: variables: GIT_SUBMODULE_STRATEGY: recursive + LC_ALL: "C.UTF-8" + LANG: "C.UTF-8" image: registry.gitlab.com/sumner/sublime-music/python-build:latest @@ -15,20 +17,18 @@ lint: stage: test allow_failure: true before_script: - - pip3 install -r dev-requirements.txt - - pip3 install -e . + - ./cicd/install-project-deps.sh script: - - python3 setup.py check -mrs - - flake8 - - mypy sublime + - pipenv run python setup.py check -mrs + - pipenv run flake8 + - pipenv run mypy sublime test: stage: test before_script: - - pip3 install -r dev-requirements.txt - - pip3 install -e . + - ./cicd/install-project-deps.sh script: - - ./cicd/pytest.sh + - pipenv run ./cicd/pytest.sh artifacts: paths: - htmlcov @@ -36,9 +36,9 @@ test: build: stage: build before_script: - - pip3 install -r dev-requirements.txt + - ./cicd/install-project-deps.sh script: - - python3 setup.py sdist + - pipenv run python setup.py sdist artifacts: paths: - dist/* diff --git a/Pipfile b/Pipfile index 7cdbc3e..b9ed51c 100644 --- a/Pipfile +++ b/Pipfile @@ -11,6 +11,8 @@ pytest = "*" pytest-cov = "*" docutils = "*" lxml = "*" +jedi = "*" +rope = "*" [packages] sublime-music = {editable = true,path = "."} diff --git a/Pipfile.lock b/Pipfile.lock index f8391f6..8b04624 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "7f4f4f5e7a33a2def5c2670995d552cf9f0e0e5b969350d286fd082c314ec4cd" + "sha256": "da004735aabedf3def0f7102ddce29046ab09e59d96277401d54098069a5c092" }, "pipfile-spec": 6, "requires": { @@ -276,6 +276,14 @@ "index": "pypi", "version": "==3.7.9" }, + "jedi": { + "hashes": [ + "sha256:786b6c3d80e2f06fd77162a07fed81b8baa22dde5d62896a790a331d6ac21a27", + "sha256:ba859c74fa3c966a22f2aeebe1b74ee27e2a462f56d3f5f7ca4a59af61bfe42e" + ], + "index": "pypi", + "version": "==0.15.1" + }, "lxml": { "hashes": [ "sha256:02ca7bf899da57084041bb0f6095333e4d239948ad3169443f454add9f4e9cb4", @@ -356,6 +364,13 @@ ], "version": "==19.2" }, + "parso": { + "hashes": [ + "sha256:63854233e1fadb5da97f2744b6b24346d2750b85965e7e399bec1620232797dc", + "sha256:666b0ee4a7a1220f65d367617f2cd3ffddff3e205f3f16a0284df30e774c2a9c" + ], + "version": "==0.5.1" + }, "pluggy": { "hashes": [ "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0", @@ -407,6 +422,15 @@ "index": "pypi", "version": "==2.8.1" }, + "rope": { + "hashes": [ + "sha256:6b728fdc3e98a83446c27a91fc5d56808a004f8beab7a31ab1d7224cecc7d969", + "sha256:c5c5a6a87f7b1a2095fb311135e2a3d1f194f5ecb96900fdd0a9100881f48aaf", + "sha256:f0dcf719b63200d492b85535ebe5ea9b29e0d0b8aebeb87fe03fc1a65924fdaf" + ], + "index": "pypi", + "version": "==0.14.0" + }, "six": { "hashes": [ "sha256:1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd", diff --git a/cicd/install-project-deps.sh b/cicd/install-project-deps.sh new file mode 100755 index 0000000..cb340cc --- /dev/null +++ b/cicd/install-project-deps.sh @@ -0,0 +1,6 @@ +#! /bin/sh +export PYENV_ROOT="${HOME}/.pyenv" +export PATH="${PYENV_ROOT}/bin:$PATH" +eval "$(pyenv init -)" + +pipenv install --dev diff --git a/cicd/python-build/Dockerfile b/cicd/python-build/Dockerfile index 5d429ed..e8d1c11 100644 --- a/cicd/python-build/Dockerfile +++ b/cicd/python-build/Dockerfile @@ -3,4 +3,19 @@ FROM ubuntu:18.04 MAINTAINER sumner "https://gitlab.com/sumner" RUN apt update && \ - apt install -y python3-pip libcairo2-dev pkg-config libgtk-3-dev libmpv-dev libglib2.0-dev gir1.2-notify-0.7 + export TZ=America/Denver DEBIAN_FRONTEND=noninteractive && \ + apt install -y \ + python3-pip libcairo2-dev pkg-config libgtk-3-dev libmpv-dev \ + libglib2.0-dev gir1.2-notify-0.7 make build-essential libssl-dev \ + zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev \ + liblzma-dev python-openssl git libgirepository1.0-dev + +RUN cd /usr/local/src && \ + curl -L https://github.com/pyenv/pyenv-installer/raw/master/bin/pyenv-installer | bash + +RUN pip3 install pipenv + +# Install the correct Python version with pyenv +COPY install-python.sh /tmp/install-python.sh +RUN /tmp/install-python.sh diff --git a/cicd/python-build/install-python.sh b/cicd/python-build/install-python.sh new file mode 100755 index 0000000..857a3d0 --- /dev/null +++ b/cicd/python-build/install-python.sh @@ -0,0 +1,6 @@ +#! /bin/sh +export PYENV_ROOT="${HOME}/.pyenv" +export PATH="${PYENV_ROOT}/bin:$PATH" +eval "$(pyenv init -)" + +pyenv install 3.8.0