-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Move to pyproject.toml
installation.
#275
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
e3e4dfe
Add C++ dependencies to environment.
ehpor a4352c4
Link to C++ libraries in environment rather than extern directory.
ehpor a4233f5
Build all C++ files in the catkit_core directory.
ehpor 1a002d1
Build proto files in CMake files.
ehpor 0e944f2
Remove all external libraries.
ehpor 57b630d
Use pyproject.toml file for installation.
ehpor f7acf14
Update CI with new installation command.
ehpor bd89ade
Update installation instructions.
ehpor 433e47c
Move bindings to catkit2 directory.
ehpor fb28181
Update CMake minimum version requirement.
ehpor af1c011
Add CMake config and targets file.
ehpor 016b175
Remove version pin on pybind11_json.
ehpor 37acb1b
Install catkit2 in editable mode.
ehpor 2f361f4
Update installation commands.
ehpor File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
The Control and Automation for Testbeds Kit 2 (CATKit2) | ||
--------------------- | ||
CATKit2 is a toolkit for hardware controls that has been developed at the Space Telescope Science Institute. | ||
It provides a general infrastructure to control hardware and synchronize devices. | ||
CATKit2 is a toolkit for hardware controls that has been developed at the Space Telescope Science Institute. | ||
It provides a general infrastructure to control hardware and synchronize devices. | ||
|
||
This package was developed for use on the High-contrast Imager for Complex Apertures Testbed (HiCAT) for | ||
This package was developed for use on the High-contrast Imager for Complex Apertures Testbed (HiCAT) for | ||
developing technologies relevant to direct imaging of exoplanets in astronomy in the laboratory. | ||
|
||
This is an open-source package, but it is not actively supported. Use at your own risk. | ||
|
@@ -66,27 +66,19 @@ Installation | |
|
||
This procedure requires a pre-installed C++ compiler. | ||
- On Windows, you can for example install the Visual Studio Compiler, either by installing the Build Tools, or by installing the full IDE with compiler (the community edition is free). | ||
- On MacOS, nothing should be needed, but some machines require Xcode to be installed. It does install components on first startup, so it is recommended to start XCode on your mac if you have never used it (and accept the license agreement of XCode, which is required). | ||
- XCode 15 (Sonoma and higher) introduced some changes in the compiler location, which require the following environment variable update: | ||
- On MacOS, nothing should be needed, but some machines require Xcode to be installed. It does install components on first startup, so it is recommended to start XCode on your mac if you have never used it (and accept the license agreement of XCode, which is required). | ||
- XCode 15 (Sonoma and higher) introduced some changes in the compiler location, which require the following environment variable update: | ||
``` | ||
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) | ||
``` | ||
|
||
The following will download all third-party C++ dependencies and create a new Conda environment with the required Python packages. The download can be performed on a separate machine with internet connectivity and the resulting folders can be copy-pasted in the extern folder on the machine without internet connectivity. | ||
The following will create a new Conda environment with the required C++ and Python packages. You will need to install drivers and SDKs for some devices yourself to use those devices. | ||
|
||
You will need to install drivers and SDKs for some devices yourself to use those devices. | ||
|
||
``` | ||
cd catkit2 | ||
cd extern | ||
./download.sh | ||
cd .. | ||
``` | ||
For installation on Apple Silicon with python=3.7, you need to follow these steps: | ||
``` | ||
conda create --name catkit2 | ||
conda activate catkit2 | ||
conda config --env --set subdir osx-64 | ||
conda create --name catkit2 | ||
conda activate catkit2 | ||
conda config --env --set subdir osx-64 | ||
conda env update --file environment.yml | ||
``` | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And then maybe an "instead" at the end of line 85. |
||
|
@@ -96,8 +88,8 @@ conda env create --file environment.yml | |
conda activate catkit2 | ||
``` | ||
|
||
Finally install the package using: | ||
Finally install the package using: | ||
``` | ||
python setup.py develop | ||
pip install -e . | ||
cd .. | ||
``` | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project(catkit2) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
project(catkit_bindings) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED on) | ||
|
||
set(SOURCES "bindings.cpp") | ||
|
||
find_package(pybind11 REQUIRED) | ||
pybind11_add_module(catkit_bindings ${SOURCES}) | ||
|
||
find_package(pybind11_json REQUIRED) | ||
target_include_directories(catkit_bindings PUBLIC pybind11_json_INCLUDE_DIRS) | ||
|
||
target_include_directories(catkit_bindings PUBLIC ../catkit_core) | ||
|
||
target_link_libraries(catkit_bindings PUBLIC catkit_core) | ||
|
||
# Compile protobuf files. | ||
find_package(Protobuf REQUIRED) | ||
|
||
set(PROTO_FILES | ||
${CMAKE_CURRENT_SOURCE_DIR}/../proto/core.proto | ||
${CMAKE_CURRENT_SOURCE_DIR}/../proto/logging.proto | ||
${CMAKE_CURRENT_SOURCE_DIR}/../proto/service.proto | ||
${CMAKE_CURRENT_SOURCE_DIR}/../proto/testbed.proto | ||
${CMAKE_CURRENT_SOURCE_DIR}/../proto/tracing.proto | ||
) | ||
|
||
set(PYTHON_OUT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/./proto/) | ||
|
||
add_custom_target( | ||
catkit2_python_protobuf ALL | ||
COMMAND ${Protobuf_PROTOC_EXECUTABLE} | ||
--proto_path=${CMAKE_CURRENT_SOURCE_DIR}/../proto/ | ||
--python_out=${PYTHON_OUT_DIR} | ||
${PROTO_FILES} | ||
DEPENDS ${PROTO_FILES} | ||
) | ||
|
||
install(TARGETS catkit_bindings LIBRARY DESTINATION "${SKBUILD_PLATLIB_DIR}/catkit2/") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@PACKAGE_INIT@ | ||
include("${CMAKE_CURRENT_LIST_DIR}/CatkitCoreTargets.cmake") |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind sneaking in a "first" at the end of this line, to make things clearer?