From e5fb77aab1d3173b5ad9ca4838586a911fb0dfb0 Mon Sep 17 00:00:00 2001 From: Fabio Zadrozny Date: Sun, 8 Oct 2023 09:23:19 -0300 Subject: [PATCH] Use manylinux to build 2.10.0 artifacts for linux. --- .../workflows/pydevd-release-manylinux.yml | 48 +++++++++++++++++++ .github/workflows/pydevd-release.yml | 4 +- .github/workflows/pydevd-tests-python.yml | 2 +- build_tools/build.py | 2 + build_tools/check_no_git_modifications.py | 26 ++++------ .../linux_and_mac/compile_manylinux.cmd | 0 pyproject.toml | 11 +++++ 7 files changed, 72 insertions(+), 21 deletions(-) create mode 100644 .github/workflows/pydevd-release-manylinux.yml mode change 100644 => 100755 pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd create mode 100644 pyproject.toml diff --git a/.github/workflows/pydevd-release-manylinux.yml b/.github/workflows/pydevd-release-manylinux.yml new file mode 100644 index 00000000..da5843c1 --- /dev/null +++ b/.github/workflows/pydevd-release-manylinux.yml @@ -0,0 +1,48 @@ +# Nice reference: https://github.com/tornadoweb/tornado/blob/master/.github/workflows/build.yml +# Docs: https://cibuildwheel.readthedocs.io/en/stable/options/ +# Configurations are here and in pyproject.toml. +name: PyDev.Debugger [MANYLINUX] Release + +on: + push: + branches: + - "release-pydev-debugger-test" + tags: + - "pydev_debugger_*" + +jobs: + build: + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-20.04] + steps: + - uses: actions/checkout@v4 + + # Used to host cibuildwheel + - uses: actions/setup-python@v3 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel==2.16.2 + + - name: Remove .so files (will be rebuilt) + run: rm pydevd_attach_to_process/*.so + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + env: + CIBW_SKIP: pp* + CIBW_BUILD_VERBOSITY: 1 + + - uses: actions/upload-artifact@v3 + with: + path: ./wheelhouse/*.whl + + - name: Upload to PyPI .whl + run: | + pip install twine + twine upload wheelhouse/*.whl + env: + TWINE_USERNAME: __token__ + TWINE_PASSWORD: ${{ secrets.TWINE_KEY }} \ No newline at end of file diff --git a/.github/workflows/pydevd-release.yml b/.github/workflows/pydevd-release.yml index d538e7ce..d645596e 100644 --- a/.github/workflows/pydevd-release.yml +++ b/.github/workflows/pydevd-release.yml @@ -1,4 +1,4 @@ -name: PyDev.Debugger Release +name: PyDev.Debugger [Windows, MacOS] Release on: push: @@ -15,7 +15,7 @@ jobs: strategy: fail-fast: false matrix: - os: [ubuntu-latest, macos-latest, windows-latest] + os: [macos-latest, windows-latest] python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/pydevd-tests-python.yml b/.github/workflows/pydevd-tests-python.yml index a6326518..56352e97 100644 --- a/.github/workflows/pydevd-tests-python.yml +++ b/.github/workflows/pydevd-tests-python.yml @@ -1,4 +1,4 @@ -name: PyDev.Debugger Tests +name: PyDev.Debugger TESTS on: - push diff --git a/build_tools/build.py b/build_tools/build.py index 5c5be47d..d9f83fee 100644 --- a/build_tools/build.py +++ b/build_tools/build.py @@ -13,6 +13,8 @@ import subprocess import sys +sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) + from generate_code import remove_if_exists, root_dir, is_python_64bit, generate_dont_trace_files, generate_cython_module diff --git a/build_tools/check_no_git_modifications.py b/build_tools/check_no_git_modifications.py index 511df5b7..b8bd59ca 100644 --- a/build_tools/check_no_git_modifications.py +++ b/build_tools/check_no_git_modifications.py @@ -45,25 +45,15 @@ def main(): files.discard('.travis_install_python_deps.sh') files.discard('miniconda.sh') files.discard('build_tools/check_no_git_modifications.py') - pydevd_cython = None - pydevd_frame_evaluator = None found_unexpected = True - if len(files) == 2: - for f in files: - if f.endswith('pydevd_cython.c'): - pydevd_cython = f - - elif f.endswith('pydevd_frame_evaluator.c'): - pydevd_frame_evaluator = f - - if pydevd_cython and pydevd_frame_evaluator: - found_unexpected = False - output = subprocess.check_output('git diff'.split()) - for line in output.decode('utf-8').splitlines(): - if line.startswith('+') or line.startswith('-'): - if line.strip() not in expected_differences: - print('Found unexpected: %r' % (line,)) - found_unexpected = True + if files: + found_unexpected = False + output = subprocess.check_output('git diff'.split()) + for line in output.decode('utf-8').splitlines(): + if line.startswith('+') or line.startswith('-'): + if line.strip() not in expected_differences: + print('Found unexpected: %r' % (line,)) + found_unexpected = True if files and found_unexpected: # If there are modifications, show a diff of the modifications and fail the script. diff --git a/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd b/pydevd_attach_to_process/linux_and_mac/compile_manylinux.cmd old mode 100644 new mode 100755 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..870f7d9f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,11 @@ +# See: https://cibuildwheel.readthedocs.io/en/stable/options/ + +[tool.cibuildwheel] +# Customize what to build +# build="cp36-manylinux_x86_64" + +before-build = """ +pydevd_attach_to_process/linux_and_mac/compile_linux.sh +pip install cython +python build_tools/build.py +"""