@@ -19,7 +19,6 @@ plugins {
1919 id ' signing'
2020 alias(libs. plugins. checksum)
2121 alias(libs. plugins. cmake)
22- alias(libs. plugins. dockerRemoteApi)
2322}
2423
2524import dev.welbyseely.CMakeBuildTask
@@ -28,11 +27,6 @@ import groovy.json.JsonOutput
2827import groovy.json.JsonSlurper
2928import org.apache.tools.ant.taskdefs.condition.Os
3029import org.gradle.crypto.checksum.Checksum
31- import com.bmuschko.gradle.docker.tasks.container.DockerStartContainer
32- import com.bmuschko.gradle.docker.tasks.container.DockerStopContainer
33- import com.bmuschko.gradle.docker.tasks.container.DockerCreateContainer
34- import com.bmuschko.gradle.docker.tasks.container.DockerExecContainer
35- import com.bmuschko.gradle.docker.tasks.image.DockerBuildImage
3630
3731configurations {
3832 cppClient
@@ -42,9 +36,6 @@ configurations {
4236 platformsHeaders
4337}
4438
45- def manylinuxWheelsContainerName = " ignite_manylinux_wheels"
46- def manylinuxWheelsImageName = " ignite_manylinux_python_wheels_build"
47-
4839dependencies {
4940 platformsHeaders project(path : ' :ignite-api' , configuration : ' platformsHeaders' )
5041}
@@ -267,6 +258,29 @@ private String simpleProjectVersion(String version) {
267258 return version
268259}
269260
261+ /**
262+ * Converts the version to the python version format.
263+ * See https://packaging.python.org/en/latest/discussions/versioning/
264+ */
265+ private String pythonProjectVersion (String version ) {
266+ def (simple, addition) = version. tokenize(' -' )
267+ if (addition == null ) {
268+ return simple
269+ }
270+
271+ def pythonAddition = addition
272+ .toLowerCase()
273+ .replace(" alpha" , " a" )
274+ .replace(" beta" , " b" )
275+ .replace(" patch" , " post" )
276+ .replace(" snapshot" , " dev" )
277+
278+ if (pythonAddition. matches(" (a|b|rc)\\ d+" )) {
279+ return simple + pythonAddition
280+ }
281+ return simple + ' .' + pythonAddition
282+ }
283+
270284private void updateDotnetVersion (String version ) {
271285 def versionFile = file(" $projectDir /dotnet/version.json" )
272286 def json = new JsonSlurper (). parseText(versionFile. text)
@@ -277,73 +291,5 @@ private void updateDotnetVersion(String version) {
277291
278292private void updatePythonVersion (String version ) {
279293 def versionFile = file(" $projectDir /python/pyignite_dbapi/_version.txt" )
280- versionFile. text = simpleProjectVersion(version)
281- }
282-
283- def buildWindowsDbApiWheels = tasks. register(' buildWindowsDbApiWheels' , Exec ) {
284- workingDir " $projectDir /python"
285-
286- commandLine " cmd" , " /c" , " Powershell -File .\\ scripts\\ BuildWheels.ps1 -PyVers \" $dbapiPythonVersions \" "
287- }
288-
289- private void handleError (Throwable exc ) {
290- if (exc == null )
291- return ;
292- String strErr = exc. toString()
293- project. logger. info(" >>>>>>>>> Error: " + strErr)
294- if (! strErr. contains(' NotModifiedException' ) &&
295- ! strErr. contains(' No such container' )) {
296- project. logger. info(" >>>>>>>>> Re-throwing error" )
297- throw new RuntimeException (exc)
298- }
294+ versionFile. text = pythonProjectVersion(version)
299295}
300-
301- def buildManyLinuxWheelsDockerImage = tasks. register(' buildManyLinuxWheelsDockerImage' , DockerBuildImage ) {
302- inputDir = file(" $projectDir /python/scripts" )
303- images = [" $manylinuxWheelsImageName " ]
304- }
305-
306- def createManyLinuxWheelsContainer = tasks. register(' createManyLinuxWheelsContainer' , DockerCreateContainer ) {
307- dependsOn buildManyLinuxWheelsDockerImage
308- targetImageId " $manylinuxWheelsImageName "
309- containerName = " $manylinuxWheelsContainerName "
310- withEnvVar(" PLAT" , " manylinux2014_x86_64" )
311- hostConfig. autoRemove = true
312- hostConfig. binds = [
313- " $projectDir /python" :" /pyignite_dbapi" ,
314- " $projectDir /cpp" :" /cpp" ,
315- " $projectDir /python/distr" :" /dist"
316- ]
317- tty = true
318- }
319-
320- def startManyLinuxWheelsContainer = tasks. register(' startManyLinuxWheelsContainer' , DockerStartContainer ) {
321- dependsOn createManyLinuxWheelsContainer
322- targetContainerId(" $manylinuxWheelsContainerName " )
323- onError { exception -> handleError(exception) }
324- }
325-
326- def stopManyLinuxWheelsContainer = tasks. register(' stopManyLinuxWheelsContainer' , DockerStopContainer ) {
327- targetContainerId(" $manylinuxWheelsContainerName " )
328- onError { exception -> handleError(exception) }
329- }
330-
331- def buildLinuxDbApiWheels = tasks. register(' buildLinuxDbApiWheels' , DockerExecContainer ) {
332- dependsOn startManyLinuxWheelsContainer
333- targetContainerId(" $manylinuxWheelsContainerName " )
334- commands. add([" /pyignite_dbapi/scripts/build_wheels.sh" , " $dbapiPythonVersions " ] as String [])
335- onError { exception -> handleError(exception) }
336- }
337-
338- def buildDbApiSourceDist = tasks. register(' buildDbApiSourceDist' , DockerExecContainer ) {
339- dependsOn startManyLinuxWheelsContainer
340- targetContainerId(" $manylinuxWheelsContainerName " )
341- commands. add([" /pyignite_dbapi/scripts/create_sdist.sh" , " $dbapiPythonVersions " ] as String [])
342- onError { exception -> handleError(exception) }
343- }
344-
345- def buildLinuxDbApi = tasks. register(' buildLinuxDbApi' , Task ) {
346- dependsOn buildDbApiSourceDist, buildLinuxDbApiWheels
347- finalizedBy stopManyLinuxWheelsContainer
348- }
349-
0 commit comments