Skip to content

Commit d83a1ab

Browse files
2024.2 release code drop
2024.2 release code drop
1 parent bf7146a commit d83a1ab

File tree

9 files changed

+125
-34
lines changed

9 files changed

+125
-34
lines changed

P4.py

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
This uses the Python type P4API.P4Adapter, which is a wrapper for the
88
Perforce ClientApi object.
99
10-
$Id: //depot/main/p4-python/P4.py#112 $
10+
$Id: //depot/main/p4-python/P4.py#114 $
1111
1212
#*******************************************************************************
1313
# Copyright (c) 2007-2010, Perforce Software, Inc. All rights reserved.
@@ -59,24 +59,34 @@ class P4Exception(Exception):
5959
def __init__(self, value):
6060
super().__init__(value)
6161
if isinstance(value, (list, tuple)) and len(value) > 2:
62+
self.value = value[0]
63+
self.warnings = value[2]
6264
if len(value[1]) > 0 or len(value[2]) > 0:
63-
self.value = value[0]
6465
self.errors = value[1]
65-
self.warnings = value[2]
6666
else:
67-
self.value = value[0]
6867
self.errors = [re.sub(r'\[.*?\] ', '', str(self.value).split("\n")[0])]
69-
self.warnings = value[2]
7068
else:
7169
self.value = value
70+
self.errors =self.warnings = None
7271

7372
def __str__(self):
7473
if self.errors:
75-
return str(self.errors[0])
74+
if isinstance(self.errors, (list, tuple)):
75+
return str(self.errors[0])
76+
else:
77+
return str(self.errors)
7678
elif self.warnings:
77-
return str(self.warnings[0])
79+
if isinstance(self.warnings, (list, tuple)):
80+
return str(self.warnings[0])
81+
else:
82+
return str(self.warnings)
83+
elif self.errors is None and self.warnings is None:
84+
return str(self.value)
7885
else:
79-
return re.sub(r'\[.*?\] ', '', str(self.value).split("\n")[0])
86+
if isinstance(self.value, (list, tuple)):
87+
return re.sub(r'\[.*?\] ', '', str(self.value).split("\n")[0])
88+
else:
89+
return str(self.value)
8090

8191
def __repr__(self):
8292
return f"{self.__class__.__name__}({str(self)!r})"
@@ -615,7 +625,7 @@ def run(self, *args, **kargs):
615625
flatArgs = self.__flatten(args)
616626

617627
if self.logger:
618-
self.logger.info("p4 " + " ".join(flatArgs))
628+
self.logger.info("p4 " + " ".join(str(x) for x in flatArgs))
619629

620630
# if encoding is set, translate to Bytes
621631
if hasattr(self,"encoding") and self.encoding and not self.encoding == 'raw':

PythonClientAPI.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2525
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2626
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727
28-
$Id: //depot/main/p4-python/PythonClientAPI.cpp#79 $
28+
$Id: //depot/main/p4-python/PythonClientAPI.cpp#80 $
2929
*******************************************************************************/
3030

3131
#include <Python.h>
@@ -75,6 +75,8 @@ PythonClientAPI::PythonClientAPI()
7575
maxResults = 0;
7676
maxScanRows = 0;
7777
maxLockTime = 0;
78+
maxOpenFiles = 0;
79+
maxMemory = 0;
7880
prog = "unnamed p4-python script";
7981
apiLevel = atoi( P4Tag::l_client );
8082
enviro = new Enviro;
@@ -157,6 +159,8 @@ PythonClientAPI::intattribute_t PythonClientAPI::intattributes[] = {
157159
{ "maxresults", &PythonClientAPI::SetMaxResults, &PythonClientAPI::GetMaxResults },
158160
{ "maxscanrows", &PythonClientAPI::SetMaxScanRows, &PythonClientAPI::GetMaxScanRows },
159161
{ "maxlocktime", &PythonClientAPI::SetMaxLockTime, &PythonClientAPI::GetMaxLockTime },
162+
{ "maxopenfiles", &PythonClientAPI::SetMaxOpenFiles, &PythonClientAPI::GetMaxOpenFiles },
163+
{ "maxmemory", &PythonClientAPI::SetMaxMemory, &PythonClientAPI::GetMaxMemory },
160164
{ "exception_level", &PythonClientAPI::SetExceptionLevel, &PythonClientAPI::GetExceptionLevel },
161165
{ "debug", &PythonClientAPI::SetDebug, &PythonClientAPI::GetDebug },
162166
{ "track", &PythonClientAPI::SetTrack, &PythonClientAPI::GetTrack },
@@ -1234,6 +1238,8 @@ void PythonClientAPI::RunCmd(const char *cmd, ClientUser *ui, int argc, char * c
12341238
if( maxResults ) client.SetVar( "maxResults", maxResults );
12351239
if( maxScanRows ) client.SetVar( "maxScanRows", maxScanRows );
12361240
if( maxLockTime ) client.SetVar( "maxLockTime", maxLockTime );
1241+
if( maxOpenFiles ) client.SetVar( "maxOpenFiles", maxOpenFiles );
1242+
if( maxMemory) client.SetVar( "maxMemory", maxMemory );
12371243

12381244
// if progress is set, set the progress var
12391245
if( ((PythonClientUser*)ui)->GetProgress() != Py_None )

PythonClientAPI.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2727
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2828
*
29-
* $Id: //depot/main/p4-python/PythonClientAPI.h#44 $
29+
* $Id: //depot/main/p4-python/PythonClientAPI.h#45 $
3030
*
3131
* Build instructions:
3232
* Use Distutils - see accompanying setup.py
@@ -103,6 +103,8 @@ class PythonClientAPI
103103
int SetMaxResults( int v ) { maxResults = v; return 0; }
104104
int SetMaxScanRows( int v ) { maxScanRows = v; return 0; }
105105
int SetMaxLockTime( int v ) { maxLockTime = v; return 0; }
106+
int SetMaxOpenFiles( int v ) { maxOpenFiles = v; return 0; }
107+
int SetMaxMemory( int v ) { maxMemory = v; return 0; }
106108

107109
int SetCaseFolding( int v ) { StrPtr::SetCaseFolding((StrPtr::CaseUse) v); return 0;}
108110

@@ -154,6 +156,8 @@ class PythonClientAPI
154156
int GetMaxResults() { return maxResults; }
155157
int GetMaxScanRows() { return maxScanRows; }
156158
int GetMaxLockTime() { return maxLockTime; }
159+
int GetMaxOpenFiles() { return maxOpenFiles; }
160+
int GetMaxMemory() { return maxMemory; }
157161
int GetDebug() { return debug.getDebug(); }
158162
int GetApiLevel() { return apiLevel; }
159163
int GetCaseFolding() { return (int) StrPtr::CaseUsage(); }
@@ -329,6 +333,8 @@ class PythonClientAPI
329333
int maxResults;
330334
int maxScanRows;
331335
int maxLockTime;
336+
int maxOpenFiles;
337+
int maxMemory;
332338
};
333339

334340
#endif

RELNOTES.txt

Lines changed: 61 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Release Notes for
22
P4Python, Helix Core API for Python
33

4-
Version 2024.1
4+
Version 2024.2
55

66
Introduction
77

@@ -23,6 +23,14 @@ Introduction
2323

2424
--------------------------------------------------------------------------
2525

26+
Important End-of-Life Notice
27+
28+
This major release of P4Python would be the last to provide wheels for and
29+
test against Python 3.8. This is part of our commitment to focus on
30+
supported technology platforms
31+
32+
--------------------------------------------------------------------------
33+
2634
Installation
2735

2836
Installation via pip
@@ -40,7 +48,7 @@ Installation
4048
python3 -m pip install --upgrade p4python
4149

4250
P4Python is distributed as a binary wheels for Python 3.8, 3.9, 3.10,
43-
3.11 and 3.12. In order for the binary wheel to be used, the ABI tag needs to
51+
3.11, 3.12 and 3.13. In order for the binary wheel to be used, the ABI tag needs to
4452
match.This often requires updated pip, to do so issue:
4553
python3 -m pip install --upgrade pip
4654

@@ -64,6 +72,9 @@ Installation
6472

6573
Ubuntu 22.04
6674
perforce-p4python3-python3.10
75+
76+
Ubuntu 24.04
77+
perforce-p4python3-python3.12
6778

6879
Installing P4Python for Maya.
6980

@@ -106,13 +117,13 @@ Compatibility Statements
106117

107118
API Compatibility
108119

109-
This release of P4Python requires at least 2024.1 Perforce API
110-
(2024.1/2596294). Older releases will not compile and are not supported.
120+
This release of P4Python requires at least 2024.2 Perforce API
121+
(2024.2/2675662). Older releases will not compile and are not supported.
111122

112123
Python Compatibility
113124

114125
This release of P4Python is supported building from source with
115-
Python 3.8, 3.9, 3.10, 3.11 and 3.12.
126+
Python 3.8, 3.9, 3.10, 3.11, 3.12 and 3.13.
116127

117128
For detailed compatibility, please check the following table:
118129

@@ -123,6 +134,7 @@ Compatibility Statements
123134
3.10 | 2022.1 or later
124135
3.11 | 2022.2 or later
125136
3.12 | 2023.1 or later
137+
3.13 | 2024.2 or later
126138

127139
OpenSSL Compatibility
128140

@@ -138,15 +150,19 @@ Compatibility Statements
138150

139151
This release is certified on the following platforms:
140152

141-
Windows (x86, x86_64)
142-
Server 2016
153+
Windows for Intel(x86, x86_64)
154+
Server 2016, 2019, 2022
155+
Windows 10, 11
143156
Mac OS
144157
11, 12 (x86_64)
145158
12, 13 (ARM64)
146-
Linux (x86, x86_64)
147-
Ubuntu 20.04, 22.04
159+
Linux kernel 2.6+ for Intel(x86, x86_64)
160+
Ubuntu 20.04, 22.04, 24.04
148161
CentOS 8
149162
Rocky Linux 9.1
163+
Linux kernel 2.6+ for ARM(aarch64)
164+
Ubuntu 20.04, 22.04, 24.04
165+
Rocky Linux 9.4
150166

151167
The above platforms are tested and subject to regression testing on a
152168
frequent basis. Errors or bugs discovered in these platforms are prioritized
@@ -286,6 +302,42 @@ Key to symbols used in change notes below.
286302

287303
--------------------------------------------------------------------------
288304

305+
New functionalities in 2024.2 (2024.2/2682690) (2024/11/15)
306+
307+
#2677188 (Job #122598)
308+
Built P4Python with P4API 2024.2 (2024.2/2675662)
309+
310+
#2670765 (Job #122603)
311+
Added wheels & build support for Python 3.13
312+
313+
#2659612 (Job #122764)
314+
Added Linux binary package for Ubuntu24
315+
316+
Bugs fixed in 2024.2 (2024.2/2682690) (2024/11/15)
317+
318+
#2669917 (Job #123092)
319+
Fixed exception on joining non-string element in run args,
320+
when logger is enabled.
321+
322+
--------------------------------------------------------------------------
323+
324+
New functionalities in 2024.1 Patch 1 (2024.1/2645203) (2024/08/27)
325+
326+
#2643104 (Job #119627)
327+
Added wheels & build support for Linux ARM64/AARCH64 architecture.
328+
329+
Bugs fixed in 2024.1 Patch 1 (2024.1/2645203) (2024/08/27)
330+
331+
#2630486 (Job #121699)
332+
Fixed error in P4.P4Exception class when creating object of class
333+
with single string parameter.
334+
335+
#2630485 (Job #121721)
336+
Implemented p4.maxopenfiles and p4.maxmemory group specs as P4 Class
337+
instance attributes.
338+
339+
--------------------------------------------------------------------------
340+
289341
New functionalities in 2024.1 (2024.1/2625398) (2024/07/17)
290342

291343
#2603816 (Job #120930)

SpecMgr.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
2424
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2525
26-
$Id: //depot/main/p4-python/SpecMgr.cpp#57 $
26+
$Id: //depot/main/p4-python/SpecMgr.cpp#58 $
2727
*******************************************************************************/
2828

2929
/*******************************************************************************
@@ -60,7 +60,7 @@ struct specdata {
6060
const char *type;
6161
const char *spec;
6262
} speclist[] = {
63-
63+
6464
{
6565
"branch",
6666
"Branch;code:301;rq;ro;fmt:L;len:32;;"
@@ -149,6 +149,10 @@ struct specdata {
149149
"Owners;code:408;type:wlist;len:32;opt:default;;"
150150
"Users;code:405;type:wlist;len:32;opt:default;;"
151151
},
152+
{
153+
"hotfiles",
154+
"HotFiles;code:1051;fmt:C;type:wlist;words:1;maxwords:3;len:64;opt:default;z;;"
155+
},
152156
{
153157
"job",
154158
"Job;code:101;rq;len:32;;"

Version

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
# SUPPDATE = 2010 06 17 ;
1212
# Of the build. The copyright date is derived from SUPPDATE.
1313

14-
RELEASE = 2024 1;
15-
PATCHLEVEL = 2603570 ;
16-
SUPPDATE = 2024 05 29 ;
14+
RELEASE = 2024 2;
15+
PATCHLEVEL = 2676807 ;
16+
SUPPDATE = 2024 11 07 ;
1717

linux_build/build-wheels.sh

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
#!/bin/bash
22
set -eEx
3+
ARCH=$(arch)
34

4-
export PATH=$PATH:/work/p4-bin/bin.linux26x86_64/
5+
export PATH=$PATH:/work/p4-bin/bin.linux26${ARCH}/
56

67
# Extract the p4api and set the P4API path var
78
mkdir -p /work/p4-api
8-
tar xvfz /work/p4-bin/bin.linux26x86_64/p4api-glibc2.12-openssl3.tgz -C /work/p4-api
9+
# Check the condition
10+
if [ "$ARCH" = x86_64 ]; then
11+
tar xvfz /work/p4-bin/bin.linux26${ARCH}/p4api-glibc2.12-openssl3.tgz -C /work/p4-api
12+
else
13+
tar xvfz /work/p4-bin/bin.linux26${ARCH}/p4api-openssl3.tgz -C /work/p4-api
14+
fi
15+
916
P4API=`echo /work/p4-api/p4api-20*`
1017

1118
cd /work/p4-python
@@ -17,7 +24,7 @@ mkdir -p repair
1724

1825
# Compile wheels
1926
for VERSION in $1; do
20-
PYBIN="/opt/python/$(ls /opt/python/ | grep cp$VERSION | grep -v 27mu)/bin"
27+
PYBIN="/opt/python/$(ls /opt/python/ | grep -E "cp$VERSION-cp$VERSION$")/bin"
2128

2229
## Set env path for apidir and ssl directories
2330
export apidir=$P4API
@@ -38,14 +45,14 @@ for VERSION in $1; do
3845
## Test the build
3946
"${PYBIN}/python" p4test.py
4047

41-
## Repair wheel with new ABI tag manylinux_2_28_x86_64
42-
#auditwheel repair dist/p4python-*-linux_x86_64.whl --plat manylinux_2_28_x86_64 -w repair
48+
## Repair wheel with new ABI tag manylinux_2_28_${ARCH}
49+
#auditwheel repair dist/p4python-*-linux_${ARCH}.whl --plat manylinux_2_28_${ARCH} -w repair
4350

44-
#Changing wheel platform ABI tag to manylinux_2_28_x86_64
45-
"${PYBIN}/python" -m wheel tags --platform-tag=manylinux_2_28_x86_64 dist/p4python-*-linux_x86_64.whl
51+
#Changing wheel platform ABI tag to manylinux_2_28_${ARCH}
52+
"${PYBIN}/python" -m wheel tags --platform-tag=manylinux_2_28_${ARCH} dist/p4python-*-linux_${ARCH}.whl
4653

4754
#Move wheel to repair directory
48-
mv dist/p4python-*-manylinux_2_28_x86_64.whl repair
55+
mv dist/p4python-*-manylinux_2_28_${ARCH}.whl repair
4956

5057
rm -rf build p4python.egg-info dist
5158
done

p4test.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ def testEnvironment(self):
112112
self.p4.maxresults = 100000
113113
self.p4.maxscanrows = 1000000
114114
self.p4.maxlocktime = 10000
115+
self.p4.maxopenfiles = 1000
116+
self.p4.maxmemory = 2000
115117
self.p4.password = "mypassword"
116118
self.p4.port = "myserver:1666"
117119
self.p4.prog = "myprogram"
@@ -126,6 +128,8 @@ def testEnvironment(self):
126128
self.assertEqual( self.p4.maxresults, 100000, "maxresults" )
127129
self.assertEqual( self.p4.maxscanrows, 1000000, "maxscanrows" )
128130
self.assertEqual( self.p4.maxlocktime, 10000, "maxlocktime" )
131+
self.assertEqual( self.p4.maxopenfiles, 1000, "maxopenfiles" )
132+
self.assertEqual( self.p4.maxmemory, 2000, "maxmemory" )
129133
self.assertEqual( self.p4.password, "mypassword", "password" )
130134
self.assertEqual( self.p4.port, "myserver:1666", "port" )
131135
self.assertEqual( self.p4.tagged, 1, "tagged" )

tools/PlatformInfo.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ def __init__(self, api_version, release_version, ssl, ssl_ver):
108108
if unameOut.machine == 'arm64':
109109
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "12.6"
110110
else:
111-
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.12"
111+
os.environ["MACOSX_DEPLOYMENT_TARGET"] = "10.15"
112112

113113
arch = self.architecture(unameOut[4])
114114

@@ -180,6 +180,8 @@ def architecture(self, str):
180180
return 'X86_64'
181181
elif str == 'sparc':
182182
return 'SPARC'
183+
elif str == 'aarch64':
184+
return 'ARM'
183185
elif re.match('arm.*', str):
184186
return "ARM"
185187

0 commit comments

Comments
 (0)