diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 78ea3cde69ad018bd9f032f758c693b17307c232..ef1e3022abaf1e7acb61d269b9d3eafd37d10e16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,18 +1,43 @@ image: python:3.7 +stages: + - test + - check + - deploy + before_script: - - curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python - - export PATH="$PATH:$HOME/.poetry/bin/" - - source $HOME/.poetry/env + - test -e $HOME/.poetry/bin/ || curl -sSL curl -sSL https://install.python-poetry.org | python3 - + - export PATH="$PATH:$HOME/.local/bin/" + - poetry config virtualenvs.create false + - rm -f poetry.lock + - pip install --upgrade pip - poetry install - - source `poetry env info --path`/bin/activate -build: - stage: build +Unit test: + stage: test script: - - echo 123 + - pytest ./tests/ -test: - stage: test +Python Code Lint: + stage: check + script: + - black . + +Static Type: + stage: check + script: + - mypy . --exclude 'setup\.py$' + # We can remove the flag once this is resolved https://github.com/pypa/setuptools/issues/2345 + +Publish to pypi and update repository: + stage: deploy script: - - echo 123 + - poetry version ${BUMP_RULE} + - git config --global user.email ${GITLAB_USER_EMAIL} + - git config --global user.name ${GITLAB_USER_NAME} + - git add pyproject.toml + - git commit -m "Bump version" + - git remote add origin https://${ACCESS_TOKEN_NAME}:${ACCESS_TOKEN}@${CI_SERVER_HOST}/${CI_PROJECT_PATH}.git && git push -o ci.skip origin HEAD:master + - poetry publish --build --username ${PYPI_USER} --password ${PYPI_PASSWORD} + only: + - master diff --git a/pyproject.toml b/pyproject.toml index 880a2a12ae1afb758fb6baaab64dc9c4296162d3..687d9269b1ae5ecbfc913f9f27e0ae9ac4d069ca 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,14 +6,6 @@ authors = ["Alan Munoz <alan.munoz@ed.ac.uk>"] [tool.poetry.dependencies] python = ">=3.7.1,<3.11" -# extraction = {git = "ssh://git@git.ecdf.ed.ac.uk/swain-lab/python-pipeline/extraction"} -# postprocessor = {git = "ssh://git@git.ecdf.ed.ac.uk/swain-lab/python-pipeline/post-processing"} -# baby = {git = "ssh://git@git.ecdf.ed.ac.uk/swain-lab/python-pipeline/baby"} -# logfile_parser = {git = "ssh://git@git.ecdf.ed.ac.uk/swain-lab/python-pipeline/logfile_parser"} -# extraction = {path="../extraction", develop=false} -# postprocessor = {path="../postprocessor", develop=false} -# baby = {path="../baby", develop=false} -# logfile_parser = {path="../logfile_parser", develop=false} ray = {version = "1.4.0", extras = ["tune"]} numpy = "^1.21.4" dask = "^2021.12.0" @@ -37,7 +29,10 @@ aliby-baby = "*" [tool.poetry.dev-dependencies] -black = "^21.9b0" +black = "^21.12b0" +Sphinx = "^4.3.2" +pytest = "^6.2.5" +mypy = "^0.930" [build-system] requires = ["setuptools", "poetry-core>=1.0.0"]