Skip to content

Commit

Permalink
Merge pull request #254 from moorepants/py313
Browse files Browse the repository at this point in the history
Deal with loss of whitespace in Python 3.13.
  • Loading branch information
moorepants authored Oct 17, 2024
2 parents f57209e + da57ccd commit acf2ac7
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
# macos-13 is the last intel based runner
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
defaults:
run:
shell: bash -el {0}
Expand Down
1 change: 1 addition & 0 deletions opty-dev-env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ dependencies:
- numpydoc
- pytest
- pytest-cov
- python
- scipy >=1.5.0
- sphinx
- sphinx-gallery
Expand Down
9 changes: 7 additions & 2 deletions opty/direct_collocation.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#!/usr/bin/env python
#

import sys
from functools import wraps
import logging

Expand Down Expand Up @@ -77,7 +78,11 @@ def use_parent_doc(self, func, source):
@staticmethod
def _combine_docs(prob_doc, coll_doc):
beg, end = prob_doc.split('bounds')
_, middle = coll_doc.split('Parameters\n ==========\n ')
if sys.version_info[1] >= 13:
sep = 'Parameters\n==========\n'
else:
sep = 'Parameters\n ==========\n '
_, middle = coll_doc.split(sep)
return beg + middle[:-9] + ' bounds' + end

_doc_inherit = _DocInherit
Expand Down

0 comments on commit acf2ac7

Please sign in to comment.