Skip to content

Commit 52b7447

Browse files
Saurav AgarwalSaurav Agarwal
authored andcommitted
Update setup and versioning
1 parent 65c2dae commit 52b7447

File tree

11 files changed

+76
-17
lines changed

11 files changed

+76
-17
lines changed

VERSION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1.0

cppsrc/core/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
cmake_minimum_required(VERSION 3.22)
2-
project(CoverageControl VERSION 0.3 LANGUAGES CXX)
1+
cmake_minimum_required(VERSION 3.16)
2+
project(CoverageControl LANGUAGES CXX)
3+
4+
# Check if file VERSION exists
5+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION")
6+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION" VERSION)
7+
string(STRIP ${VERSION} VERSION)
8+
set(${PROJECT_NAME}_VERSION ${VERSION})
9+
else()
10+
message(WARNING "VERSION file not found, using 0.0 as default version")
11+
set(${PROJECT_NAME}_VERSION 0.0)
12+
endif()
313

414
if (NOT CMAKE_BUILD_TYPE)
515
set(CMAKE_BUILD_TYPE Release)
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
// the configured options and settings for CoverageControl
2-
#define CoverageControl_VERSION_MAJOR @CoverageControl_VERSION_MAJOR@
3-
#define CoverageControl_VERSION_MINOR @CoverageControl_VERSION_MINOR@
2+
#define CoverageControl_VERSION @CoverageControl_VERSION@
43
#cmakedefine WITH_CUDA

cppsrc/core/python_bindings/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ build-backend = "scikit_build_core.build"
44

55
[project]
66
name = "CoverageControl"
7-
version = "0.4.0"
7+
version = "1.0"
88
description="Project for Coverage Control"
99
requires-python = ">=3.10"
1010
dependencies = [ "numpy" ]
1111
authors = [
12-
{name = "Saurav Agarwal", email = "[email protected]" } # Optional
12+
{name = "Saurav Agarwal", email = "[email protected]" }
1313
]
1414

1515
[tool.setuptools]

cppsrc/core/python_bindings/src/CoverageControl/__init__.py

Whitespace-only changes.

cppsrc/core/python_bindings/src/coverage_control_python_binds.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,19 @@
2323

2424
#include "../core_binds.h"
2525

26+
#include <CoverageControlConfig.h>
2627
#include <CoverageControl/coverage_system.h>
2728
using namespace CoverageControl;
2829

2930
PYBIND11_MODULE(CoverageControl, m) {
3031
pyCoverageControl_core(m);
3132
pyCoverageControl_core_coverage_system(m);
33+
34+
/* m.attr("__version__") = CoverageControl_VERSION_MAJOR "." CoverageControl_VERSION_MINOR "." CoverageControl_VERSION_PATCH; */
35+
#ifdef CoverageControl_VERSION
36+
m.attr("__version__") = CoverageControl_VERSION;
37+
#else
38+
m.attr("__version__") = "dev";
39+
#endif
40+
3241
}

cppsrc/main/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
cmake_minimum_required(VERSION 3.22)
2-
project(CoverageControlMain VERSION 0.3 LANGUAGES CXX)
1+
cmake_minimum_required(VERSION 3.16)
2+
project(CoverageControlMain LANGUAGES CXX)
3+
4+
# Check if file VERSION exists
5+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION")
6+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION" VERSION)
7+
string(STRIP ${VERSION} VERSION)
8+
set(${PROJECT_NAME}_VERSION ${VERSION})
9+
else()
10+
message(WARNING "VERSION file not found, using 0.0 as default version")
11+
set(${PROJECT_NAME}_VERSION 0.0)
12+
endif()
313

414
if(NOT CMAKE_BUILD_TYPE)
515
set(CMAKE_BUILD_TYPE Release)

cppsrc/setup.sh

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,21 @@
11
#!/usr/bin/env bash
2-
params="$(getopt -o d:ctpg -l directory:,clean,torch,python,global,with-cuda,with-deps --name "$(basename "$0")" -- "$@")"
2+
ORIG_INPUT_PARAMS="$@"
3+
params="$(getopt -o d:hctpg -l directory:,help,clean,torch,python,global,with-cuda,with-deps --name "$(basename "$0")" -- "$@")"
34

45
if [ $? -ne 0 ]
56
then
6-
print_usage
7+
print_usage
78
fi
89

910
print_usage() {
10-
printf "bash $0 [-d|--directory <workspace directory>] [-c|--clean] [-t|--torch <build with libtorch>] [-p|--python <install python bindings>] [-g|--global] [--with-cuda <cpu only>] [--with-deps <install dependencies>]\n"
11+
printf "bash $0 [-h|--help] [-d|--directory <workspace directory>] [-p|--python] [--with-cuda] [--with-deps] [-g|--global] [-c|--clean] [-t|--torch]\n"
12+
printf "Options:\n"
13+
printf " -h, --help : Prints this help message\n"
14+
printf " -d, --directory <workspace directory> : Builds and installs the package in the specified directory\n"
15+
printf " -p, --python : Installs the python bindings\n"
16+
printf " --with-cuda : Builds the package with CUDA support\n"
17+
printf " --with-deps : Installs the dependencies\n"
18+
printf " -g, --global : Installs the package globally. Needs sudo permissions\n"
1119
}
1220

1321
# Get directory of script
@@ -21,7 +29,7 @@ unset params
2129
INSTALL=true
2230
while true; do
2331
case ${1} in
24-
-i|--install) INSTALL=true;shift;;
32+
-h|--help) print_usage; exit 0;;
2533
-c|--clean) CLEAN=true;INSTALL=false;shift;;
2634
-t|--torch) WITH_TORCH=ON; shift;;
2735
-p|--python) WITH_PYTHON=true;shift;;

cppsrc/tests/CMakeLists.txt

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
cmake_minimum_required(VERSION 3.22)
2-
project(CoverageControlTests VERSION 0.3 LANGUAGES CXX)
1+
cmake_minimum_required(VERSION 3.16)
2+
project(CoverageControlTests LANGUAGES CXX)
3+
4+
# Check if file VERSION exists
5+
if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION")
6+
file(READ "${CMAKE_CURRENT_SOURCE_DIR}/../../VERSION" VERSION)
7+
string(STRIP ${VERSION} VERSION)
8+
set(${PROJECT_NAME}_VERSION ${VERSION})
9+
else()
10+
message(WARNING "VERSION file not found, using 0.0 as default version")
11+
set(${PROJECT_NAME}_VERSION 0.0)
12+
endif()
313

414
if(NOT CMAKE_BUILD_TYPE)
515
set(CMAKE_BUILD_TYPE Release)

python/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "CoverageControlTorch"
7-
version = "0.0.1"
7+
version = "1.0"
88
authors = [
99
{ name="Saurav Agarwal", email="[email protected]" },
1010
]

0 commit comments

Comments
 (0)