From 8a0364e266e2cf40a8822180fd935e5dcaa84784 Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 14:44:37 +0100 Subject: [PATCH 1/6] change github action for tests --- .github/workflows/quality-check.yaml | 70 +++++++++++++++++++--------- 1 file changed, 47 insertions(+), 23 deletions(-) diff --git a/.github/workflows/quality-check.yaml b/.github/workflows/quality-check.yaml index 0476809..3a033f9 100644 --- a/.github/workflows/quality-check.yaml +++ b/.github/workflows/quality-check.yaml @@ -17,32 +17,56 @@ name: Tests on: [push] jobs: - check-and-test: + test: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] - tensorflow: [2.2.1] - poetry-version: [1.1.6] + python-version: [ 3.7 ] + tensorflow: [ 2.2.1 ] name: Python-${{ matrix.python-version }} tensorflow${{ matrix.tensorflow }} - env: - VERSION_TF: ${{ matrix.tensorflow }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up python + uses: actions/setup-python@v2 + with: python-version: ${{ matrix.python-version }} - - name: Run image - uses: abatilo/actions-poetry@v2.0.0 - with: - poetry-version: ${{ matrix.poetry-version }} - - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('notebook_requirements.txt') }}-${{ hashFiles('tests_requirements.txt') }} - # ------------ install markovflow - - name: Install package - run: poetry install - # ------------ run tests - - name: Run tests - run: poetry run task quicktest + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.1.6 + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + #---------------------------------------------- + # install your root project, if required + #---------------------------------------------- + - name: Install library + run: poetry install --no-interaction + #---------------------------------------------- + # run test suite + #---------------------------------------------- + - name: Run tests + run: poetry run task quicktest From d5241bf661152bc1374638e8f1a026505fdb2e73 Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 14:49:45 +0100 Subject: [PATCH 2/6] get in venv before deploy --- .github/workflows/deploy.yaml | 107 +++++++++++++++++++++------------- 1 file changed, 68 insertions(+), 39 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 3a5d7fd..534e467 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,50 +14,79 @@ name: Deploy -on: - push: - branches: - - develop +#on: +# push: +# branches: +# - develop + +on: [push] + jobs: - docs: + test: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.7] - tensorflow: [2.2.1] - poetry-version: [1.1.6] + python-version: [ 3.7 ] + tensorflow: [ 2.2.1 ] name: Python-${{ matrix.python-version }} tensorflow${{ matrix.tensorflow }} - env: - VERSION_TF: ${{ matrix.tensorflow }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 - with: + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up python + uses: actions/setup-python@v2 + with: python-version: ${{ matrix.python-version }} - - name: Run image - uses: abatilo/actions-poetry@v2.0.0 - with: - poetry-version: ${{ matrix.poetry-version }} - - uses: actions/cache@v2 - with: - path: ${{ env.pythonLocation }} - key: ${{ env.pythonLocation }}-${{ hashFiles('setup.py') }}-${{ hashFiles('notebook_requirements.txt') }}-${{ hashFiles('tests_requirements.txt') }} - # ------------ install markovflow - - name: Install package - run: poetry install - - name: make documentation - run: | - make docs - - run: | - TMP_DIR=$(mktemp -d -p $(pwd)) - mv docs/_build/html/* $TMP_DIR - rm -rf docs - mv $TMP_DIR docs - touch docs/.nojekyll - - run: | - git add . - git config --global user.email "none" - git config --global user.name "github-actions-bot" - git commit -m "build documentation" - git push -f origin HEAD:gh-pages + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 + with: + version: 1.1.6 + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + #---------------------------------------------- + # install your root project, if required + #---------------------------------------------- + - name: Install library + run: poetry install --no-interaction + #---------------------------------------------- + # build documentation + #---------------------------------------------- + - name: make documentation + run: | + source .venv/bin/activate + make docs + - run: | + TMP_DIR=$(mktemp -d -p $(pwd)) + mv docs/_build/html/* $TMP_DIR + rm -rf docs + mv $TMP_DIR docs + touch docs/.nojekyll + - run: | + git add . + git config --global user.email "none" + git config --global user.name "github-actions-bot" + git commit -m "build documentation" + git push -f origin HEAD:gh-pages From 37dc684afc4e33b1821c49dd57dd1d2ce3c266ab Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 15:18:26 +0100 Subject: [PATCH 3/6] deploy doc upon merge into develop --- .github/workflows/deploy.yaml | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 534e467..6167abb 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,16 +14,13 @@ name: Deploy -#on: -# push: -# branches: -# - develop - -on: [push] - +on: + push: + branches: + - develop jobs: - test: + check-and-test: runs-on: ubuntu-latest strategy: matrix: @@ -72,6 +69,11 @@ jobs: - name: Install library run: poetry install --no-interaction #---------------------------------------------- + # run test suite + #---------------------------------------------- + - name: Run tests + run: poetry run task quicktest + #---------------------------------------------- # build documentation #---------------------------------------------- - name: make documentation From 460223878d7f7507a0fb34810daa377a4aba0313 Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 15:34:03 +0100 Subject: [PATCH 4/6] set environment var to run notebooks ci_niter --- .github/workflows/deploy.yaml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 6167abb..78423c3 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,14 +14,17 @@ name: Deploy -on: - push: - branches: - - develop +#on: +# push: +# branches: +# - develop +on: [push] jobs: - check-and-test: + check-test-deploy-docs: runs-on: ubuntu-latest + env: + DOCS: "" strategy: matrix: python-version: [ 3.7 ] From b14ee2a0f3336d8a1bd66e970185c8afac6b5718 Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 15:34:36 +0100 Subject: [PATCH 5/6] set environment var to run notebooks ci_niter skip test --- .github/workflows/deploy.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index 78423c3..e8c9b55 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -74,8 +74,8 @@ jobs: #---------------------------------------------- # run test suite #---------------------------------------------- - - name: Run tests - run: poetry run task quicktest + # - name: Run tests + # run: poetry run task quicktest #---------------------------------------------- # build documentation #---------------------------------------------- From b12b34a6261faa88a3cc448ba40caffa490f2d0d Mon Sep 17 00:00:00 2001 From: Vincent Adam Date: Tue, 21 Sep 2021 15:54:36 +0100 Subject: [PATCH 6/6] change version, clean workflow --- .github/workflows/deploy.yaml | 16 ++-- .github/workflows/quality-check.yaml | 2 +- .github/workflows/upload-pypi.yaml | 106 +++++++++++++-------------- VERSION | 2 +- pyproject.toml | 2 +- 5 files changed, 60 insertions(+), 68 deletions(-) diff --git a/.github/workflows/deploy.yaml b/.github/workflows/deploy.yaml index e8c9b55..d785bea 100644 --- a/.github/workflows/deploy.yaml +++ b/.github/workflows/deploy.yaml @@ -14,11 +14,10 @@ name: Deploy -#on: -# push: -# branches: -# - develop -on: [push] +on: + push: + branches: + - develop jobs: check-test-deploy-docs: @@ -50,7 +49,6 @@ jobs: virtualenvs-create: true virtualenvs-in-project: true installer-parallel: true - #---------------------------------------------- # load cached venv if cache exists #---------------------------------------------- @@ -67,15 +65,15 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- - # install your root project, if required + # install root project #---------------------------------------------- - name: Install library run: poetry install --no-interaction #---------------------------------------------- # run test suite #---------------------------------------------- - # - name: Run tests - # run: poetry run task quicktest + - name: Run tests + run: poetry run task quicktest #---------------------------------------------- # build documentation #---------------------------------------------- diff --git a/.github/workflows/quality-check.yaml b/.github/workflows/quality-check.yaml index 3a033f9..147be80 100644 --- a/.github/workflows/quality-check.yaml +++ b/.github/workflows/quality-check.yaml @@ -61,7 +61,7 @@ jobs: if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' run: poetry install --no-interaction --no-root #---------------------------------------------- - # install your root project, if required + # install root project #---------------------------------------------- - name: Install library run: poetry install --no-interaction diff --git a/.github/workflows/upload-pypi.yaml b/.github/workflows/upload-pypi.yaml index d285816..d045010 100644 --- a/.github/workflows/upload-pypi.yaml +++ b/.github/workflows/upload-pypi.yaml @@ -14,8 +14,6 @@ name: Upload-PyPI - - on: workflow_dispatch: push: @@ -23,66 +21,62 @@ on: tags: v[0-9]+.[0-9]+.[0-9]+* jobs: - check-and-test: + check-test-deploy-docs: runs-on: ubuntu-latest + env: + DOCS: "" strategy: matrix: - python-version: [3.7] - tensorflow: [2.2.1] - poetry-version: [1.1.6] - name: Python-${{ matrix.python-version }} + python-version: [ 3.7 ] + tensorflow: [ 2.2.1 ] + name: Python-${{ matrix.python-version }} tensorflow${{ matrix.tensorflow }} steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + #---------------------------------------------- + # check-out repo and set-up python + #---------------------------------------------- + - name: Check out repository + uses: actions/checkout@v2 + - name: Set up python + uses: actions/setup-python@v2 with: python-version: ${{ matrix.python-version }} - # ------------ Install poetry - - name: Setup pip/poetry - run: | - pip install -U pip poetry twine - poetry config virtualenvs.create false - # ------------ build and install package - - name: Install package - run: poetry install - # ------------ run tests - - name: Run tests - run: poetry run task test - pypi: - # needs: check-and-test - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.7] - poetry-version: [1.1.6] - name: Release PyPi package - steps: - - uses: actions/checkout@v2 - - uses: actions/setup-python@v2 + #---------------------------------------------- + # ----- install & configure poetry ----- + #---------------------------------------------- + - name: Install Poetry + uses: snok/install-poetry@v1 with: - python-version: ${{ matrix.python-version }} - # ------------ Install poetry - - name: Setup pip/poetry + version: 1.1.6 + virtualenvs-create: true + virtualenvs-in-project: true + installer-parallel: true + #---------------------------------------------- + # load cached venv if cache exists + #---------------------------------------------- + - name: Load cached venv + id: cached-poetry-dependencies + uses: actions/cache@v2 + with: + path: .venv + key: venv-${{ runner.os }}-${{ hashFiles('**/poetry.lock') }} + #---------------------------------------------- + # install dependencies if cache does not exist + #---------------------------------------------- + - name: Install dependencies + if: steps.cached-poetry-dependencies.outputs.cache-hit != 'true' + run: poetry install --no-interaction --no-root + #---------------------------------------------- + # install root project + #---------------------------------------------- + - name: Install library run: | - pip install -U pip poetry twine - poetry config virtualenvs.create false - # ------------ build and install package - # - name: Install package - # run: | - # poetry install - # poetry build - - name: Build and publish to pypi - uses: JRubics/poetry-publish@v1.8 + poetry install --no-interaction + poetry build + #---------------------------------------------- + # publish to pypi + #---------------------------------------------- + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 with: - python_version: "3.7" - poetry_version: "==1.1.6" # (PIP version specifier syntax) - pypi_token: ${{ secrets.PYPI_TOKEN }} - build_format: "sdist" - repository_name: "markovflow" - repository_url: "https://github.com/secondmind-labs/markovflow" - ignore_dev_requirements: "yes" - # # ------------ publish to pypi - # - name: Publish to PyPI - # uses: pypa/gh-action-pypi-publish@release/v1 - # with: - # user: __token__ - # password: ${{ secrets.PYPI_TOKEN }} + user: __token__ + password: ${{ secrets.PYPI_TOKEN }} diff --git a/VERSION b/VERSION index 5c4511c..9bbaee4 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.0.7 \ No newline at end of file +0.0.12 \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 851747d..21e1f53 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "markovflow" -version = "0.0.7" +version = "0.0.12" description = "A Tensorflow based library for Time Series Modelling with Gaussian Processes" authors = ["Markovflow Contributors "] packages = [{include = "markovflow"}]