From 0f777e8bb76d4dc196df716a3aaba750f6e8a8cf Mon Sep 17 00:00:00 2001 From: dancergraham Date: Fri, 26 Jul 2024 12:31:12 +0200 Subject: [PATCH] Revert "build: revert macos changes" This reverts commit 0ad34c64fe48a2335e8b92873ddcccb79b7ae036. --- .github/workflows/build.yml | 50 ++++++------------------------------- README.md | 14 +++++------ pyproject.toml | 2 +- scripts/install_xerces_c.sh | 41 ++++++++++++------------------ setup.py | 13 +--------- src/pye57/__version__.py | 2 +- 6 files changed, 33 insertions(+), 89 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2288ce9..4442cfe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,6 @@ name: build on: [push, pull_request] jobs: - build-and-test-ubuntu: name: Ubuntu (python ${{ matrix.python-version }}) runs-on: ubuntu-latest @@ -76,48 +75,16 @@ jobs: shell: pwsh run: python -m pytest tests - build-and-test-macos: - name: macOS (python ${{ matrix.python-version }}) - runs-on: macos-latest - strategy: - matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v2 - with: - submodules: recursive - - - name: Setup Python - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - - name: Install build dependencies - working-directory: ./scripts - run: | - bash install_xerces_c.sh - - - name: Install package - run: pip install . - - - name: Install pytest - run: pip install pytest - - - name: Run tests - run: python -m pytest tests - build_wheels: name: Build wheels runs-on: ${{ matrix.os }} needs: - build-and-test-ubuntu - build-and-test-windows - - build-and-test-macos if: startsWith(github.ref, 'refs/tags/v') strategy: matrix: - os: ["ubuntu-latest", "windows-2019", "macos-latest"] + os: ["ubuntu-latest", "windows-2019"] steps: - uses: actions/checkout@v2 @@ -141,13 +108,6 @@ jobs: env: CIBW_BEFORE_ALL_WINDOWS: "powershell scripts/install_xerces_c.ps1" - - name: Build wheels (macOS) - if: matrix.os == 'macos-latest' - run: | - python -m cibuildwheel --platform macos --output-dir wheelhouse - env: - CIBW_BEFORE_ALL_MACOS: "bash scripts/install_xerces_c.sh" - - uses: actions/upload-artifact@v2 with: name: wheels-${{ matrix.os }} @@ -160,7 +120,6 @@ jobs: needs: - build-and-test-ubuntu - build-and-test-windows - - build-and-test-macos steps: - uses: actions/checkout@v2 with: @@ -182,7 +141,12 @@ jobs: steps: - uses: actions/download-artifact@v2 with: - name: wheels-macos-latest + name: wheels-ubuntu-latest + path: dist + + - uses: actions/download-artifact@v2 + with: + name: wheels-windows-2019 path: dist - uses: actions/download-artifact@v2 diff --git a/README.md b/README.md index fc39bb5..0645891 100644 --- a/README.md +++ b/README.md @@ -68,21 +68,21 @@ translation_x = scan_0["pose"]["translation"]["x"] ## Installation -On linux Windows or macos: +If you're on linux or Windows, a wheel should be available. `python -m pip install pye57` -## Building from source (for developers) +## Building from source -### Cloning the repository with required submodule +### Cloning the repository and required submodules -Clone a new repository along with the libe57Format submodule +Clone a new repository along with the required submodules `git clone https://github.com/davidcaron/pye57.git --recursive` If the repository has already been previously cloned, but without the --recursive flag -```Bash +``` cd pye57 # go to the cloned repository git submodule init # this will initialise the submodules in the repository git submodule update # this will update the submodules in the repository @@ -102,7 +102,7 @@ To get xerces-c, you can either build from source or if you're using conda: ### Run `pip install` from the repo source -```Bash +``` cd pye57 python -m pip install . ``` @@ -111,6 +111,6 @@ python -m pip install . Use pip again -```Bash +``` python -m pip uninstall pye57 ``` diff --git a/pyproject.toml b/pyproject.toml index d303aa4..1014a4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,5 +14,5 @@ build-backend = "setuptools.build_meta" # before-all = "bash scripts/install_xerces_c.sh" # before-all = "powershell scripts/install_xerces_c.ps1" test-requires = "pytest" -build = "cp*-manylinux_x86_64 cp*-win_amd64* cp*-macosx*" +build = "cp*-manylinux_x86_64 cp*-win_amd64*" test-command = "python -m pytest {project}/tests" diff --git a/scripts/install_xerces_c.sh b/scripts/install_xerces_c.sh index ea3a1da..e200d60 100755 --- a/scripts/install_xerces_c.sh +++ b/scripts/install_xerces_c.sh @@ -7,34 +7,25 @@ XERCES_MINOR=2 XERCES_PATCH=3 XERCES_VERSION=${XERCES_MAJOR}.${XERCES_MINOR}.${XERCES_PATCH} +XSD_BUILD_AREA=/tmp/build_xerces_c + +echo "Create Xerces-C build area..." +mkdir -p ${XSD_BUILD_AREA} +cd ${XSD_BUILD_AREA} echo "Download Xerces-C..." curl -L https://github.com/apache/xerces-c/archive/v${XERCES_VERSION}.tar.gz --output xerces-c-${XERCES_VERSION}.tar.gz echo "Extract Xerces-C..." tar xzf xerces-c-${XERCES_VERSION}.tar.gz -cd xerces-c-${XERCES_VERSION} - -# Check the operating system and install dependencies accordingly -if [[ "$(uname)" == "Darwin" ]]; then - echo "Installing dependencies on macOS..." - brew install autoconf automake libtool - echo "Generate configure script using autoreconf..." - autoreconf -i - echo "Configure Xerces-C for macOS..." - ./configure --prefix=/usr/local --enable-static - echo "Build Xerces-C..." - make - echo "Install Xerces-C..." - sudo make install -else - echo "Installing dependencies on Linux..." - ./reconf - ./configure - echo "Build Xerces-C..." - make - echo "Install Xerces-C..." - make install -fi -echo "Xerces-C installed successfully." - +cd xerces-c-${XERCES_VERSION} +echo "Configure Xerces-C..." +./reconf +./configure +echo "Build Xerces-C..." +make +echo "Install Xerces-C..." +make install +echo "Clean up Xerces-C..." +cd / +rm -rf ${XSD_BUILD_AREA} diff --git a/setup.py b/setup.py index 6464d30..45f754f 100644 --- a/setup.py +++ b/setup.py @@ -43,15 +43,7 @@ # include xerces-c dll in the package shutil.copy2(xerces_dir / "bin" / "xerces-c_3_2.dll", HERE / "src" / "pye57") package_data.append("xerces-c_3_2.dll") -elif platform.system() == "Darwin": - xerces_dir = Path("/usr/local/") - if xerces_dir.exists(): - # include xerces-c dylib in the package - shutil.copy2(xerces_dir / "lib" / "libxerces-c-3.2.dylib", HERE / "src" / "pye57") - library_dirs.append(str(xerces_dir / "lib")) - include_dirs.append(str(xerces_dir / "include")) - package_data.append("libxerces-c.a") - libraries.append("xerces-c") + else: libraries.append("xerces-c") @@ -64,9 +56,6 @@ libraries=libraries, library_dirs=library_dirs, language="c++", - extra_link_args=[ - f"-Wl,-rpath,@loader_path", - ], ), ] diff --git a/src/pye57/__version__.py b/src/pye57/__version__.py index 3dd3d2d..98a433b 100644 --- a/src/pye57/__version__.py +++ b/src/pye57/__version__.py @@ -1 +1 @@ -__version__ = "0.4.6" +__version__ = "0.4.5"