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

repair workflow and make Python code compliant with py3 #951

Merged
merged 5 commits into from
Dec 13, 2021

Conversation

prjemian
Copy link
Contributor

@prjemian prjemian commented Dec 9, 2021

@prjemian
Copy link
Contributor Author

prjemian commented Dec 9, 2021

Now, with #946 and #950 repaired, the workflow log shows there is an indentation error in the 51 use XML entitynxdl.xsd file.

IndentationError: Something wrong with indentation on this line:
			</xs:documentation>

The code is now having troubles resolving and removing the indentation of the embedded rst documentation. Time to refactor to textwrap.dedent() from the Python standard library.

@prjemian
Copy link
Contributor Author

prjemian commented Dec 9, 2021

Also, this code lxml.etree.tostring(docnodes[0], pretty_print=True) now returns the formatted text starting from docnodes[0] to the end of the nxdl.xsd file! That needs a fix (add method="text" kwarg) described in the lxml tutorial.

@prjemian prjemian marked this pull request as ready for review December 10, 2021 16:41
@prjemian
Copy link
Contributor Author

@PeterC-DLS : please review

The workflow is now successful, after fixing the environment file and replacing our/my complicated (and failing) Python code that removes common indentation with similar capability from the Python standard library package textwrap.

@zjttoefs : please review
To make this workflow successful, it was necessary to resolve #946 as part of this PR. But that issue is not completely resolved since it is not possible (as demonstrated) to add a CI workflow to test with py2.7. So, I proposed in #952 to stop trying to support Py2.7 (actually, all Python versions <3.7).

Copy link
Contributor

@zjttoefs zjttoefs left a comment

Choose a reason for hiding this comment

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

Looks good. Tried it locally and it was able to generate everything using python 3.9. Dropping support for 2.x Python makes sense.

@prjemian prjemian merged commit 40bd567 into main Dec 13, 2021
@prjemian
Copy link
Contributor Author

@PeterC-DLS @zjttoefs : Thanks for the quick response!

@prjemian prjemian deleted the 950-repair-workflow branch December 13, 2021 14:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

The workflow is failing, even when restarted. documentation build requires python2
3 participants