From: Daniele Varrazzo Date: Sat, 22 Feb 2025 14:00:38 +0000 (+0100) Subject: chore: rename tools/build library "ci" X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F1011%2Fhead;p=thirdparty%2Fpsycopg.git chore: rename tools/build library "ci" The name `build` is problematic because we typically want to avoid tools to go exploring them (mypy, isort, black...) but this leaves this directory unexplored. --- diff --git a/.github/workflows/packages-bin.yml b/.github/workflows/packages-bin.yml index dcdcb7cde..72666a97d 100644 --- a/.github/workflows/packages-bin.yml +++ b/.github/workflows/packages-bin.yml @@ -65,7 +65,7 @@ jobs: key: libpq-${{ matrix.platform }}-${{ matrix.arch }}-${{ env.LIBPQ_VERSION }}-${{ env.OPENSSL_VERSION }} - name: Create the binary package source tree - run: python3 ./tools/build/copy_to_binary.py + run: python3 ./tools/ci/copy_to_binary.py - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 @@ -78,9 +78,9 @@ jobs: CIBW_MANYLINUX_PPC64LE_IMAGE: manylinux2014 CIBW_BUILD: ${{matrix.pyver}}-${{matrix.platform}}_${{matrix.arch}} CIBW_ARCHS_LINUX: auto aarch64 ppc64le - CIBW_BEFORE_ALL_LINUX: ./tools/build/wheel_linux_before_all.sh + CIBW_BEFORE_ALL_LINUX: ./tools/ci/wheel_linux_before_all.sh CIBW_REPAIR_WHEEL_COMMAND: >- - ./tools/build/strip_wheel.sh {wheel} + ./tools/ci/strip_wheel.sh {wheel} && auditwheel repair -w {dest_dir} {wheel} CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool CIBW_TEST_COMMAND: >- @@ -139,7 +139,7 @@ jobs: key: libpq-${{ env.LIBPQ_VERSION }}-macos-${{ matrix.arch }}-${{ env.OPENSSL_VERSION }} - name: Create the binary package source tree - run: python3 ./tools/build/copy_to_binary.py + run: python3 ./tools/ci/copy_to_binary.py - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 @@ -149,7 +149,7 @@ jobs: CIBW_BUILD: ${{matrix.pyver}}-macosx_${{matrix.arch}} CIBW_ARCHS_MACOS: ${{matrix.arch}} MACOSX_ARCHITECTURE: ${{matrix.arch}} - CIBW_BEFORE_ALL_MACOS: ./tools/build/wheel_macos_before_all.sh + CIBW_BEFORE_ALL_MACOS: ./tools/ci/wheel_macos_before_all.sh CIBW_TEST_REQUIRES: ./psycopg[test] ./psycopg_pool CIBW_TEST_COMMAND: >- pytest {project}/tests -m 'not slow and not flakey' --color yes @@ -207,7 +207,7 @@ jobs: id: libdir - name: Create the binary package source tree - run: python3 ./tools/build/copy_to_binary.py + run: python3 ./tools/ci/copy_to_binary.py - name: Build wheels uses: pypa/cibuildwheel@v2.22.0 @@ -217,7 +217,7 @@ jobs: VCPKG_BINARY_SOURCES: "clear;x-gha,readwrite" # cache vcpkg CIBW_BUILD: ${{matrix.pyver}}-${{matrix.arch}} CIBW_ARCHS_WINDOWS: AMD64 x86 - CIBW_BEFORE_BUILD_WINDOWS: '.\tools\build\wheel_win32_before_build.bat' + CIBW_BEFORE_BUILD_WINDOWS: '.\tools\ci\wheel_win32_before_build.bat' CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: >- delvewheel repair -w {dest_dir} --add-path="${{ steps.libdir.outputs.EXTRA_LIB_DIR }}" diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index bc2aa108b..feece0570 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -82,7 +82,7 @@ jobs: -c max_prepared_transactions=10 - name: Install the wanted libpq version - run: sudo ./tools/build/ci_install_libpq.sh ${{ matrix.libpq }} + run: sudo ./tools/ci/ci_install_libpq.sh ${{ matrix.libpq }} - name: Include psycopg-c to the packages to install if: ${{ matrix.impl == 'c' }} @@ -136,7 +136,7 @@ jobs: run: pip install $DEPS - name: Run tests - run: ./tools/build/ci_test.sh + run: ./tools/ci/ci_test.sh # }}} @@ -205,7 +205,7 @@ jobs: run: pip install $DEPS - name: Run tests - run: ./tools/build/ci_test.sh + run: ./tools/ci/ci_test.sh # }}} @@ -264,7 +264,7 @@ jobs: run: pip install $DEPS - name: Run tests - run: ./tools/build/ci_test.sh + run: ./tools/ci/ci_test.sh # }}} @@ -337,7 +337,7 @@ jobs: run: echo "$(pg_config.exe --bindir)" >> $GITHUB_PATH - name: Install delvewheel - run: .\tools\build\wheel_win32_before_build.bat + run: .\tools\ci\wheel_win32_before_build.bat shell: powershell - name: Build the C wheel @@ -354,7 +354,7 @@ jobs: run: pip install $DEPS - name: Run tests - run: ./tools/build/ci_test.sh + run: ./tools/ci/ci_test.sh # }}} @@ -405,7 +405,7 @@ jobs: start-single-node --insecure - name: Install the wanted libpq version - run: sudo ./tools/build/ci_install_libpq.sh ${{ matrix.libpq }} + run: sudo ./tools/ci/ci_install_libpq.sh ${{ matrix.libpq }} - name: Include psycopg-c to the packages to install if: ${{ matrix.impl == 'c' }} @@ -416,7 +416,7 @@ jobs: run: pip install $DEPS - name: Run tests - run: ./tools/build/ci_test.sh + run: ./tools/ci/ci_test.sh # }}} diff --git a/.gitignore b/.gitignore index 7040b9751..9ab9d6933 100644 --- a/.gitignore +++ b/.gitignore @@ -16,11 +16,4 @@ htmlcov .eggs/ dist/ wheelhouse/ -# Spelling these explicitly because we have /scripts/build/ to not ignore -# but I still want 'ag' to avoid looking here. -/build/ -/psycopg/build/ -/psycopg_c/build/ -/psycopg_pool/build/ -/tools/build/pg_config_vcpkg_stub/build/ -/tools/isort-psycopg/build/ +build/ diff --git a/docs/release.rst b/docs/release.rst index fcca3af60..fce350b89 100644 --- a/docs/release.rst +++ b/docs/release.rst @@ -34,7 +34,7 @@ How to make a psycopg release - Delete the ``wheelhouse`` directory if there is one. -- Build m1 packages by running ``./tools/build/run_build_macos_arm64.sh BRANCH``. +- Build m1 packages by running ``./tools/ci/run_build_macos_arm64.sh BRANCH``. On successful completion it will save built packages in ``wheelhouse`` - If all packages were built ok, push the new tag created by ``bump_version.py``:: @@ -84,9 +84,9 @@ When a new PostgreSQL major version is released - ``.github/workflows/packages-bin.yml``. - ``.github/workflows/tests.yml``. -- Bump ``pg_version`` in ``tools/build/build_macos_arm64.sh``. +- Bump ``pg_version`` in ``tools/ci/build_macos_arm64.sh``. -- Bump the version in ``tools/build/wheel_win32_before_build.bat``. +- Bump the version in ``tools/ci/wheel_win32_before_build.bat``. - Update the documented versions in: @@ -107,7 +107,7 @@ When a new Python major version is released ``psycopg/pyproject.toml``, ``psycopg_c/pyproject.toml``, and ``psycopg_pool/pyproject.toml``. -- Update the list of versions in ``tools/build/build_macos_arm64.sh`` to include +- Update the list of versions in ``tools/ci/build_macos_arm64.sh`` to include the new version. Look for both the ``python_versions`` variable and the ``CIBW_BUILD`` environment variable. diff --git a/pyproject.toml b/pyproject.toml index f684b6489..f3fa58e5d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,13 +38,7 @@ disable_bytearray_promotion = true disable_memoryview_promotion = true strict = true exclude = '''(?x)( - ^ build/ - | docs/lib/.*\.py - | psycopg/build/ - | psycopg_binary/build/ - | psycopg_c/build/ - | psycopg_pool/build/ - | tools/build/pg_config_vcpkg_stub/build/ + ^ docs/lib/.*\.py )''' [[tool.mypy.overrides]] diff --git a/tools/build/build_libpq.sh b/tools/ci/build_libpq.sh similarity index 100% rename from tools/build/build_libpq.sh rename to tools/ci/build_libpq.sh diff --git a/tools/build/build_macos_arm64.sh b/tools/ci/build_macos_arm64.sh similarity index 98% rename from tools/build/build_macos_arm64.sh rename to tools/ci/build_macos_arm64.sh index a4a889a9d..8d6bcf593 100755 --- a/tools/build/build_macos_arm64.sh +++ b/tools/ci/build_macos_arm64.sh @@ -92,7 +92,7 @@ log "building wheels" # Create the psycopg_binary source package rm -rf psycopg_binary -python tools/build/copy_to_binary.py +python tools/ci/copy_to_binary.py # Build the binary packages export CIBW_PLATFORM=macos diff --git a/tools/build/ci_install_libpq.sh b/tools/ci/ci_install_libpq.sh similarity index 100% rename from tools/build/ci_install_libpq.sh rename to tools/ci/ci_install_libpq.sh diff --git a/tools/build/ci_test.sh b/tools/ci/ci_test.sh similarity index 100% rename from tools/build/ci_test.sh rename to tools/ci/ci_test.sh diff --git a/tools/build/copy_to_binary.py b/tools/ci/copy_to_binary.py similarity index 100% rename from tools/build/copy_to_binary.py rename to tools/ci/copy_to_binary.py diff --git a/tools/build/print_so_versions.sh b/tools/ci/print_so_versions.sh similarity index 100% rename from tools/build/print_so_versions.sh rename to tools/ci/print_so_versions.sh diff --git a/tools/build/run_build_macos_arm64.sh b/tools/ci/run_build_macos_arm64.sh similarity index 97% rename from tools/build/run_build_macos_arm64.sh rename to tools/ci/run_build_macos_arm64.sh index 45e865299..e303654a4 100755 --- a/tools/build/run_build_macos_arm64.sh +++ b/tools/ci/run_build_macos_arm64.sh @@ -58,7 +58,7 @@ $ssh rm -rf "${rdir}" $ssh git clone https://github.com/psycopg/psycopg.git --branch ${tag} "${rdir}" # Build the wheel packages -$ssh "${rdir}/tools/build/build_macos_arm64.sh" +$ssh "${rdir}/tools/ci/build_macos_arm64.sh" # Transfer the packages locally scp -r "${user}@${host}:${rdir}/wheelhouse" . diff --git a/tools/build/scaleway_m1.sh b/tools/ci/scaleway_m1.sh similarity index 100% rename from tools/build/scaleway_m1.sh rename to tools/ci/scaleway_m1.sh diff --git a/tools/build/strip_wheel.sh b/tools/ci/strip_wheel.sh similarity index 100% rename from tools/build/strip_wheel.sh rename to tools/ci/strip_wheel.sh diff --git a/tools/build/wheel_linux_before_all.sh b/tools/ci/wheel_linux_before_all.sh similarity index 100% rename from tools/build/wheel_linux_before_all.sh rename to tools/ci/wheel_linux_before_all.sh diff --git a/tools/build/wheel_macos_before_all.sh b/tools/ci/wheel_macos_before_all.sh similarity index 95% rename from tools/build/wheel_macos_before_all.sh rename to tools/ci/wheel_macos_before_all.sh index e3fb2f437..e21f945b8 100755 --- a/tools/build/wheel_macos_before_all.sh +++ b/tools/ci/wheel_macos_before_all.sh @@ -11,7 +11,7 @@ dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" prjdir="$( cd "${dir}/../.." && pwd )" # Build dependency libraries -"${prjdir}/tools/build/build_libpq.sh" +"${prjdir}/tools/ci/build_libpq.sh" # Show dependency tree otool -L /tmp/libpq.build/lib/*.dylib diff --git a/tools/build/wheel_win32_before_build.bat b/tools/ci/wheel_win32_before_build.bat similarity index 97% rename from tools/build/wheel_win32_before_build.bat rename to tools/ci/wheel_win32_before_build.bat index c016ceb2c..6a90ca277 100644 --- a/tools/build/wheel_win32_before_build.bat +++ b/tools/ci/wheel_win32_before_build.bat @@ -1,4 +1,3 @@ @echo on pip install delvewheel wheel -