Skip to content

Commit

Permalink
Fix install path cmake (#189)
Browse files Browse the repository at this point in the history
* Fix py.typed file path in installation script

The install script was updated to correct the relative path of the py.typed file. This ensures the file is properly included in the installation process, aligning with project requirements.

* Add Libalgebra_lite to project dependencies

Included Libalgebra_lite in the list of linked libraries in CMakeLists.txt to support necessary algebraic computations. This ensures proper functionality and integration with the project's requirements.

* Fix incorrect install destination for Python files

The Python source files are now installed in the correct `roughpy` directory instead of the project root. This ensures proper package structure and resolves issues with module imports.

* Refactor Python module installation to top-level CMakeLists.

Moved Python module installation logic from `roughpy/CMakeLists.txt` to the main `CMakeLists.txt` for better organization and clarity. This ensures all installation steps are consolidated and improves maintainability of the build configuration.

* Fix py.typed installation path in CMake configuration

Updated the path for the py.typed file to include the correct directory, ensuring proper installation. This resolves potential issues with type hinting in package deployments.

* Update Python packaging rules in CMakeLists.txt

Adjusted the install command to ensure `py.typed` is included correctly by matching patterns. This change ensures proper packaging of Python-related files while excluding unnecessary source directories.

* Update CI workflows to improve Windows support and build tools

Upgraded Windows runner to windows-2022 and added missing setup steps for Windows builds, including msbuild, ninja, and pkgconfig. Standardized CMake generator to "Ninja" across workflows for consistency. Removed redundant "use ninja" step in tests.yml for cleanup.

* "Remove redundant blank lines in build_wheels.yml"

Cleaned up unnecessary blank lines in the GitHub Actions workflow file. This improves readability and maintains consistency in the file structure.

* Remove unused dependency on boost-stacktrace

Boost-stacktrace was unnecessary and has been removed to streamline the dependency list. This change reduces potential overhead and improves maintainability.

* Refactor vcpkg setup and remove OS-specific dependencies.

Simplified the script by removing OS-specific dependency installations and unused Mono setup. Updated `vcpkg` cloning to target the `tools/vcpkg` directory and streamlined the bootstrap process. Unused and commented-out token-based binary caching logic was also removed.
  • Loading branch information
inakleinbottle authored Dec 17, 2024
1 parent 02b5f22 commit a742cec
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 68 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/build_wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ jobs:
matrix:
os:
- ubuntu-latest
- windows-2019
- windows-2022
- macos-13 # Uses x64
- macos-14 # Uses Apple Silicon

Expand All @@ -89,6 +89,24 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: Setup msbuild on Windows
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2

- name: Setup ninja on Windows
if: runner.os == 'Windows'
uses: ashutoshvarma/[email protected]

- name: Enable developer command prompt
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1

- name: install pkgconfig on windows
if: runner.os == 'Windows'
shell: bash
run: |
choco install pkgconfiglite
- name: Install build deps on MacOs
if: runner.os == 'macOs'
run: brew install autoconf automake libtool m4 ninja
Expand All @@ -98,18 +116,19 @@ jobs:
env:
MACOSX_DEPLOYMENT_TARGET: 11.0.0
GITHUB_TOK: "${{ secrets.GITHUB_TOKEN }}"
CMAKE_GENERATOR: "Ninja"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl



publish:

runs-on: ubuntu-latest
needs: [ build_wheels, build_sdist ]
if: ${{ github.event_name == 'push' }}

steps:
- name: Setup Python
uses: actions/setup-python@v5
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,6 @@ jobs:
core.exportVariable('ACTIONS_CACHE_URL', process.env.ACTIONS_CACHE_URL || '');
core.exportVariable('ACTIONS_RUNTIME_TOKEN', process.env.ACTIONS_RUNTIME_TOKEN || '');
- name: use ninja
shell: bash
run: |
echo "CMAKE_GENERATOR=Ninja" >> $GITHUB_ENV
- name: Setup msbuild on Windows
if: runner.os == 'Windows'
uses: microsoft/setup-msbuild@v2
Expand Down Expand Up @@ -127,6 +122,7 @@ jobs:
CMAKE_TOOLCHAIN_FILE: ${{ github.workspace }}/tools/vcpkg/scripts/buildsystems/vcpkg.cmake
MACOSX_DEPLOYMENT_TARGET: 11.0.0
VCPKG_FORCE_SYSTEM_BINARIES: 1
CMAKE_GENERATOR: "Ninja"

- name: Build
# Build your program with the given configuration
Expand Down
25 changes: 25 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,30 @@ add_subdirectory(streams)

if (ROUGHPY_BUILD_PYLIB)
add_subdirectory(roughpy)


install(TARGETS RoughPy_PyModule
RUNTIME DESTINATION roughpy
LIBRARY
DESTINATION roughpy
NAMELINK_SKIP
ARCHIVE DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
EXCLUDE_FROM_ALL
INCLUDES DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
FRAMEWORK DESTINATION roughpy
EXCLUDE_FROM_ALL
)

install(DIRECTORY roughpy
DESTINATION .
FILES_MATCHING
PATTERN "py.typed"
PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "src/*" EXCLUDE)

endif ()


Expand All @@ -225,6 +249,7 @@ install(TARGETS
RoughPy_Scalars
RoughPy_Algebra
RoughPy_Streams
Libalgebra_lite
EXPORT RoughPy_EXPORTS
RUNTIME DESTINATION roughpy
LIBRARY
Expand Down
23 changes: 0 additions & 23 deletions roughpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -198,29 +198,6 @@ configure_file(version.py.in ${CMAKE_CURRENT_LIST_DIR}/version.py @ONLY)



install(TARGETS RoughPy_PyModule
RUNTIME DESTINATION roughpy
LIBRARY
DESTINATION roughpy
NAMELINK_SKIP
ARCHIVE DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
EXCLUDE_FROM_ALL
INCLUDES DESTINATION ${SKBUILD_NULL_DIR}
COMPONENT Development
FRAMEWORK DESTINATION roughpy
EXCLUDE_FROM_ALL
)

install(FILES roughpy/py.typed DESTINATION roughpy)
install(DIRECTORY roughpy
DESTINATION .
FILES_MATCHING
PATTERN "*.py"
PATTERN "*.pyi"
PATTERN "src/*" EXCLUDE)





Expand Down
36 changes: 2 additions & 34 deletions tools/ci/before-all-common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,40 +27,8 @@
# USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#

echo $OSTYPE
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
yum install -y curl zip unzip tar gmp-devel

# manylinux doesn't have mono, we'll have to install it
rpmkeys --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
su -c 'curl https://download.mono-project.com/repo/centos7-stable.repo | tee /etc/yum.repos.d/mono-centos7-stable.repo'
yum install -y mono-complete

MONO_EXE=mono
elif [[ "$OSTYPE" == "darwin"* ]]; then
brew install libomp
MONO_EXE=mono
elif [[ "$OSTYPE" == "msys"* ]]; then
MONO_EXE=""
else
exit 1
fi
git clone https://github.com/Microsoft/vcpkg.git tools/vcpkg
bash tools/vcpkg/bootstrap-vcpkg.sh -disableMetrics

git clone https://github.com/Microsoft/vcpkg.git
bash vcpkg/bootstrap-vcpkg.sh -disableMetrics

vcpkg_root=./vcpkg

#if [ -n "$GITHUB_TOK" ]; then
# # If the token is defined, set up binary caching
# $MONO_EXE `$vcpkg_root/vcpkg fetch nuget | tail -n 1` \
# sources add \
# -source "https://nuget.pkg.github.com/datasig-ac-uk/index.json" \
# -storepasswordincleartext \
# -name "GitHub" \
# -username "datasig-ac-uk" \
# -password "$GITHUB_TOK"
# $MONO_EXE `$vcpkg_root/vcpkg fetch nuget | tail -n 1` \
# setapikey "$GITHUB_TOK" \
# -source "https://nuget.pkg.github.com/datasig-ac-uk/index.json"
#fi
3 changes: 0 additions & 3 deletions vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,6 @@
}, {
"name" : "opencl",
"version>=" : "v2024.05.08"
}, {
"name" : "boost-stacktrace",
"version>=" : "1.83.0"
}, {
"name" : "range-v3",
"version>=" : "0.12.0#4"
Expand Down

0 comments on commit a742cec

Please sign in to comment.