From 16049f0057a37539f041e2c83c38b416990251e3 Mon Sep 17 00:00:00 2001 From: Robert Shelton Date: Tue, 30 Apr 2024 11:09:10 -0400 Subject: [PATCH] Update release.yml add push branch --- .github/workflows/release.yml | 43 +++++++++++++++++------------------ .gitignore | 3 ++- pyproject.toml | 4 ++-- scripts.py | 24 +++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d7d7bce6..4715bb2b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,6 +1,9 @@ name: Release on: + # TODO: remove + push: + branches: [ robert/build/tests ] workflow_dispatch: inputs: version: @@ -13,7 +16,7 @@ env: jobs: build: - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -40,7 +43,7 @@ jobs: test-pypi-publish: needs: build - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -59,15 +62,13 @@ jobs: path: dist/ - name: Publish to TestPyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: __token__ - password: ${{ secrets.TEST_PYPI_API_TOKEN }} - repository_url: https://test.pypi.org/legacy/ + env: + POETRY_PYPI_TOKEN_TESTPYPI: ${{ secrets.TESTPYPI }} + run: poetry config repositories.test-pypi https://test.pypi.org/legacy/; poetry config pypi-token.test-pypi $POETRY_PYPI_TOKEN_TESTPYPI; poetry publish --repository test-pypi pre-release-checks: needs: test-pypi-publish - runs-on: ubuntu-22.04 + runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -80,13 +81,10 @@ jobs: - name: Install Poetry uses: snok/install-poetry@v1 - - name: Install dependencies - run: | - poetry install --all-extras + # - name: Install dependencies + # run: | + # poetry install --all-extras - name: Install published package from TestPyPI - run: | - poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl==${{ github.event.inputs.version }} - - name: Run tests env: OPENAI_API_KEY: ${{ secrets.OPENAI_KEY }} GCP_LOCATION: ${{ secrets.GCP_LOCATION }} @@ -96,11 +94,12 @@ jobs: AZURE_OPENAI_ENDPOINT: ${{secrets.AZURE_OPENAI_ENDPOINT}} AZURE_OPENAI_DEPLOYMENT_NAME: ${{secrets.AZURE_OPENAI_DEPLOYMENT_NAME}} OPENAI_API_VERSION: ${{secrets.OPENAI_API_VERSION}} - run: | - poetry run test-cov + run: + poetry run pip install --index-url https://test.pypi.org/simple/ --no-deps redisvl-test; poetry run test-cov + # publish: # needs: pre-release-checks - # runs-on: ubuntu-22.04 + # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 @@ -118,14 +117,14 @@ jobs: # name: dist # path: dist/ - # - name: Publish to PyPI - # env: - # POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }} - # run: poetry publish + # - name: Publish to PyPI + # env: + # POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI }} + # run: poetry publish # create-release: # needs: publish - # runs-on: ubuntu-22.04 + # runs-on: ubuntu-latest # steps: # - uses: actions/checkout@v4 diff --git a/.gitignore b/.gitignore index 9e24dd50..d4204a44 100644 --- a/.gitignore +++ b/.gitignore @@ -9,4 +9,5 @@ scratch wiki_schema.yaml docs/_build/ .venv -coverage.xml \ No newline at end of file +coverage.xml +dist/ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 79051f6c..51506116 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] -name = "redisvl" -version = "0.1.3" +name = "redisvl-test" +version = "0.1.3.9" description = "Python client library and CLI for using Redis as a vector database" authors = ["Redis Inc. "] license = "MIT" diff --git a/scripts.py b/scripts.py index cfc254da..aff65db9 100644 --- a/scripts.py +++ b/scripts.py @@ -1,36 +1,36 @@ import subprocess def format(): - subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"]) - subprocess.run(["black", "./redisvl", "./tests/"]) + subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"], check=True) + subprocess.run(["black", "./redisvl", "./tests/"], check=True) def check_format(): - subprocess.run(["black", "--check", "./redisvl"]) + subprocess.run(["black", "--check", "./redisvl"], check=True) def sort_imports(): - subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"]) + subprocess.run(["isort", "./redisvl", "./tests/", "--profile", "black"], check=True) def check_sort_imports(): - subprocess.run(["isort", "./redisvl", "--check-only", "--profile", "black"]) + subprocess.run(["isort", "./redisvl", "--check-only", "--profile", "black"], check=True) def check_lint(): - subprocess.run(["pylint", "--rcfile=.pylintrc", "./redisvl"]) + subprocess.run(["pylint", "--rcfile=.pylintrc", "./redisvl"], check=True) def mypy(): - subprocess.run(["python", "-m", "mypy", "./redisvl"]) + subprocess.run(["python", "-m", "mypy", "./redisvl"], check=True) def test(): - subprocess.run(["python", "-m", "pytest", "--log-level=CRITICAL"]) + subprocess.run(["python", "-m", "pytest", "--log-level=CRITICAL"], check=True) def test_verbose(): - subprocess.run(["python", "-m", "pytest", "-vv", "-s", "--log-level=CRITICAL"]) + subprocess.run(["python", "-m", "pytest", "-vv", "-s", "--log-level=CRITICAL"], check=True) def test_cov(): - subprocess.run(["python", "-m", "pytest", "-vv", "--cov=./redisvl", "--cov-report=xml", "--log-level=CRITICAL"]) + subprocess.run(["python", "-m", "pytest", "-vv", "--cov=./redisvl", "--cov-report=xml", "--log-level=CRITICAL"], check=True) def cov(): - subprocess.run(["coverage", "html"]) + subprocess.run(["coverage", "html"], check=True) print("If data was present, coverage report is in ./htmlcov/index.html") def test_notebooks(): - subprocess.run(["cd", "docs/", "&&", "poetry run treon", "-v"]) \ No newline at end of file + subprocess.run(["cd", "docs/", "&&", "poetry run treon", "-v"], check=True) \ No newline at end of file