-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ababak/drop_python2
Drop python2, support Python 3.9, 3.10, 3.11, 3.12
- Loading branch information
Showing
20 changed files
with
97 additions
and
133 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,4 +71,4 @@ out | |
.Spotlight-V100 | ||
.Trashes | ||
ehthumbs.db | ||
Thumbs.db | ||
Thumbs.db |
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 |
---|---|---|
|
@@ -3,75 +3,15 @@ | |
# Andriy Babak <[email protected]> | ||
# | ||
# Build the docker image: | ||
# docker build --rm -t ababak/cgcpp:1.6 . | ||
# docker build --rm -t ababak/cgcpp:1.7 . | ||
# docker run --rm -v "$(pwd):c:/source:ro" -r "$(pwd)/out:c:/out" ababak/cgcpp:1.7 | ||
# docker run --rm -v "$(pwd -W):c:/source:ro" -v "$(pwd -W)/out:c:/out" ababak/cgcpp:1.7 | ||
# See README.md for details | ||
|
||
FROM mcr.microsoft.com/windows/servercore:ltsc2019 as base | ||
FROM ababak/boost:latest as base | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
SHELL ["powershell", "-ExecutionPolicy", "RemoteSigned", "-Command"] | ||
|
||
# Install BuildTools | ||
RUN Invoke-WebRequest "https://aka.ms/vs/16/release/vs_buildtools.exe" -OutFile vs_buildtools.exe; \ | ||
Start-Process vs_buildtools.exe -Wait -ArgumentList '\ | ||
--quiet \ | ||
--wait \ | ||
--norestart \ | ||
--nocache \ | ||
--installPath C:/BuildTools \ | ||
--add Microsoft.VisualStudio.Workload.MSBuildTools \ | ||
--add Microsoft.VisualStudio.Workload.VCTools \ | ||
--add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 \ | ||
--add Microsoft.VisualStudio.Component.Windows10SDK.18362 \ | ||
--add Microsoft.VisualStudio.Component.VC.CMake.Project \ | ||
--add Microsoft.VisualStudio.Component.TestTools.BuildTools \ | ||
--add Microsoft.VisualStudio.Component.VC.ASAN \ | ||
--add Microsoft.VisualStudio.Component.VC.140'; \ | ||
Remove-Item c:/vs_buildtools.exe | ||
|
||
# Install Chocolatey package manager | ||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
iex (New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1') | ||
|
||
# Install Chocolatey packages | ||
RUN choco install -y \ | ||
7zip \ | ||
nasm \ | ||
openssh \ | ||
git | ||
|
||
# Install Python | ||
RUN choco install -y \ | ||
python2 | ||
RUN choco install -y \ | ||
python39 | ||
RUN choco install -y \ | ||
python310 | ||
|
||
ENV PYTHONIOENCODING UTF-8 | ||
|
||
# Install Boost | ||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
Invoke-WebRequest "https://boost.teeks99.com/bin/1.67.0/boost_1_67_0-msvc-14.1-64.exe" -OutFile boost.exe; \ | ||
Start-Process boost.exe -Wait -ArgumentList '/DIR="C:/local/boost_1_67_0" /SILENT'; \ | ||
Remove-Item c:/boost.exe | ||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
Invoke-WebRequest "https://boost.teeks99.com/bin/1.76.0/boost_1_76_0-msvc-14.1-64.exe" -OutFile boost.exe; \ | ||
Start-Process boost.exe -Wait -ArgumentList '/DIR="C:/local/boost_1_76_0" /SILENT'; \ | ||
Remove-Item c:/boost.exe | ||
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; \ | ||
Invoke-WebRequest "https://boost.teeks99.com/bin/1.80.0/boost_1_80_0-msvc-14.1-64.exe" -OutFile boost.exe; \ | ||
Start-Process boost.exe -Wait -ArgumentList '/DIR="C:/local/boost_1_80_0" /SILENT'; \ | ||
Remove-Item c:/boost.exe | ||
|
||
ENV CMAKE_GENERATOR "NMake Makefiles" | ||
RUN setx /M PATH $( \ | ||
'c:/cmake' + ';' + \ | ||
$env:PATH + ';' + \ | ||
$env:PROGRAMFILES + '/NASM' \ | ||
) | ||
|
||
COPY cmake C:/cmake | ||
COPY build.bat C:/build.bat | ||
|
||
|
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,7 +1,7 @@ | ||
# (c) Andriy Babak 2020-2021 | ||
# (c) Andriy Babak 2020-2024 | ||
# | ||
# date: 08/09/2020 | ||
# modified: 05/08/2022 16:02:45 | ||
# modified: 24/07/2024 13:34:57 | ||
# | ||
# Author: Andriy Babak | ||
# e-mail: [email protected] | ||
|
@@ -13,21 +13,23 @@ | |
function(build_maya_module MAYA_VERSION PROJECT_BUILD_TYPE) | ||
find_package (Maya REQUIRED) | ||
set (CMAKE_BUILD_TYPE "${PROJECT_BUILD_TYPE}" CACHE INTERNAL "" FORCE) | ||
if (MAYA_VERSION VERSION_LESS 2023) | ||
set(PYTHON_REQUESTED_VERSION 2.7) | ||
set(Python_ROOT_DIR "C:/Python27") | ||
set(BOOST_REQUESTED_VERSION 1.67.0) | ||
set(BOOST_ROOT "C:/local/boost_1_67_0") | ||
elseif (MAYA_VERSION VERSION_LESS 2024) | ||
if (MAYA_VERSION VERSION_LESS 2024) | ||
set(PYTHON_REQUESTED_VERSION 3.9) | ||
set(Python_ROOT_DIR "C:/Python39") | ||
set(BOOST_REQUESTED_VERSION 1.76.0) | ||
set(BOOST_ROOT "C:/local/boost_1_76_0") | ||
else () | ||
elseif (MAYA_VERSION VERSION_LESS 2025) | ||
set(PYTHON_REQUESTED_VERSION 3.10) | ||
set(Python_ROOT_DIR "C:/Python310") | ||
set(BOOST_REQUESTED_VERSION 1.80.0) | ||
set(BOOST_ROOT "C:/local/boost_1_80_0") | ||
elseif (MAYA_VERSION VERSION_LESS 2026) | ||
set(PYTHON_REQUESTED_VERSION 3.11) | ||
set(Python_ROOT_DIR "C:/Python311") | ||
set(BOOST_REQUESTED_VERSION 1.82.0) | ||
set(BOOST_ROOT "C:/local/boost_1_82_0") | ||
else () | ||
message( FATAL_ERROR "Unsupported Maya version: ${MAYA_VERSION}" ) | ||
endif () | ||
message (STATUS "Python version: ${PYTHON_REQUESTED_VERSION}") | ||
string (REPLACE "." "" PYTHON_DOTLESS_VERSION "${PYTHON_REQUESTED_VERSION}") | ||
|
@@ -72,16 +74,18 @@ function(build_houdini_module HOUDINI_VERSION PROJECT_BUILD_TYPE) | |
# specifying this path. | ||
list(APPEND CMAKE_PREFIX_PATH "${HFS}/toolkit/cmake") | ||
find_package (Houdini REQUIRED) | ||
if (Houdini_VERSION VERSION_LESS 19.5) | ||
set(PYTHON_REQUESTED_VERSION 2.7) | ||
set(Python_ROOT_DIR "C:/Python27") | ||
set(BOOST_REQUESTED_VERSION 1.67.0) | ||
set(BOOST_ROOT "C:/local/boost_1_67_0") | ||
else () | ||
if (Houdini_VERSION VERSION_LESS 20.0) | ||
set(PYTHON_REQUESTED_VERSION 3.9) | ||
set(Python_ROOT_DIR "C:/Python39") | ||
set(BOOST_REQUESTED_VERSION 1.76.0) | ||
set(BOOST_ROOT "C:/local/boost_1_76_0") | ||
elseif (Houdini_VERSION VERSION_LESS 20.5) | ||
set(PYTHON_REQUESTED_VERSION 3.10) | ||
set(Python_ROOT_DIR "C:/Python310") | ||
set(BOOST_REQUESTED_VERSION 1.80.0) | ||
set(BOOST_ROOT "C:/local/boost_1_80_0") | ||
else () | ||
message( FATAL_ERROR "Unsupported Houdini version: ${HOUDINI_VERSION}" ) | ||
endif () | ||
message (STATUS "Python version: ${PYTHON_REQUESTED_VERSION}") | ||
string (REPLACE "." "" PYTHON_DOTLESS_VERSION "${PYTHON_REQUESTED_VERSION}") | ||
|
@@ -171,27 +175,32 @@ endfunction() | |
|
||
|
||
function(build_python_module PYTHON_REQUESTED_VERSION PROJECT_BUILD_TYPE) | ||
if (PYTHON_REQUESTED_VERSION VERSION_EQUAL 2.7) | ||
set(Python_ROOT_DIR "C:/Python27") | ||
set(BOOST_REQUESTED_VERSION 1.67.0) | ||
set(BOOST_ROOT "C:/local/boost_1_67_0") | ||
elseif (PYTHON_REQUESTED_VERSION VERSION_EQUAL 3.9) | ||
set(Python_ROOT_DIR "C:/Python39") | ||
set(BOOST_REQUESTED_VERSION 1.76.0) | ||
set(BOOST_ROOT "C:/local/boost_1_76_0") | ||
string (REPLACE "." "" PYTHON_DOTLESS_VERSION "${PYTHON_REQUESTED_VERSION}") | ||
message (STATUS "Python version: ${PYTHON_REQUESTED_VERSION}") | ||
set (TARGET_NAME "${PROJECT_NAME}_python${PYTHON_DOTLESS_VERSION}") | ||
set (CMAKE_BUILD_TYPE "${PROJECT_BUILD_TYPE}" CACHE INTERNAL "" FORCE) | ||
message (STATUS "Target name: ${TARGET_NAME}") | ||
if (PYTHON_REQUESTED_VERSION VERSION_EQUAL 3.9) | ||
set (Python_ROOT_DIR "C:/Python39") | ||
set (BOOST_REQUESTED_VERSION 1.76.0) | ||
set (BOOST_ROOT "C:/local/boost_1_76_0") | ||
elseif (PYTHON_REQUESTED_VERSION VERSION_EQUAL 3.10) | ||
set(Python_ROOT_DIR "C:/Python310") | ||
set(BOOST_REQUESTED_VERSION 1.80.0) | ||
set(BOOST_ROOT "C:/local/boost_1_80_0") | ||
set (Python_ROOT_DIR "C:/Python310") | ||
set (BOOST_REQUESTED_VERSION 1.80.0) | ||
set (BOOST_ROOT "C:/local/boost_1_80_0") | ||
elseif (PYTHON_REQUESTED_VERSION VERSION_EQUAL 3.11) | ||
set (Python_ROOT_DIR "C:/Python311") | ||
set (BOOST_REQUESTED_VERSION 1.82.0) | ||
set (BOOST_ROOT "C:/local/boost_1_82_0") | ||
elseif (PYTHON_REQUESTED_VERSION VERSION_EQUAL 3.12) | ||
set (Python_ROOT_DIR "C:/Python312") | ||
set (BOOST_REQUESTED_VERSION 1.85.0) | ||
set (BOOST_ROOT "C:/local/boost_1_85_0") | ||
else () | ||
message( FATAL_ERROR "Unsupported Python version: ${PYTHON_REQUESTED_VERSION}" ) | ||
endif () | ||
message (STATUS "Python version: ${PYTHON_REQUESTED_VERSION}") | ||
string (REPLACE "." "" PYTHON_DOTLESS_VERSION "${PYTHON_REQUESTED_VERSION}") | ||
set (CMAKE_BUILD_TYPE "${PROJECT_BUILD_TYPE}" CACHE INTERNAL "" FORCE) | ||
find_package (Python ${PYTHON_REQUESTED_VERSION} REQUIRED COMPONENTS Interpreter Development) | ||
find_package (Boost ${BOOST_REQUESTED_VERSION} EXACT REQUIRED COMPONENTS python${PYTHON_DOTLESS_VERSION} system filesystem) | ||
set (TARGET_NAME "${PROJECT_NAME}_python${PYTHON_DOTLESS_VERSION}") | ||
add_library (${TARGET_NAME} SHARED ${SRC}) | ||
target_include_directories ( | ||
${TARGET_NAME} | ||
|
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 @@ | ||
# (c) Andriy Babak 2020-2021 | ||
# (c) Andriy Babak 2020-2024 | ||
# | ||
# date: 08/09/2020 | ||
# modified: 28/05/2021 16:41:32 | ||
|
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,7 +1,7 @@ | ||
# (c) Andriy Babak 2020-2021 | ||
# (c) Andriy Babak 2020-2024 | ||
# | ||
# date: 08/09/2020 | ||
# modified: 20/04/2023 15:21:22 | ||
# modified: 24/07/2024 13:15:27 | ||
# | ||
# Author: Andriy Babak | ||
# e-mail: [email protected] | ||
|
@@ -17,6 +17,9 @@ include(build_functions) | |
|
||
message (STATUS "CMake version: ${CMAKE_VERSION}") | ||
|
||
set(Boost_NO_WARN_NEW_VERSIONS ON) | ||
set(Boost_NO_BOOST_CMAKE ON) | ||
set(Boost_USE_STATIC_RUNTIME OFF) | ||
set(Boost_USE_STATIC_LIBS ON) | ||
add_definitions(-DBOOST_PYTHON_STATIC_LIB) | ||
set (Python_FIND_STRATEGY "LOCATION") | ||
|
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 @@ | ||
# (c) Andriy Babak 2020-2021 | ||
# (c) Andriy Babak 2020-2024 | ||
# | ||
# date: 07/09/2020 | ||
# modified: 28/05/2021 16:41:00 | ||
|
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,8 +1,8 @@ | ||
/* | ||
* (c) Andriy Babak 2019-2022 | ||
* (c) Andriy Babak 2019-2024 | ||
* | ||
* date: 23/01/2019 | ||
* modified: 05/08/2022 17:15:19 | ||
* modified: 30/05/2024 10:41:16 | ||
* | ||
* Author: Andriy Babak | ||
* e-mail: [email protected] | ||
|
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,8 +1,8 @@ | ||
/* | ||
* (c) Andriy Babak 2022 | ||
* (c) Andriy Babak 2022-2024 | ||
* | ||
* date: 05/08/2022 | ||
* modified: 05/08/2022 18:55:46 | ||
* modified: 30/05/2024 10:40:58 | ||
* | ||
* Author: Andriy Babak | ||
* e-mail: [email protected] | ||
|
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,8 +1,8 @@ | ||
/* | ||
* (c) Andriy Babak 2019-2022 | ||
* (c) Andriy Babak 2019-2024 | ||
* | ||
* date: 10/01/2019 | ||
* modified: 05/08/2022 13:12:07 | ||
* modified: 30/05/2024 10:40:42 | ||
* | ||
* Author: Andriy Babak | ||
* e-mail: [email protected] | ||
|
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
(c) Andriy Babak 2021 | ||
date: 28/05/2021 | ||
modified: 04/08/2022 17:50:02 | ||
modified: 24/07/2024 10:15:50 | ||
Author: Andriy Babak | ||
e-mail: [email protected] | ||
|
@@ -72,7 +72,7 @@ def run(self): | |
docker_args = [ | ||
self.DOCKER_APP, | ||
"build", | ||
"--rm", | ||
# "--rm", | ||
"-t", | ||
self.DOCKER_IMAGE, | ||
".", | ||
|
@@ -129,18 +129,18 @@ def run(self): | |
|
||
|
||
class BuildEgg(BuildEggCommand): | ||
'''Custom egg build to ensure resources built. | ||
"""Custom egg build to ensure resources built. | ||
.. note:: | ||
Required because when this project is a dependency for another project, | ||
only bdist_egg will be called and *not* build. | ||
''' | ||
""" | ||
|
||
def run(self): | ||
'''Run egg build ensuring build_resources called first.''' | ||
self.run_command('build_ext') | ||
"""Run egg build ensuring build_resources called first.""" | ||
self.run_command("build_ext") | ||
BuildEggCommand.run(self) | ||
|
||
|
||
|
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,8 +1,8 @@ | ||
""" | ||
(c) Andriy Babak 2021 | ||
(c) Andriy Babak 2021-2024 | ||
date: 31/05/2021 | ||
modified: 20/04/2023 12:00:25 | ||
modified: 30/05/2024 10:40:19 | ||
Author: Andriy Babak | ||
e-mail: [email protected] | ||
|
@@ -19,11 +19,12 @@ | |
from ._version import __version__ | ||
from . import build | ||
|
||
__copyright__ = "(c) Andriy Babak 2021-2022" | ||
__copyright__ = "(c) Andriy Babak 2021-2024" | ||
|
||
lib_loader_name = "lib_loader" | ||
lib_suffix = "_python{major}{minor}".format( | ||
major=sys.version_info.major, minor=sys.version_info.minor, | ||
major=sys.version_info.major, | ||
minor=sys.version_info.minor, | ||
) | ||
lib_loader_path = "{folder}/{name}{suffix}.pyd".format( | ||
folder=os.path.dirname(__file__), name=lib_loader_name, suffix=lib_suffix | ||
|
Oops, something went wrong.