diff --git a/.github/workflows/AutoRelease.yml b/.github/workflows/AutoRelease.yml new file mode 100644 index 0000000..46668fe --- /dev/null +++ b/.github/workflows/AutoRelease.yml @@ -0,0 +1,23 @@ +name: AutoRelease + +on: + push: + branches: [ main, release ] + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + update-tag: + runs-on: ubuntu-latest + steps: + - name: Check out repository code + uses: actions/checkout@v3 + - name: Get the latest tag + id: get_tag + run: echo "::set-output name=tag::$(git describe --tags --abbrev=0)" + - name: Increment version + id: increment_version + run: echo "::set-output name=version::$(echo ${{ steps.get_tag.outputs.tag }} | awk -F. '{$NF = $NF + 1;} 1' OFS=.)" + - name: Push new tag + uses: EndBug/latest-tag@latest + with: + tag-name: "v${{ steps.increment_version.outputs.version }}" \ No newline at end of file diff --git a/.github/workflows/VStest.yml b/.github/workflows/VStest.yml index 465e848..e4d791f 100644 --- a/.github/workflows/VStest.yml +++ b/.github/workflows/VStest.yml @@ -21,12 +21,12 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: submodules: 'recursive' # Ensure submodules are fetched - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 - name: Restore NuGet packages working-directory: ${{env.GITHUB_WORKSPACE}} diff --git a/.github/workflows/msbuild.yml b/.github/workflows/msbuild.yml index 5b54db7..16d902c 100644 --- a/.github/workflows/msbuild.yml +++ b/.github/workflows/msbuild.yml @@ -3,7 +3,7 @@ name: MSBuild on: # Triggers the workflow on push or pull request events but only for the main branch push: - branches: [ main ] + branches: [ main, release ] pull_request: branches: [ main ] @@ -21,12 +21,12 @@ jobs: runs-on: windows-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Add MSBuild to PATH - uses: microsoft/setup-msbuild@v1.0.2 + uses: microsoft/setup-msbuild@v2 - name: Restore NuGet packages working-directory: ${{env.GITHUB_WORKSPACE}} @@ -39,9 +39,9 @@ jobs: run: msbuild /m /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}} - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.7 + uses: gittools/actions/gitversion/setup@v1.1.1 with: versionSpec: '5.x' - name: Determine Version - uses: gittools/actions/gitversion/execute@v0.9.7 + uses: gittools/actions/gitversion/execute@v1.1.1 diff --git a/C++/C++.sln b/C++/C++.sln index b092771..4b16bfa 100644 --- a/C++/C++.sln +++ b/C++/C++.sln @@ -7,10 +7,16 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LambdaFunctions", "LambdaFu EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "InputOutput", "InputOutput\InputOutput.vcxproj", "{60CD8FE7-EB95-403D-A0E2-5E89188BA387}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Forward", "Forward\Forward.vcxproj", "{1135FA47-DE13-4E20-8EC0-C01BFD96B155}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MoveSemantics", "MoveSemantics\MoveSemantics.vcxproj", "{1135FA47-DE13-4E20-8EC0-C01BFD96B155}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Regex", "Regex\Regex.vcxproj", "{2134645E-A12D-4143-898F-C2D5C9DE5F4F}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PyBind", "PyBind", "{9B6D7C1A-6E3F-4F0B-9E9C-0B5C6A8F2E77}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PyBindAiry", "PyBind\PyBindAiry\PyBindAiry.vcxproj", "{33B48397-2D59-4D3F-B18C-BF52CC4A3785}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PyBindGetInteger", "PyBind\PyBindGetInteger\PyBindGetInteger.vcxproj", "{4A519CF2-1985-46E5-B701-A3B48E8DE940}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -51,10 +57,30 @@ Global {2134645E-A12D-4143-898F-C2D5C9DE5F4F}.Release|x64.Build.0 = Release|x64 {2134645E-A12D-4143-898F-C2D5C9DE5F4F}.Release|x86.ActiveCfg = Release|Win32 {2134645E-A12D-4143-898F-C2D5C9DE5F4F}.Release|x86.Build.0 = Release|Win32 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Debug|x64.ActiveCfg = Debug|x64 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Debug|x64.Build.0 = Debug|x64 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Debug|x86.ActiveCfg = Debug|Win32 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Debug|x86.Build.0 = Debug|Win32 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Release|x64.ActiveCfg = Release|x64 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Release|x64.Build.0 = Release|x64 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Release|x86.ActiveCfg = Release|Win32 + {33B48397-2D59-4D3F-B18C-BF52CC4A3785}.Release|x86.Build.0 = Release|Win32 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Debug|x64.ActiveCfg = Debug|x64 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Debug|x64.Build.0 = Debug|x64 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Debug|x86.ActiveCfg = Debug|Win32 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Debug|x86.Build.0 = Debug|Win32 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Release|x64.ActiveCfg = Release|x64 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Release|x64.Build.0 = Release|x64 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Release|x86.ActiveCfg = Release|Win32 + {4A519CF2-1985-46E5-B701-A3B48E8DE940}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {33B48397-2D59-4D3F-B18C-BF52CC4A3785} = {9B6D7C1A-6E3F-4F0B-9E9C-0B5C6A8F2E77} + {4A519CF2-1985-46E5-B701-A3B48E8DE940} = {9B6D7C1A-6E3F-4F0B-9E9C-0B5C6A8F2E77} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A4049FF9-DC7D-4D1A-9567-76389B7C83BA} EndGlobalSection diff --git a/C++/Forward/Forward.cpp b/C++/Forward/Forward.cpp deleted file mode 100644 index c1757b8..0000000 --- a/C++/Forward/Forward.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// Forward.cpp : This file contains the 'main' function. Program execution begins and ends there. -// -#include -#include - -void ProcessData(int& data) { - std::cout << "Processing lvalue data: " << data << std::endl; -} - -void ProcessData(int&& data) { - std::cout << "Processing rvalue data: " << data << std::endl; -} - -template -void DataWrapper(T&& data) { - ProcessData(std::forward(data)); //we need to be careful to preserve original value categories - i.e an r value - //ProcessData(data); //This case will call ProcessData(int& data) -} - -int main() { - int x = 42; - DataWrapper(5); // Should call ProcessData(int&&) - DataWrapper(x); // Should call ProcessData(int&) - return 0; -} - diff --git a/C++/LambdaFunctions/ConsoleApplication1.vcxproj.filters b/C++/LambdaFunctions/ConsoleApplication1.vcxproj.filters deleted file mode 100644 index 6713fa5..0000000 --- a/C++/LambdaFunctions/ConsoleApplication1.vcxproj.filters +++ /dev/null @@ -1,22 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - \ No newline at end of file diff --git a/C++/LambdaFunctions/ConsoleApplication1.vcxproj.user b/C++/LambdaFunctions/ConsoleApplication1.vcxproj.user deleted file mode 100644 index 88a5509..0000000 --- a/C++/LambdaFunctions/ConsoleApplication1.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file diff --git a/C++/LambdaFunctions/ConsoleApplication1.cpp b/C++/LambdaFunctions/LambdaFunctions.cpp similarity index 93% rename from C++/LambdaFunctions/ConsoleApplication1.cpp rename to C++/LambdaFunctions/LambdaFunctions.cpp index 7cdb2e5..7bb24d4 100644 --- a/C++/LambdaFunctions/ConsoleApplication1.cpp +++ b/C++/LambdaFunctions/LambdaFunctions.cpp @@ -6,7 +6,9 @@ #include #include #include +#include "SortPerformance.h" using namespace std; + class MyClass { public: int value; // Integer member @@ -23,7 +25,7 @@ bool IsEven(MyClass mclass) int main() { - std::vector> clausesOrdered = + std::vector> clausesOrdered = { {"banana", 1}, {"apple", 4}, @@ -78,5 +80,8 @@ int main() std::cout << "No object with an even value found." << std::endl; } + std::cout << std::endl; + RunSortPerformanceExample(); + return 0; } diff --git a/C++/LambdaFunctions/LambdaFunctions.vcxproj b/C++/LambdaFunctions/LambdaFunctions.vcxproj index f39e3c4..7ebc23a 100644 --- a/C++/LambdaFunctions/LambdaFunctions.vcxproj +++ b/C++/LambdaFunctions/LambdaFunctions.vcxproj @@ -22,7 +22,7 @@ 16.0 Win32Proj {9eb235c6-2f83-4da8-969b-0f1e9dc735c8} - ConsoleApplication1 + LambdaFunctions 10.0 @@ -140,7 +140,11 @@ - + + + + + diff --git a/C++/LambdaFunctions/SortPerformance.cpp b/C++/LambdaFunctions/SortPerformance.cpp new file mode 100644 index 0000000..6a22bfc --- /dev/null +++ b/C++/LambdaFunctions/SortPerformance.cpp @@ -0,0 +1,57 @@ +// SortPerformance.cpp : demonstrates measuring std::sort performance on random vs. already-sorted data. +// + +#include "SortPerformance.h" +#include +#include +#include +#include +#include + +void generateRandomNumbers(std::vector& vec, int size) { + std::random_device rd; + std::mt19937 gen(rd()); + std::uniform_int_distribution<> dis(1, 10000); + + vec.clear(); + vec.reserve(size); + for (int i = 0; i < size; ++i) { + vec.push_back(dis(gen)); + } +} + + +void measurePerformance(const std::vector& vec, const std::string& description) { + auto start = std::chrono::high_resolution_clock::now(); + std::vector sortedVec = vec; + std::sort(sortedVec.begin(), sortedVec.end()); + auto end = std::chrono::high_resolution_clock::now(); + std::chrono::duration sortDuration = end - start; + std::cout << "Time taken to sort " << description << ": " << sortDuration.count() << " seconds\n"; + + start = std::chrono::high_resolution_clock::now(); + bool isSorted = std::is_sorted(sortedVec.begin(), sortedVec.end()); + end = std::chrono::high_resolution_clock::now(); + std::chrono::duration checkDuration = end - start; + std::cout << "Time taken to check if sorted " << description << ": " << checkDuration.count() << " seconds\n"; + std::cout << "Array is sorted: " << (isSorted ? "true" : "false") << "\n"; + + if (description == "already sorted array") { + std::cout << "Performance improvement for checking sorted array: " + << (sortDuration.count() / checkDuration.count()) << " times faster\n"; + } +} + +void RunSortPerformanceExample() +{ + const int size = 10000; + std::vector vec; + generateRandomNumbers(vec, size); + + std::cout << "Performance with random array:\n"; + measurePerformance(vec, "random array"); + + std::cout << "\nPerformance with already sorted array:\n"; + std::sort(vec.begin(), vec.end()); + measurePerformance(vec, "already sorted array"); +} diff --git a/C++/LambdaFunctions/SortPerformance.h b/C++/LambdaFunctions/SortPerformance.h new file mode 100644 index 0000000..0b384b4 --- /dev/null +++ b/C++/LambdaFunctions/SortPerformance.h @@ -0,0 +1,4 @@ +#pragma once + +// Demonstrates measuring std::sort performance on random vs. already-sorted data. +void RunSortPerformanceExample(); diff --git a/C++/MoveSemantics/DynamicBuffer.cpp b/C++/MoveSemantics/DynamicBuffer.cpp new file mode 100644 index 0000000..9ea67d1 --- /dev/null +++ b/C++/MoveSemantics/DynamicBuffer.cpp @@ -0,0 +1,64 @@ +#include "DynamicBuffer.h" +#include + +DynamicBuffer::DynamicBuffer(std::size_t elementCount) + : m_data(new double[elementCount]{}), m_count(elementCount) +{ +} + +// 1. Destructor - releases owned memory +DynamicBuffer::~DynamicBuffer() +{ + delete[] m_data; +} + +// 2. Copy constructor - deep copies the buffer +DynamicBuffer::DynamicBuffer(const DynamicBuffer& source) + : m_data(new double[source.m_count]), m_count(source.m_count) +{ + for (std::size_t i = 0; i < m_count; ++i) + { + m_data[i] = source.m_data[i]; + } +} + +// 3. Copy assignment operator - deep copies, releasing old memory first +DynamicBuffer& DynamicBuffer::operator=(const DynamicBuffer& source) +{ + if (this != &source) + { + double* newData = new double[source.m_count]; + for (std::size_t i = 0; i < source.m_count; ++i) + { + newData[i] = source.m_data[i]; + } + + delete[] m_data; + m_data = newData; + m_count = source.m_count; + } + return *this; +} + +// 4. Move constructor - steals the pointer, leaves source empty +DynamicBuffer::DynamicBuffer(DynamicBuffer&& source) noexcept + : m_data(source.m_data), m_count(source.m_count) +{ + source.m_data = nullptr; + source.m_count = 0; +} + +// 5. Move assignment operator - releases old memory, steals new pointer +DynamicBuffer& DynamicBuffer::operator=(DynamicBuffer&& source) noexcept +{ + if (this != &source) + { + delete[] m_data; + m_data = source.m_data; + m_count = source.m_count; + + source.m_data = nullptr; + source.m_count = 0; + } + return *this; +} diff --git a/C++/MoveSemantics/DynamicBuffer.h b/C++/MoveSemantics/DynamicBuffer.h new file mode 100644 index 0000000..6677408 --- /dev/null +++ b/C++/MoveSemantics/DynamicBuffer.h @@ -0,0 +1,34 @@ +#pragma once +#include + +// Demonstrates the Rule of Five: a resource-owning class must define +// (or explicitly default) all five special member functions if it +// manages a raw resource such as heap memory. +class DynamicBuffer +{ +public: + explicit DynamicBuffer(std::size_t elementCount = 10); + + // 1. Destructor - releases owned memory + ~DynamicBuffer(); + + // 2. Copy constructor - deep copies the buffer + DynamicBuffer(const DynamicBuffer& source); + + // 3. Copy assignment operator - deep copies, releasing old memory first + DynamicBuffer& operator=(const DynamicBuffer& source); + + // 4. Move constructor - steals the pointer, leaves source empty + DynamicBuffer(DynamicBuffer&& source) noexcept; + + // 5. Move assignment operator - releases old memory, steals new pointer + DynamicBuffer& operator=(DynamicBuffer&& source) noexcept; + + std::size_t count() const noexcept { return m_count; } + double& at(std::size_t index) { return m_data[index]; } + double at(std::size_t index) const { return m_data[index]; } + +private: + double* m_data; + std::size_t m_count; +}; \ No newline at end of file diff --git a/C++/MoveSemantics/MoveSemantics.cpp b/C++/MoveSemantics/MoveSemantics.cpp new file mode 100644 index 0000000..fbb2e78 --- /dev/null +++ b/C++/MoveSemantics/MoveSemantics.cpp @@ -0,0 +1,55 @@ +// MoveSemantics.cpp : This file contains the 'main' function. Program execution begins and ends there. +// +#include +#include + +#include "DynamicBuffer.h" + +void ProcessData(int& data) { + std::cout << "Processing lvalue data: " << data << std::endl; +} + +void ProcessData(int&& data) { + std::cout << "Processing rvalue data: " << data << std::endl; +} + +template +void DataWrapper(T&& data) { + ProcessData(std::forward(data)); //we need to be careful to preserve original value categories - i.e an r value + //ProcessData(data); //This case will call ProcessData(int& data) +} + +// ---- Rule of Five demonstration (DynamicBuffer) ---- +// Shows why a class owning a raw resource (heap memory) must implement all +// five special member functions: destructor, copy ctor/assignment, and +// move ctor/assignment. +void DemonstrateRuleOfFive() +{ + DynamicBuffer bufferA(5); + bufferA.at(0) = 3.14; + + // Copy constructor: bufferB gets its own independent memory + DynamicBuffer bufferB(bufferA); + + // Copy assignment: bufferC already exists, old memory is freed first + DynamicBuffer bufferC(5); + bufferC = bufferA; + + // Move constructor: bufferD steals bufferA's pointer, bufferA becomes empty + DynamicBuffer bufferD(std::move(bufferA)); + + // Move assignment: bufferC's old memory is freed, then it steals bufferB's pointer + bufferC = std::move(bufferB); + + std::cout << "bufferD[0] = " << bufferD.at(0) << std::endl; +} + +int main() { + int x = 42; + DataWrapper(5); // Should call ProcessData(int&&) + DataWrapper(x); // Should call ProcessData(int&) + + DemonstrateRuleOfFive(); + + return 0; +} diff --git a/C++/Forward/Forward.vcxproj b/C++/MoveSemantics/MoveSemantics.vcxproj similarity index 97% rename from C++/Forward/Forward.vcxproj rename to C++/MoveSemantics/MoveSemantics.vcxproj index 798abe0..6638729 100644 --- a/C++/Forward/Forward.vcxproj +++ b/C++/MoveSemantics/MoveSemantics.vcxproj @@ -22,7 +22,7 @@ 17.0 Win32Proj {1135fa47-de13-4e20-8ec0-c01bfd96b155} - Forward + MoveSemantics 10.0 @@ -128,10 +128,12 @@ - + + + diff --git a/C++/Forward/Forward.vcxproj.filters b/C++/MoveSemantics/MoveSemantics.vcxproj.filters similarity index 81% rename from C++/Forward/Forward.vcxproj.filters rename to C++/MoveSemantics/MoveSemantics.vcxproj.filters index 3ef9480..054167e 100644 --- a/C++/Forward/Forward.vcxproj.filters +++ b/C++/MoveSemantics/MoveSemantics.vcxproj.filters @@ -15,13 +15,19 @@ - + + Source Files + + Source Files - Source Files + Header Files + + + Header Files \ No newline at end of file diff --git a/C++/Forward/Forward.vcxproj.user b/C++/MoveSemantics/MoveSemantics.vcxproj.user similarity index 100% rename from C++/Forward/Forward.vcxproj.user rename to C++/MoveSemantics/MoveSemantics.vcxproj.user diff --git a/C++/Forward/MoveUnique.h b/C++/MoveSemantics/MoveUnique.h similarity index 100% rename from C++/Forward/MoveUnique.h rename to C++/MoveSemantics/MoveUnique.h diff --git a/PyBind/PyBindAiry/PyBindAiry.cpp b/C++/PyBind/PyBindAiry/PyBindAiry.cpp similarity index 69% rename from PyBind/PyBindAiry/PyBindAiry.cpp rename to C++/PyBind/PyBindAiry/PyBindAiry.cpp index bef2b65..345a47a 100644 --- a/PyBind/PyBindAiry/PyBindAiry.cpp +++ b/C++/PyBind/PyBindAiry/PyBindAiry.cpp @@ -2,7 +2,20 @@ // #include + +// The installed Python distribution only ships release import libraries +// (no python3xx_d.lib). Temporarily undefine _DEBUG so Python.h doesn't +// request the debug-suffixed library when building this project in Debug mode. +#ifdef _DEBUG +#define PYBINDAIRY_RESTORE_DEBUG +#undef _DEBUG +#endif #include +#ifdef PYBINDAIRY_RESTORE_DEBUG +#define _DEBUG +#undef PYBINDAIRY_RESTORE_DEBUG +#endif + #include #include #include @@ -12,18 +25,14 @@ using namespace std::complex_literals; namespace py = pybind11; int main() { - std::string str = "C:/Python/Python39/"; - std::wstring widestr = std::wstring(str.begin(), str.end()); - Py_SetPythonHome(widestr.c_str()); - + // Py_SetPythonHome is deprecated since Python 3.11; the interpreter can + // locate its own installation automatically, so we no longer set it explicitly. pybind11::scoped_interpreter guard{}; pybind11::exec("print('hello world')"); - Py_Initialize(); - - PyRun_SimpleString("import scipy"); - py::object SciPy = py::module_::import("scipy.special"); - py::function airy = SciPy.attr("airy"); + PyRun_SimpleString("import scipy"); + py::object SciPy = py::module_::import("scipy.special"); + py::function airy = SciPy.attr("airy"); //double input py::object airyval = airy(1.0); diff --git a/PyBind/PyBindAiry/PyBindAiry.filters b/C++/PyBind/PyBindAiry/PyBindAiry.filters similarity index 100% rename from PyBind/PyBindAiry/PyBindAiry.filters rename to C++/PyBind/PyBindAiry/PyBindAiry.filters diff --git a/PyBind/PyBindAiry/PyBindAiry.user b/C++/PyBind/PyBindAiry/PyBindAiry.user similarity index 100% rename from PyBind/PyBindAiry/PyBindAiry.user rename to C++/PyBind/PyBindAiry/PyBindAiry.user diff --git a/PyBind/PyBindAiry/PyBindAiry.vcxproj b/C++/PyBind/PyBindAiry/PyBindAiry.vcxproj similarity index 88% rename from PyBind/PyBindAiry/PyBindAiry.vcxproj rename to C++/PyBind/PyBindAiry/PyBindAiry.vcxproj index c69a4c5..039f3e9 100644 --- a/PyBind/PyBindAiry/PyBindAiry.vcxproj +++ b/C++/PyBind/PyBindAiry/PyBindAiry.vcxproj @@ -70,22 +70,25 @@ - + + C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0 + C:\Users\baugstein\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\LocalCache\local-packages\Python312\site-packages\pybind11\include + true true - $(LibraryWPath) - C:\Python\Python39\libs;$(LibraryPath) + $(PythonHome)\include;$(PyBind11Include);$(PyBind11Include)\pybind11;$(IncludePath) + $(PythonHome)\libs;$(LibraryPath) false false - $(Python_39)\include;$(Python_39)\Lib\site-packages\pybind11\include\pybind11;$(IncludePath) - $(Python_39)\libs;$(Python_39)\;$(LibraryPath) + $(PythonHome)\include;$(PyBind11Include);$(PyBind11Include)\pybind11;$(IncludePath) + $(PythonHome)\libs;$(LibraryPath) @@ -115,7 +118,7 @@ Console true - python39.lib;%(AdditionalDependencies) + $(PythonHome)\libs\python312.lib;%(AdditionalDependencies) @@ -155,7 +158,7 @@ true true true - $(Python_39)\libs\python39.lib;%(AdditionalDependencies) + $(PythonHome)\libs\python312.lib;%(AdditionalDependencies) diff --git a/PyBind/PyBindAiry/PyBindAiry.vcxproj.user b/C++/PyBind/PyBindAiry/PyBindAiry.vcxproj.user similarity index 100% rename from PyBind/PyBindAiry/PyBindAiry.vcxproj.user rename to C++/PyBind/PyBindAiry/PyBindAiry.vcxproj.user diff --git a/PyBind/PyBindAiry/README b/C++/PyBind/PyBindAiry/README similarity index 100% rename from PyBind/PyBindAiry/README rename to C++/PyBind/PyBindAiry/README diff --git a/PyBind/PyBindAiry/python39.dll b/C++/PyBind/PyBindAiry/python39.dll similarity index 100% rename from PyBind/PyBindAiry/python39.dll rename to C++/PyBind/PyBindAiry/python39.dll diff --git a/PyBind/PyBindGetInteger/PyBindGetInteger.cpp b/C++/PyBind/PyBindGetInteger/PyBindGetInteger.cpp similarity index 100% rename from PyBind/PyBindGetInteger/PyBindGetInteger.cpp rename to C++/PyBind/PyBindGetInteger/PyBindGetInteger.cpp diff --git a/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj b/C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj similarity index 91% rename from PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj rename to C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj index ebf9c88..b240e99 100644 --- a/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj +++ b/C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj @@ -69,17 +69,21 @@ - + + C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.2800.0_x64__qbz5n2kfra8p0 + false - $(Python_39)\include;$(Python_39)\Lib\site-packages\pybind11\include\pybind11;$(IncludePath) - $(Python_39)\libs;$(Python_39)\;$(LibraryPath) + $(PythonHome)\include;$(IncludePath) + $(PythonHome)\libs;$(LibraryPath) true true + $(PythonHome)\include;$(IncludePath) + $(PythonHome)\libs;$(LibraryPath) false @@ -101,6 +105,7 @@ true true true + $(PythonHome)\libs\python312.lib;%(AdditionalDependencies) @@ -131,6 +136,7 @@ Console true + $(PythonHome)\libs\python312.lib;%(AdditionalDependencies) diff --git a/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.filters b/C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.filters similarity index 100% rename from PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.filters rename to C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.filters diff --git a/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.user b/C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.user similarity index 100% rename from PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.user rename to C++/PyBind/PyBindGetInteger/PyBindGetInteger.vcxproj.user diff --git a/PyBind/PyBindGetInteger/pyemb3.py b/C++/PyBind/PyBindGetInteger/pyemb3.py similarity index 100% rename from PyBind/PyBindGetInteger/pyemb3.py rename to C++/PyBind/PyBindGetInteger/pyemb3.py diff --git a/PyBind/PyBindGetInteger/pyhelper.h b/C++/PyBind/PyBindGetInteger/pyhelper.h similarity index 69% rename from PyBind/PyBindGetInteger/pyhelper.h rename to C++/PyBind/PyBindGetInteger/pyhelper.h index 1ff5c73..efe1cbb 100644 --- a/PyBind/PyBindGetInteger/pyhelper.h +++ b/C++/PyBind/PyBindGetInteger/pyhelper.h @@ -2,7 +2,18 @@ #define PYHELPER_HPP #pragma once +// The installed Python distribution only ships release import libraries +// (no python3xx_d.lib). Temporarily undefine _DEBUG so Python.h doesn't +// request the debug-suffixed library when building this project in Debug mode. +#ifdef _DEBUG +#define PYHELPER_RESTORE_DEBUG +#undef _DEBUG +#endif #include +#ifdef PYHELPER_RESTORE_DEBUG +#define _DEBUG +#undef PYHELPER_RESTORE_DEBUG +#endif class CPyInstance { diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..ff57201 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1 @@ +My changes test \ No newline at end of file diff --git a/GitAction/GitVersion.yml b/GitAction/GitVersion.yml new file mode 100644 index 0000000..ebdfba1 --- /dev/null +++ b/GitAction/GitVersion.yml @@ -0,0 +1,6 @@ +assembly-versioning-scheme: MajorMinorPatch +mode: ContinuousDeployment +branches: {} +ignore: + sha: [] +merge-message-formats: {} diff --git a/GitAction/gitversion.json b/GitAction/gitversion.json index 84bc023..9c96b7d 100644 --- a/GitAction/gitversion.json +++ b/GitAction/gitversion.json @@ -1,35 +1,35 @@ { - "Major": 1, + "Major": 2, "Minor": 0, - "Patch": 1, - "PreReleaseTag": "", - "PreReleaseTagWithDash": "", - "PreReleaseLabel": "", - "PreReleaseLabelWithDash": "", - "PreReleaseNumber": null, - "WeightedPreReleaseNumber": 60000, - "BuildMetaData": 1, - "BuildMetaDataPadded": "0001", - "FullBuildMetaData": "1.Branch.main.Sha.a767ee826f0188192bb4ae91309d41124ecb0963", - "MajorMinorPatch": "1.0.1", - "SemVer": "1.0.1", - "LegacySemVer": "1.0.1", - "LegacySemVerPadded": "1.0.1", - "AssemblySemVer": "1.0.1.0", - "AssemblySemFileVer": "1.0.1.0", - "FullSemVer": "1.0.1+1", - "InformationalVersion": "1.0.1+1.Branch.main.Sha.a767ee826f0188192bb4ae91309d41124ecb0963", - "BranchName": "main", - "EscapedBranchName": "main", - "Sha": "a767ee826f0188192bb4ae91309d41124ecb0963", - "ShortSha": "a767ee8", - "NuGetVersionV2": "1.0.1", - "NuGetVersion": "1.0.1", - "NuGetPreReleaseTagV2": "", - "NuGetPreReleaseTag": "", - "VersionSourceSha": "3fd209a70ce97e2cf01d71c56953456cb33d9676", - "CommitsSinceVersionSource": 1, - "CommitsSinceVersionSourcePadded": "0001", - "UncommittedChanges": 241, - "CommitDate": "2024-07-02" + "Patch": 0, + "PreReleaseTag": "modernise.13", + "PreReleaseTagWithDash": "-modernise.13", + "PreReleaseLabel": "modernise", + "PreReleaseLabelWithDash": "-modernise", + "PreReleaseNumber": 13, + "WeightedPreReleaseNumber": 13, + "BuildMetaData": null, + "BuildMetaDataPadded": "", + "FullBuildMetaData": "Branch.modernise.Sha.c6e5684cfd21a9eeea198a5c506b9c44d25fb465", + "MajorMinorPatch": "2.0.0", + "SemVer": "2.0.0-modernise.13", + "LegacySemVer": "2.0.0-modernise13", + "LegacySemVerPadded": "2.0.0-modernise0013", + "AssemblySemVer": "2.0.0.0", + "AssemblySemFileVer": "2.0.0.0", + "FullSemVer": "2.0.0-modernise.13", + "InformationalVersion": "2.0.0-modernise.13+Branch.modernise.Sha.c6e5684cfd21a9eeea198a5c506b9c44d25fb465", + "BranchName": "modernise", + "EscapedBranchName": "modernise", + "Sha": "c6e5684cfd21a9eeea198a5c506b9c44d25fb465", + "ShortSha": "c6e5684", + "NuGetVersionV2": "2.0.0-modernise0013", + "NuGetVersion": "2.0.0-modernise0013", + "NuGetPreReleaseTagV2": "modernise0013", + "NuGetPreReleaseTag": "modernise0013", + "VersionSourceSha": "a767ee826f0188192bb4ae91309d41124ecb0963", + "CommitsSinceVersionSource": 13, + "CommitsSinceVersionSourcePadded": "0013", + "UncommittedChanges": 573, + "CommitDate": "2026-08-25" } \ No newline at end of file diff --git a/UnitTest/UnitTest1/HelperFunctions.cpp b/UnitTest/UnitTest1/HelperFunctions.cpp index c91e641..aa38c8a 100644 --- a/UnitTest/UnitTest1/HelperFunctions.cpp +++ b/UnitTest/UnitTest1/HelperFunctions.cpp @@ -3,6 +3,7 @@ #include #include + using namespace std; char* HelperFunctions::GetEnvVariable(std::string name)