Skip to content

Commit 6ea326c

Browse files
committed
Reorganize source tree
Signed-off-by: eric <[email protected]>
1 parent 2248ec0 commit 6ea326c

File tree

273 files changed

+75
-45
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

273 files changed

+75
-45
lines changed

.github/actions/run-test/action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ runs:
2323
- name: Run Unittests
2424
shell: bash
2525
run: |
26-
python -m unittest discover -v tests
26+
PYTHONPATH=src python -m unittest discover -v tests
2727
2828
- name: Run Examples
2929
shell: bash
3030
run: |
3131
uv pip install --system -r examples/applications/requirements_applications.txt
3232
for example in "./examples"/*.py; do
3333
echo "Running $example"
34-
PYTHONPATH=. python $example
34+
PYTHONPATH=src python $example
3535
done
3636
for example in "./examples/applications"/*.py; do
3737
if python -c 'import sys; sys.exit(not sys.version_info <= (3, 10))'; then
@@ -42,5 +42,5 @@ runs:
4242
fi
4343
4444
echo "Running $example"
45-
PYTHONPATH=. python $example
45+
PYTHONPATH=src python $example
4646
done

CMakeLists.txt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ if(NOT SKBUILD_PROJECT_NAME)
1313
endif()
1414

1515
# Path to the version file
16-
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/scaler/version.txt")
16+
set(VERSION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/src/scaler/version.txt")
1717

1818
# Check if the version file exists
1919
if(NOT EXISTS "${VERSION_FILE}")
@@ -118,8 +118,10 @@ message(STATUS "Python ABI: ${Python3_SOABI}")
118118
# Make LSP happy
119119
include_directories(${CAPNP_INCLUDE_DIRS})
120120
include_directories(${PROJECT_SOURCE_DIR})
121+
include_directories(${PROJECT_SOURCE_DIR}/src)
122+
include_directories(${PROJECT_SOURCE_DIR}/src/cpp)
121123

122-
add_subdirectory(scaler)
124+
add_subdirectory(src/cpp/scaler)
123125

124126
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
125127
add_subdirectory(tests)

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,15 @@
1313
import os
1414
import sys
1515

16-
sys.path.insert(0, os.path.abspath(os.path.join("..", "..")))
16+
sys.path.insert(0, os.path.abspath(os.path.join("..", "..", "src")))
1717

1818

1919
# -- Project information -----------------------------------------------------
2020

2121
project = "OpenGRIS Scaler"
2222
author = "Citi"
2323

24-
with open("../../scaler/version.txt", "rt") as f:
24+
with open("../../src/scaler/version.txt", "rt") as f:
2525
version = f.read().strip()
2626

2727
release = f"{version}-py3-none-any"

pyproject.toml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,13 @@ dev = [
6565
[tool.scikit-build.metadata.version]
6666
provider = "scikit_build_core.metadata.regex"
6767
regex = '(?P<value>\d+\.\d+\.\d+(\.[1-9]\d*)?)'
68-
input = "./scaler/version.txt"
68+
input = "./src/scaler/version.txt"
69+
70+
[tool.setuptools]
71+
package-dir = {"" = "src"}
72+
73+
[tool.setuptools.packages.find]
74+
where = ["src"]
6975

7076
[project.urls]
7177
Home = "https://github.com/Citi/scaler"
@@ -81,7 +87,7 @@ scaler_worker_adapter_symphony = "scaler.entry_points.worker_adapter_symphony:ma
8187

8288
[tool.scikit-build]
8389
cmake.source-dir = "."
84-
wheel.packages = ["scaler"]
90+
wheel.packages = ["src/scaler"]
8591
build.targets = ["py_ymq", "py_object_storage_server"]
8692

8793
[tool.scikit-build.cmake.define]

scripts/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ BUILD_DIR="build_${OS}_${ARCH}"
1212
BUILD_PRESET="${OS}-${ARCH}"
1313

1414
rm -rf $BUILD_DIR
15-
rm -f scaler/protocol/capnp/*.c++
16-
rm -f scaler/protocol/capnp/*.h
15+
rm -f src/scaler/protocol/capnp/*.c++
16+
rm -f src/scaler/protocol/capnp/*.h
1717
echo "Build directory: $BUILD_DIR"
1818
echo "Build preset: $BUILD_PRESET"
1919

File renamed without changes.

scaler/io/ymq/CMakeLists.txt renamed to src/cpp/scaler/io/ymq/CMakeLists.txt

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,10 @@ if(LINUX)
7070
pymod_ymq/ymq.cpp
7171
)
7272

73-
# target_include_directories(py_ymq PRIVATE ${Python3_INCLUDE_DIRS})
73+
target_include_directories(py_ymq PRIVATE
74+
${PROJECT_SOURCE_DIR}/src/cpp
75+
)
76+
7477
target_link_libraries(py_ymq PRIVATE
7578
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,-Bstatic> ymq_objs
7679
$<$<CXX_COMPILER_ID:GNU,Clang>:-Wl,-Bdynamic>
@@ -83,6 +86,14 @@ if(LINUX)
8386
LINKER_LANGUAGE CXX
8487
)
8588

89+
# Copy .so file to source directory for development/testing
90+
add_custom_command(TARGET py_ymq POST_BUILD
91+
COMMAND ${CMAKE_COMMAND} -E copy
92+
$<TARGET_FILE:py_ymq>
93+
${PROJECT_SOURCE_DIR}/src/scaler/io/ymq/_ymq${CMAKE_SHARED_LIBRARY_SUFFIX}
94+
COMMENT "Copying _ymq.so to source directory for development"
95+
)
96+
8697
install(
8798
TARGETS py_ymq
8899
LIBRARY DESTINATION scaler/io/ymq
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)