From d4eba9ac426265ff794d834b991d2294a5acfc8d Mon Sep 17 00:00:00 2001 From: laggykiller Date: Sun, 25 Feb 2024 10:55:29 +0800 Subject: [PATCH] Add test during building --- .github/workflows/pythonpackage.yml | 96 ++++++++++++++++++++--------- .gitignore | 3 +- pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 71 insertions(+), 32 deletions(-) diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index 3676d7e..53a66be 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -12,11 +12,13 @@ jobs: - uses: actions/checkout@v3 with: submodules: true + - if: steps.sqlite-amalgamation.outputs.cache-hit != 'true' run: | cd sqlcipher/ LIBS="-lm" ./configure --disable-tcl --enable-tempstore=always make sqlite3.c + - uses: actions/upload-artifact@v3 with: name: sqlite-amalgamation @@ -24,8 +26,59 @@ jobs: sqlcipher/sqlite3.c sqlcipher/sqlite3.h + build-sdist: + needs: prepare-sqlite + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v3 + with: + submodules: false + + - uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - uses: actions/download-artifact@v3 + with: + name: sqlite-amalgamation + path: ./ + + - name: Build sdist + run: pipx run build --sdist + + - uses: actions/upload-artifact@v3 + with: + name: sdist + path: dist/sqlcipher3_wheels-*.tar.gz + + test-sdist: + needs: build-sdist + runs-on: ubuntu-20.04 + + steps: + - name: Fetch source distribution + uses: actions/download-artifact@v3 + with: + name: sdist + path: dist/ + + - uses: actions/setup-python@v4 + with: + python-version: 3.8 + + - name: Install the package + run: | + python -m pip install dist/sqlcipher3_wheels-*.tar.gz + + - name: Test + run: | + mv sqlcipher3 sqlcipher3_ + python -m test + mv sqlcipher3_ sqlcipher3 + build-wheels: - needs: [prepare-sqlite] + needs: prepare-sqlite runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -99,7 +152,7 @@ jobs: steps: - uses: actions/checkout@v3 with: - submodules: true + submodules: false - uses: actions/setup-python@v4 with: @@ -123,44 +176,29 @@ jobs: CIBW_BUILD: ${{ matrix.cibw_build }} CIBW_ARCHS: ${{ matrix.cibw_archs }} CIBW_ENVIRONMENT: SQLCIPHER3_COMPILE_TARGET=${{ matrix.compile_target }} + CIBW_TEST_COMMAND: > + mv sqlcipher3 sqlcipher3_ && + python -m test && + mv sqlcipher3_ sqlcipher3 - uses: actions/upload-artifact@v3 with: + name: wheels path: ./wheelhouse/*.whl - build-sdist: - needs: [prepare-sqlite] - runs-on: ubuntu-20.04 - - steps: - - uses: actions/checkout@v3 - with: - submodules: true - - - uses: actions/setup-python@v4 - with: - python-version: 3.8 - - - uses: actions/download-artifact@v3 - with: - name: sqlite-amalgamation - path: ./ - - - name: Build sdist - run: pipx run build --sdist - - - uses: actions/upload-artifact@v3 - with: - path: dist/*.tar.gz - upload-pypi: - needs: [build-wheels, build-sdist] + needs: [build-wheels, test-sdist] runs-on: ubuntu-20.04 steps: - uses: actions/download-artifact@v3 with: - name: artifact + name: sdist + path: dist + + - uses: actions/download-artifact@v3 + with: + name: wheels path: dist - uses: pypa/gh-action-pypi-publish@release/v1 diff --git a/.gitignore b/.gitignore index 2944d17..364d634 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ build/* dist/* sqlcipher3.egg-info/* _sqlite*.so -conan_output/* \ No newline at end of file +conan_output/* +__pycache__ \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 2e66949..1138e29 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sqlcipher3-wheels" -version = "0.5.2" +version = "0.5.2.post0" description = "DB-API 2.0 interface for SQLCipher 3.x" readme = { content-type = "text/markdown", file = "README.md" } authors = [{ name = "Charles Leifer", email = "coleifer@gmail.com" }] diff --git a/setup.py b/setup.py index 6036674..0a03022 100644 --- a/setup.py +++ b/setup.py @@ -191,6 +191,6 @@ if __name__ == "__main__": setup( # name and version for building python 3.6 wheel name="sqlcipher3-wheels", - version="0.5.2", + version="0.5.2.post0", ext_modules=[module], )