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

MAINT: adding python3.13 to CI and fix any incompatibilities #260

Merged
merged 3 commits into from
Aug 28, 2024

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Aug 27, 2024

I see test failures locally, but there is also a puzzling one for older pythons that I see in my dev environment, but not when I run the tests from tox, so ultimately we may run into some new cross incompatibility with some other plugin.

(This will need a changelog once some actual code changes are needed for incompatibility fixes, but not until all the diff stays within the territory of the tests)

@bsipocz bsipocz added this to the 1.3.0 milestone Aug 27, 2024
@bsipocz
Copy link
Member Author

bsipocz commented Aug 27, 2024

The only test failures are coming from the diff generation; however, I also see some whitespace issues in astroquery that may be doctestplus related:
astropy/astroquery#3088

@pllim
Copy link
Contributor

pllim commented Aug 27, 2024

Astroquery failure is unrelated to doctestplus, I commented on the Astroquery PR.

Should we ping seberg about the diff generation?

Thanks!

@bsipocz
Copy link
Member Author

bsipocz commented Aug 27, 2024

Yeap, @seberg, would you mind having a look?

@bsipocz
Copy link
Member Author

bsipocz commented Aug 27, 2024

I suspect the failures will be due to the whitespace thing we run into with astroquery, too. First item under this ancor:
https://docs.python.org/3.13/whatsnew/3.13.html#other-language-changes

@seberg
Copy link
Contributor

seberg commented Aug 27, 2024

Hmmm, I suppose we have to read the actual indentation from the file then? Maybe something like:

diff --git a/pytest_doctestplus/plugin.py b/pytest_doctestplus/plugin.py
index f9c3a0c..5538c53 100644
--- a/pytest_doctestplus/plugin.py
+++ b/pytest_doctestplus/plugin.py
@@ -900,7 +900,8 @@ def write_modified_file(fname, new_fname, changes):
         lineno = change["test_lineno"] + change["example_lineno"]
         lineno += change["source"].count("\n")
 
-        indentation = " " * change["nindent"]
+        indentation = len(text[lineno-1]) - len(text[lineno-1].lstrip())
+        indentation = text[lineno-1][:indentation]
         want = indent(change["want"], indentation, lambda x: True)
         # Replace fully blank lines with the required `<BLANKLINE>`
         # (May need to do this also if line contains only whitespace)

EDIT: Sorry, first diff had a bug, this one should work.

@bsipocz
Copy link
Member Author

bsipocz commented Aug 28, 2024

Thank you @seberg, it works like a dream.

Copy link
Contributor

@pllim pllim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Thanks, all! I'll let you merge. :)

@bsipocz bsipocz merged commit 59f40a6 into scientific-python:main Aug 28, 2024
22 checks passed
@bsipocz bsipocz deleted the MAINT_py313 branch August 28, 2024 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants