Opened 13 years ago
Closed 10 years ago
#24 closed enhancement (fixed)
pbs_python and python3 support.
Reported by: | steve.traylen@… | Owned by: | bas |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | pbs | Version: | 4.3.0 |
Keywords: | python3 | Cc: |
Description
Hi,
As part of adding to Fedora:
https://bugzilla.redhat.com/show_bug.cgi?id=631964
I will build a python3 variant if its possible but alas there looks to be problems.
Steps to reproduce working on Fedora13 box.
tar zxvf pbs_python-4.3.0.tar.gz
cd pbs_python-4.3.0
2to3 --write --nobackups .
./configure --with-python=python3 checking for pbs-config... /usr/bin/pbs-config Found torque version: 2.1.8 checking for python... /usr/bin/python checking for python version... 2.6 checking for python platform... linux2 checking for python script directory... ${prefix}/lib/python2.6/site-packages checking for python extension module directory... ${exec_prefix}/lib64/python2.6/site-packages configure: creating ./config.status config.status: creating Makefile config.status: creating setup.py
# Note the 2.6 above
2to3 --write --nobackups setup.py
$ python3 setup.py build Please specify where the PBS libraries are!! edit setup.py and fill in the PBS_LIB_DIR variable
This I understand and is caused by old pbs-config present on Fedora 13 so you can ignore this one, I've fixed this past Fedora 13.
But still build fails.
See attachment.
Attachments (2)
Change History (11)
Changed 13 years ago by steve.traylen@…
comment:1 Changed 13 years ago by bas
- Owner changed from somebody to bas
- Status changed from new to assigned
the C source is generated by swig. I will find out if swig has support for python 3
comment:2 Changed 13 years ago by bas
Can to test the trunk version? There are some changes for python 3 support
comment:3 Changed 13 years ago by anonymous
Hi, Thanks for the quick fix..
It all builds fine now which is great.
A few of the example files fail to convert to 3.
examples/new_rack_pbsmon.py examples/pbsmon.py examples/rack_pbsmon.py examples/sara_nodes.py
If I remove them for the python3 build in advance then this builds cleanly.
$ 2to3 --write --nobackups examples/new_rack_pbsmon.py examples/pbsmon.py examples/rack_pbsmon.py examples/sara_nodes.py RefactoringTool: Skipping implicit fixer: buffer RefactoringTool: Skipping implicit fixer: idioms RefactoringTool: Skipping implicit fixer: set_literal RefactoringTool: Skipping implicit fixer: ws_comma RefactoringTool: Can't parse examples/new_rack_pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (267, 19)) RefactoringTool: Can't parse examples/pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (65, 18)) RefactoringTool: Can't parse examples/rack_pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (88, 16)) RefactoringTool: Can't parse examples/sara_nodes.py: ParseError: bad input: type=22, value='=', context=('', (534, 58)) RefactoringTool: No files need to be modified. RefactoringTool: There were 4 errors: RefactoringTool: Can't parse examples/new_rack_pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (267, 19)) RefactoringTool: Can't parse examples/pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (65, 18)) RefactoringTool: Can't parse examples/rack_pbsmon.py: ParseError: bad input: type=22, value='=', context=('', (88, 16)) RefactoringTool: Can't parse examples/sara_nodes.py: ParseError: bad input: type=22, value='=', context=('', (534, 58))
comment:4 Changed 13 years ago by bas
This scripts must be ported to 2.6/3.0 syntax. This will be planned in a feature release. Thanks for reporting
Changed 12 years ago by steve.traylen@…
comment:5 Changed 12 years ago by steve.traylen@…
Hi,
Sorry I completely missed the comments above.
Working with 4.3.3 looks to result in at some point I think during byte compilation
Sorry: TabError?: inconsistent use of tabs and spaces in indentation (PBSQuery.py, line 512) Sorry: TabError?: inconsistent use of tabs and spaces in indentation (pbs.py, line 743)
The attached patch pbs_python-4.3.3-space-tab.patch swaps some white space for some different white space and seems to do the job.
I guess python3 is fussier somewhere.
comment:6 Changed 12 years ago by bas
comment:7 Changed 12 years ago by bas
comment:8 Changed 12 years ago by bas
Steve,
Can you test this new trunk version?
regards
comment:9 Changed 10 years ago by bas
- Resolution set to fixed
- Status changed from assigned to closed
Will close ticket
Build of pbs_python with python3.