Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deal with loss of whitespace in Python 3.13. #254

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading