Skip to content

Commit

Permalink
Merge pull request #3 from BhavyeMathur/pybind11
Browse files Browse the repository at this point in the history
Migrated the C++ Extension to Pybind11
  • Loading branch information
BhavyeMathur authored Mar 27, 2024
2 parents ff3645f + 7120782 commit 7c856dd
Show file tree
Hide file tree
Showing 153 changed files with 2,192 additions and 10,819 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# This workflow builds Python wheels & a source distribution for goopylib

name: "Build Wheels"
run-name: ${{ github.actor }} building wheels

on:
workflow_dispatch:

workflow_run:
workflows: [ Build Binary ]
types:
- completed

env:
BUILD_TYPE: Release

jobs:
build-source-distribution:
name: Build source distribution
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Install dependencies
run: python -m pip install build

- name: Create source distribution
run: python -m build --sdist

- uses: actions/upload-artifact@v4
with:
name: goopylib-source-distribution
path: dist/

build-wheels:
name: Build ${{ matrix.os }} Python wheels
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ windows-latest, macos-latest ]
python: [ "cp38-", "cp39-", "cp310-", "cp311-" ]

steps:
- uses: actions/checkout@v4
with:
submodules: 'recursive'

- name: Build Python wheels
env:
CIBW_BUILD: ${{ matrix.python }}*
uses: pypa/[email protected]

- uses: actions/upload-artifact@v4
with:
name: goopylib-${{ matrix.python }}${{ matrix.os }}-wheels
path: wheelhouse/
2 changes: 0 additions & 2 deletions .github/workflows/codeql-python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ on:
workflow_dispatch:

push:
branches: [ "master" ]
paths:
- goopylib/**
- .github/workflows/codeql-python.yml

pull_request:
branches: [ "master" ]
paths:
- goopylib/**
- .github/workflows/codeql-python.yml
Expand Down
7 changes: 7 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,10 @@
[submodule "examples/BrickBreaker"]
path = examples/BrickBreaker
url = https://github.com/BhavyeMathur/goopylib-brick-breaker
[submodule "vendor/pybind11"]
path = vendor/pybind11
url = https://github.com/pybind/pybind11
branch = stable
[submodule "vendor/map-macro"]
path = vendor/map-macro
url = https://github.com/Erlkoenig90/map-macro
5 changes: 3 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,11 @@ include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${CMAKE_SOURCE_DIR})
include_directories(${CMAKE_SOURCE_DIR}/src)
include_directories(${CMAKE_SOURCE_DIR}/vendor)
include_directories(${CMAKE_SOURCE_DIR}/vendor/glad)
include_directories(${CMAKE_SOURCE_DIR}/vendor/glm)
include_directories(${CMAKE_SOURCE_DIR}/vendor/spdlog/include)
include_directories(${CMAKE_SOURCE_DIR}/vendor/glad)
include_directories(${CMAKE_SOURCE_DIR}/vendor/GLFW/include)
include_directories(${CMAKE_SOURCE_DIR}/vendor/spdlog/include)
include_directories(${CMAKE_SOURCE_DIR}/vendor/pybind11/include)

if (WIN32)
set(WINDOWS_SOURCES vendor/glad/glad.c)
Expand Down
3 changes: 2 additions & 1 deletion goopylib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@
os.add_dll_directory(f"{sys.prefix}/goopylib")


__version__ = "2.0.0"
__version__ = "2.1.0"

# pylint: disable=wrong-import-position

from .color import *
from .core import *
from .objects import *
from .maths import *
Expand Down
1 change: 1 addition & 0 deletions goopylib/color/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
goopylib module initialization
"""

# pylint: disable=import-error
from .color import *
Loading

0 comments on commit 7c856dd

Please sign in to comment.