Skip to content

Commit

Permalink
Revert "build: revert macos changes"
Browse files Browse the repository at this point in the history
This reverts commit 0ad34c6.
  • Loading branch information
dancergraham committed Jul 26, 2024
1 parent bc7d439 commit 0f777e8
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 89 deletions.
50 changes: 7 additions & 43 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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 }}
Expand All @@ -160,7 +120,6 @@ jobs:
needs:
- build-and-test-ubuntu
- build-and-test-windows
- build-and-test-macos
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -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
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 .
```
Expand All @@ -111,6 +111,6 @@ python -m pip install .

Use pip again

```Bash
```
python -m pip uninstall pye57
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
41 changes: 16 additions & 25 deletions scripts/install_xerces_c.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}
13 changes: 1 addition & 12 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -64,9 +56,6 @@
libraries=libraries,
library_dirs=library_dirs,
language="c++",
extra_link_args=[
f"-Wl,-rpath,@loader_path",
],
),
]

Expand Down
2 changes: 1 addition & 1 deletion src/pye57/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.6"
__version__ = "0.4.5"

0 comments on commit 0f777e8

Please sign in to comment.