diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87e5ae0..f63b6a8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# This workflow will install Python dependencies, run tests, and lint with a variety of Python versions # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python name: build @@ -7,7 +7,7 @@ on: push: branches: [ "master", "dev" ] tags: - - '[0-9]*' + - '[0-9]+' jobs: test: @@ -20,10 +20,12 @@ jobs: steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + - name: Cache pip uses: actions/cache@v2 with: @@ -32,29 +34,30 @@ jobs: restore-keys: | ${{ runner.os }}-pip-${{ matrix.python-version }}- ${{ runner.os }}-pip- + - name: Install Dependencies with Retry run: | cp packaging/setup.py . max_attempts=5 sleep_seconds=10 attempt_num=1 - until timeout $sleep_seconds pip install . || [[ $attempt_num -eq $max_attempts ]] - do + until pip install .; do echo "Attempt $attempt_num of $max_attempts failed! Trying again in $sleep_seconds seconds..." sleep $sleep_seconds ((attempt_num++)) + if [[ $attempt_num -eq $max_attempts ]]; then + echo "All $max_attempts attempts have failed!" + exit 1 + fi done - if [[ $attempt_num -eq $max_attempts ]]; then - echo "All $max_attempts attempts have failed!" - exit 1 - fi - name: Install Test Dependencies run: | python tests/smoke_test.py python -m pip install --upgrade pip pip install --no-deps -r tests/requirements.lock pip install . + - name: Run Tests env: CI: true @@ -65,16 +68,17 @@ jobs: if: github.ref == 'refs/heads/dev' runs-on: ubuntu-latest strategy: - fail-fast: false matrix: python-version: ["3.12"] steps: - uses: actions/checkout@v3 + - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v3 with: python-version: ${{ matrix.python-version }} + - name: Cache pip uses: actions/cache@v2 with: @@ -83,6 +87,23 @@ jobs: restore-keys: | ${{ runner.os }}-pip-${{ matrix.python-version }}- ${{ runner.os }}-pip- + + - name: Install Dependencies with Retry + run: | + cp packaging/setup.py . + max_attempts=5 + sleep_seconds=10 + attempt_num=1 + until pip install .; do + echo "Attempt $attempt_num of $max_attempts failed! Trying again in $sleep_seconds seconds..." + sleep $sleep_seconds + ((attempt_num++)) + if [[ $attempt_num -eq $max_attempts ]]; then + echo "All $max_attempts attempts have failed!" + exit 1 + fi + done + - name: Coverage env: COVERAGE: true @@ -91,7 +112,6 @@ jobs: python -m pip install --upgrade pip pip install --no-deps -r tests/requirements.lock pip install coverage coveralls - cp packaging/setup.py . pip install . coverage run --rcfile=packaging/coverage.ini -m unittest discover tests coverage report --rcfile=packaging/coverage.ini diff --git a/packaging/coverage.ini b/packaging/coverage.ini new file mode 100644 index 0000000..c1e039a --- /dev/null +++ b/packaging/coverage.ini @@ -0,0 +1,10 @@ +[run] +source = + ./mo_sql + +[report] +exclude_lines = + pragma: no cover + except Exception as + except BaseException as + if DEBUG diff --git a/packaging/setup.py b/packaging/setup.py index f5ed5cd..c8b6b81 100644 --- a/packaging/setup.py +++ b/packaging/setup.py @@ -8,12 +8,12 @@ description='More SQL! For safely assembling SQL', extras_require={"tests":["mo-testing>=8.591.24112"]}, include_package_data=True, - install_requires=["mo-dots==9.603.24115","mo-future==7.584.24095","mo-json==6.603.24115","mo-logs==8.603.24115"], + install_requires=["mo-dots==9.605.24115","mo-future==7.584.24095","mo-json==6.605.24115","mo-logs==8.605.24115"], license='MPL 2.0', long_description='# More SQL!\n\nA number of generator functions for type-safe SQL composition.\n\n\n[![PyPI Latest Release](https://img.shields.io/pypi/v/jx-sqlite.svg)](https://pypi.org/project/mo-sql/)\n[![Build Status](https://app.travis-ci.com/klahnakoski/mo-sql.svg?branch=master)](https://travis-ci.com/github/klahnakoski/mo-sql)\n\n## Summary', long_description_content_type='text/markdown', name='mo-sql', packages=["mo_sql"], url='https://github.com/klahnakoski/mo-sql', - version='4.603.24115' + version='4.605.24115' ) \ No newline at end of file diff --git a/packaging/setuptools.json b/packaging/setuptools.json index bf856eb..682d2da 100644 --- a/packaging/setuptools.json +++ b/packaging/setuptools.json @@ -19,8 +19,8 @@ "extras_require": {"tests": ["mo-testing>=8.591.24112"]}, "include_package_data": true, "install_requires": [ - "mo-dots==9.603.24115", "mo-future==7.584.24095", "mo-json==6.603.24115", - "mo-logs==8.603.24115" + "mo-dots==9.605.24115", "mo-future==7.584.24095", "mo-json==6.605.24115", + "mo-logs==8.605.24115" ], "license": "MPL 2.0", "long_description": { @@ -41,5 +41,5 @@ "name": "mo-sql", "packages": ["mo_sql"], "url": "https://github.com/klahnakoski/mo-sql", - "version": "4.603.24115" + "version": "4.605.24115" } \ No newline at end of file diff --git a/tests/requirements.lock b/tests/requirements.lock index b7eae0e..0aba1e4 100644 --- a/tests/requirements.lock +++ b/tests/requirements.lock @@ -2,13 +2,13 @@ # pip install --no-deps -r tests/requirements.lock hjson==3.1.0 mo-collections==5.584.24095 -mo-dots==9.603.24115 +mo-dots==9.605.24115 mo-future==7.584.24095 mo-imports==7.584.24095 -mo-json==6.603.24115 -mo-kwargs==7.603.24115 -mo-logs==8.603.24115 -mo-math==7.603.24115 +mo-json==6.605.24115 +mo-kwargs==7.605.24115 +mo-logs==8.605.24115 +mo-math==7.605.24115 mo-testing==8.591.24112 mo-threads==6.589.24111 -mo-times==5.603.24115 \ No newline at end of file +mo-times==5.605.24115 \ No newline at end of file diff --git a/tests/smoke_test.py b/tests/smoke_test.py new file mode 100644 index 0000000..bb5c273 --- /dev/null +++ b/tests/smoke_test.py @@ -0,0 +1 @@ +import mo_sql