From e6ed2321f11bf75e33ec12980326480c2b587fc6 Mon Sep 17 00:00:00 2001 From: Luke Craig Date: Fri, 15 Mar 2024 14:57:30 -0400 Subject: [PATCH] Revert "Attempt 2 on publishing wheel (#1467)" This reverts commit 4d0ba999e98faf39866247a7ccc2e55c9bdd120f. --- .github/workflows/publish_docker.yml | 47 +++++------------------- panda/dependencies/ubuntu_18.04_base.txt | 4 ++ panda/dependencies/ubuntu_20.04_base.txt | 4 ++ panda/dependencies/ubuntu_22.04_base.txt | 4 ++ panda/python/core/setup.py | 47 ++++++++---------------- 5 files changed, 37 insertions(+), 69 deletions(-) diff --git a/.github/workflows/publish_docker.yml b/.github/workflows/publish_docker.yml index c40c18f5383..e825ebffeb1 100644 --- a/.github/workflows/publish_docker.yml +++ b/.github/workflows/publish_docker.yml @@ -56,23 +56,16 @@ jobs: - name: Build package working-directory: panda/debian run: ./setup.sh Ubuntu ${{ matrix.ubuntu_version }} - - - name: Get Name of Generated Wheel file - run: | - ARTIFACT_PATHNAME=$(ls panda/debian/*.whl | head -n 1) - ARTIFACT_NAME=$(basename $ARTIFACT_PATHNAME) - echo ::set-env name=ARTIFACT_NAME::${ARTIFACT_NAME} - echo ::set-env name=ARTIFACT_PATHNAME::${ARTIFACT_PATHNAME} - - name: Upload wheel to release - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_path: ${{ env.ARTIFACT_PATHNAME }} - asset_name: ${{ env.ARTIFACT_NAME }} - asset_content_type: application/octet-stream + #- name: Upload whl to release + # uses: actions/upload-release-asset@v1 + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # upload_url: ${{ needs.create_release.outputs.upload_url }} + # asset_path: panda/debian/*.whl + # asset_name: pandare-${{ matrix.ubuntu_version }}.whl + # asset_content_type: application/octet-stream - name: Upload deb to release uses: actions/upload-release-asset@v1 @@ -154,28 +147,6 @@ jobs: git commit -m "Documentation update for PANDA commit ${{ github.sha }} branch dev" && git push || true - publish-to-pypi: - name: >- - Publish Python 🐍 distribution 📦 to PyPI - if: startsWith(github.ref, 'refs/tags/') # only publish to PyPI on tag pushes - needs: - - build_release_assets - runs-on: ubuntu-latest - environment: - name: pypi - url: https://pypi.org/p/pandare # Replace with your PyPI project name - permissions: - id-token: write # IMPORTANT: mandatory for trusted publishing - - steps: - - name: Publish distribution 📦 to PyPI - uses: pypa/gh-action-pypi-publish@release/v1 - with: - user: pandare - password: ${{ secrets.PYPI_API_TOKEN }} - packages-dir: panda/debian/ - verbose: true - build_stable: if: github.repository == 'panda-re/panda' && github.ref == 'refs/heads/stable' runs-on: panda-arc diff --git a/panda/dependencies/ubuntu_18.04_base.txt b/panda/dependencies/ubuntu_18.04_base.txt index e8278dff254..fb947953402 100644 --- a/panda/dependencies/ubuntu_18.04_base.txt +++ b/panda/dependencies/ubuntu_18.04_base.txt @@ -12,6 +12,7 @@ libwiretap-dev libxen-dev python3 python3-pip +python3-protobuf wget unzip @@ -21,6 +22,9 @@ libpython3-dev # pypanda dependencies genisoimage libffi-dev +python3-colorama +python3-protobuf +python3-pycparser # apt-rdepends qemu-system-common diff --git a/panda/dependencies/ubuntu_20.04_base.txt b/panda/dependencies/ubuntu_20.04_base.txt index aa430074f61..987cc52d95b 100644 --- a/panda/dependencies/ubuntu_20.04_base.txt +++ b/panda/dependencies/ubuntu_20.04_base.txt @@ -12,6 +12,7 @@ libxen-dev libz3-dev python3 python3-pip +python3-protobuf wget # pyperipheral (only needed for armel) @@ -20,6 +21,9 @@ libpython3-dev # pypanda dependencies genisoimage libffi-dev +python3-colorama +python3-protobuf +python3-pycparser # Not sure what this one is needed for liblzo2-2 diff --git a/panda/dependencies/ubuntu_22.04_base.txt b/panda/dependencies/ubuntu_22.04_base.txt index 6a804c5e8a1..f5ca45d6c72 100644 --- a/panda/dependencies/ubuntu_22.04_base.txt +++ b/panda/dependencies/ubuntu_22.04_base.txt @@ -12,6 +12,7 @@ libxen-dev libz3-dev python3 python3-pip +python3-protobuf wget # pyperipheral (only needed for armel) @@ -20,6 +21,9 @@ libpython3-dev # pypanda dependencies genisoimage libffi-dev +python3-colorama +python3-protobuf +python3-pycparser # Not sure what this one is needed for liblzo2-2 diff --git a/panda/python/core/setup.py b/panda/python/core/setup.py index 4890c85bf99..c0fa18b7055 100644 --- a/panda/python/core/setup.py +++ b/panda/python/core/setup.py @@ -8,20 +8,17 @@ import shutil import os - arches = ['arm', 'aarch64', 'i386', 'x86_64', 'ppc', 'mips', 'mipsel', 'mips64'] # Check for PANDA binaries in /usr/local/bin/ or in our build directory -# panda_binaries = ['/usr/local/bin/panda-system-{arch}' for arch in arches] +#panda_binaries = ['/usr/local/bin/panda-system-{arch}' for arch in arches] # Do we actually care at this point? -root_dir = os.path.join(*[os.path.dirname(__file__), "..", "..", ".."]) # panda-git/ root dir +root_dir = os.path.join(*[os.path.dirname(__file__), "..", "..", ".."]) # panda-git/ root dir -pypi_build = False # Set to true if trying to minimize size for pypi package upload. Note this disables some architectures +pypi_build = False # Set to true if trying to minimize size for pypi package upload. Note this disables some architectures lib_dir = os.path.join("pandare", "data") - - def copy_objs(): ''' Run to copy objects into a (local and temporary) python module before installing to the system. @@ -68,52 +65,40 @@ def copy_objs(): shutil.copy( llvm2, os.path.join(lib_dir, softmmu)) ''' - -def parse_requirements(filename): - with open(filename, 'r') as f: - return [line.strip() for line in f if line.strip() and not line.strip().startswith('#')] - - from setuptools.command.install import install as install_orig from setuptools.command.develop import develop as develop_orig - - class custom_develop(develop_orig): ''' Install as a local module (not to system) by 1) Creating datatype files for local-use 2) Running regular setup tools logic ''' - def run(self): from create_panda_datatypes import main as create_datatypes create_datatypes(install=False) super().run() - class custom_install(install_orig): ''' We're going to install to the system. Two possible states to handle 1) Running from within the panda repo with panda built - need to create_datatypes 2) Running from a python sdist where all the files are already prepared ''' - def run(self): try: from create_panda_datatypes import main as create_datatypes # If we can do the import, we're in the panda repo create_datatypes(install=True) copy_objs() - + except ImportError: # Import failed, we're either in a python sdist or something has gone very wrong - assert (os.path.isfile("pandare/include/panda_datatypes.h")), \ - "panda_datatypes.h missing and can't be generated" - assert (os.path.isfile("pandare/autogen/panda_datatypes.py")), \ - "panda_datatypes.py missing and can't be generated" + assert(os.path.isfile("pandare/include/panda_datatypes.h")), \ + "panda_datatypes.h missing and can't be generated" + assert(os.path.isfile("pandare/autogen/panda_datatypes.py")), \ + "panda_datatypes.py missing and can't be generated" super().run() - # To build a package for pip: # python setup.py install # python setup.py sdist @@ -130,13 +115,13 @@ def run(self): author_email='fasano@mit.edu', url='https://github.com/panda-re/panda/', packages=find_packages(), - package_data={'pandare': [ - 'data/*-softmmu/llvm-helpers*.bc*', # LLVM Helpers - 'data/pypanda/include/*.h', # Includes files - 'data/pypanda/include/*.h', # Includes files - 'qcows.json' # Generic Images - ]}, - install_requires=parse_requirements("requirements.txt"), + package_data = { 'pandare': [ \ + 'data/*-softmmu/llvm-helpers*.bc*', # LLVM Helpers + 'data/pypanda/include/*.h', # Includes files + 'data/pypanda/include/*.h', # Includes files + 'qcows.json' # Generic Images + ]}, + install_requires=[ 'cffi>=1.14.3', 'colorama', 'protobuf>=4.25.1'], python_requires='>=3.6', cmdclass={'install': custom_install, 'develop': custom_develop}, - ) + )