You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@datasketches.apache.org by jm...@apache.org on 2022/11/03 22:39:04 UTC

[datasketches-cpp] branch common_version created (now cdaaf59)

This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a change to branch common_version
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git


      at cdaaf59  Generate version for both c++ and python from version.cfg.in

This branch includes the following new commits:

     new f9ea343  bump versions for workflow jobs
     new cdaaf59  Generate version for both c++ and python from version.cfg.in

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-cpp] 01/02: bump versions for workflow jobs

Posted by jm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch common_version
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git

commit f9ea3437c049dc508094c58e5c4d78bc4188f212
Author: Jon Malkin <78...@users.noreply.github.com>
AuthorDate: Thu Nov 3 15:37:45 2022 -0700

    bump versions for workflow jobs
---
 .github/workflows/build_cmake.yml   | 4 ++--
 .github/workflows/build_wheels.yml  | 4 ++--
 .github/workflows/code_coverage.yml | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/build_cmake.yml b/.github/workflows/build_cmake.yml
index 9660887..8e4c7cb 100644
--- a/.github/workflows/build_cmake.yml
+++ b/.github/workflows/build_cmake.yml
@@ -40,7 +40,7 @@ jobs:
             
     steps:
       - name: Checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
         with:
           submodules: true
           persist-credentials: false
@@ -51,7 +51,7 @@ jobs:
       - name: Run C++ tests
         run: cmake --build build --config Release --target ${{ matrix.config.test_target }}
       - name: Set up Python 3.x
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: '3.8' # 3.x grabs latest minor version of python3, but 3.9 not fully supported yet
       - name: Install Python dependencies
diff --git a/.github/workflows/build_wheels.yml b/.github/workflows/build_wheels.yml
index 4f9ca19..380777e 100644
--- a/.github/workflows/build_wheels.yml
+++ b/.github/workflows/build_wheels.yml
@@ -18,7 +18,7 @@ jobs:
     steps:
       - uses: actions/checkout@v3
 
-      - uses: actions/setup-python@v3
+      - uses: actions/setup-python@v4
         name: Install Python
         with:
           python-version: '3.x'
@@ -72,7 +72,7 @@ jobs:
         uses: actions/checkout@v3
 
       - name: Set up Python 3.x
-        uses: actions/setup-python@v2
+        uses: actions/setup-python@v4
         with:
           python-version: '3.x'
            
diff --git a/.github/workflows/code_coverage.yml b/.github/workflows/code_coverage.yml
index a0e0a85..f1112ad 100644
--- a/.github/workflows/code_coverage.yml
+++ b/.github/workflows/code_coverage.yml
@@ -16,7 +16,7 @@ jobs:
             
     steps:
       - name: Checkout
-        uses: actions/checkout@v2
+        uses: actions/checkout@v3
         with:
           submodules: true
           persist-credentials: false


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org


[datasketches-cpp] 02/02: Generate version for both c++ and python from version.cfg.in

Posted by jm...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jmalkin pushed a commit to branch common_version
in repository https://gitbox.apache.org/repos/asf/datasketches-cpp.git

commit cdaaf592fc23884e375e60f01a8fd225e92c025a
Author: Jon Malkin <78...@users.noreply.github.com>
AuthorDate: Thu Nov 3 15:38:46 2022 -0700

    Generate version for both c++ and python from version.cfg.in
---
 .gitignore                    |  4 ++++
 CMakeLists.txt                | 16 +++++++++++++++-
 MANIFEST.in                   | 18 ++++++++++++++++++
 common/CMakeLists.txt         |  3 +++
 common/include/version.hpp.in | 36 ++++++++++++++++++++++++++++++++++++
 pyproject.toml                | 29 +++++++++++++++++------------
 setup.py                      | 14 +++++++++++++-
 tox.ini                       | 26 ++++++++++++++++++++++++++
 version.cfg.in                |  1 +
 9 files changed, 133 insertions(+), 14 deletions(-)

diff --git a/.gitignore b/.gitignore
index daae921..d6414e6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,7 @@
+# output of configured files
+version.cfg
+common/include/version.hpp
+
 # Eclipse project files 
 .cproject
 .project
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 35f601b..961fad1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -16,10 +16,24 @@
 # under the License.
 
 cmake_minimum_required(VERSION 3.16.0)
+
+string(TIMESTAMP DT %Y%m%d UTC)
+string(TIMESTAMP HHMM %H%M UTC)
+configure_file(version.cfg.in ${CMAKE_CURRENT_SOURCE_DIR}/version.cfg @ONLY)
+file(STRINGS version.cfg BASE_VERSION)
+
 project(DataSketches
-        VERSION 3.6.0
+        VERSION ${BASE_VERSION}
         LANGUAGES CXX)
 
+#get_cmake_property(_variableNames VARIABLES)
+#list (SORT _variableNames)
+#foreach (_variableName ${_variableNames})
+#    message(STATUS "${_variableName}=${${_variableName}}")
+#endforeach()
+
+message("Configuring DataSketches version ${BASE_VERSION}")
+
 include(GNUInstallDirs)
 include(CMakeDependentOption)
 
diff --git a/MANIFEST.in b/MANIFEST.in
index 6a792cb..a24216c 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,9 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 global-include CMakeLists.txt
 global-include *.cpp
 global-include *.c
 global-include *.hpp
 global-include *.h
 global-include *.bin
+global-include *.in
 
 global-exclude .git*
 
diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt
index f307374..b252aa0 100644
--- a/common/CMakeLists.txt
+++ b/common/CMakeLists.txt
@@ -17,6 +17,8 @@
 
 add_library(common INTERFACE)
 
+configure_file(include/version.hpp.in ${CMAKE_CURRENT_SOURCE_DIR}/include/version.hpp @ONLY)
+
 if (BUILD_TESTS)
   add_subdirectory(test)
 endif()
@@ -32,6 +34,7 @@ target_compile_features(common INTERFACE cxx_std_11)
 install(TARGETS common EXPORT ${PROJECT_NAME})
 
 install(FILES 
+			include/version.hpp
 			include/common_defs.hpp
 			include/memory_operations.hpp
 			include/MurmurHash3.h
diff --git a/common/include/version.hpp.in b/common/include/version.hpp.in
new file mode 100644
index 0000000..c22e65b
--- /dev/null
+++ b/common/include/version.hpp.in
@@ -0,0 +1,36 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+#ifndef _VERSION_HPP_
+#define _VERSION_HPP_
+
+namespace datasketches {
+
+// the configured options and settings for DataSketches
+constexpr int VERSION_MAJOR {@DataSketches_VERSION_MAJOR@};
+constexpr int VERSION_MINOR {@DataSketches_VERSION_MINOR@};
+constexpr int VERSION_PATCH {@DataSketches_VERSION_PATCH@};
+constexpr int VERSION_TWEAK {@DataSketches_VERSION_TWEAK@};
+
+constexpr auto VERSION_STR = "@DataSketches_VERSION@";
+constexpr auto SOURCE_URL = "https://github.com/apache/datasketches-cpp";
+
+}
+
+#endif // _VERSION_HPP_
\ No newline at end of file
diff --git a/pyproject.toml b/pyproject.toml
index 5bcf6b7..42479bc 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,18 +1,23 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
 [build-system]
 requires = ["wheel",
             "setuptools >= 30.3.0",
             "cmake >= 3.16",
             "pybind11[global] >= 2.6.0"]
 build-backend = "setuptools.build_meta"
-
-[tool.tox]
-legacy_tox_ini = """
-[tox]
-envlist = py3
-
-[testenv]
-deps = pytest
-       numpy
-changedir = python/tests
-commands = pytest
-"""
\ No newline at end of file
diff --git a/setup.py b/setup.py
index 04989d6..38c1543 100644
--- a/setup.py
+++ b/setup.py
@@ -22,6 +22,8 @@ import os
 import sys
 import platform
 import subprocess
+import re
+from datetime import datetime, timezone
 
 from setuptools import setup, find_packages, Extension
 from setuptools.command.build_ext import build_ext
@@ -78,9 +80,19 @@ class CMakeBuild(build_ext):
                               cwd=self.build_temp, env=env)
         print() # add an empty line to pretty print
 
+# Read and parse the version format
+# @DT@ -> datestamp
+# @HHMM@ -> .devHHMM to indicate development version
+# Releases should have a fixed version with no @ variables
+with open('version.cfg.in', 'r') as file:
+    ds_version = file.read().rstrip()
+dt = datetime.now(timezone.utc)
+ds_version = re.sub('@DT@', dt.strftime('%Y%m%d'), ds_version)
+ds_version = re.sub('@HHMM@', 'dev' + dt.strftime('%H%M'), ds_version)
+
 setup(
     name='datasketches',
-    version='3.6.0.dev0',
+    version=ds_version,
     author='Apache Software Foundation',
     author_email='dev@datasketches.apache.org',
     description='The Apache DataSketches Library for Python',
diff --git a/tox.ini b/tox.ini
new file mode 100644
index 0000000..e5ae372
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,26 @@
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+[tox]
+envlist = py3
+isolated_build = true
+
+[testenv]
+deps = pytest
+       numpy
+changedir = python/tests
+commands = pytest
diff --git a/version.cfg.in b/version.cfg.in
new file mode 100644
index 0000000..219ed37
--- /dev/null
+++ b/version.cfg.in
@@ -0,0 +1 @@
+3.6.@DT@.@HHMM@


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@datasketches.apache.org
For additional commands, e-mail: commits-help@datasketches.apache.org