From: Stephen F. <st...@th...> - 2019-08-25 15:57:08
|
Does what it says in $SUBJECT and then some. Through a series of small, isolated patch, we update the code to replace deprecated constructs and moved libraries, adding wrappers where necessary to ensure we don't break Python 2.7 support. Once done, we switch from distutils to setuptools and remove the crutches we were using to translate the source code from Python 2 to Python 3 since they're no longer necessary. Along the way, we also do some other somewhat related stuff, including: - Drops obsolete code - Fixes 'tox' so it actually does something useful (on my machine, at least) - Adds a gitignore for git-svn users like me - Reverts a broken patch I tested all the 'py3:' patches by interactively rebasing the series (I'm using the git mirror) and using the below script to automatically test each patch before moving onto the next one. I'm sure something similar can be done with svn. #!/usr/bin/env bash echo "Starting test" function is_rebasing() { echo $PWD if [ -d ".git/rebase-merge" ] || [ -d ".git/rebase-apply" ]; then return 0 else return 1 fi } if ! is_rebasing; then echo "You need to start the rebase manually" exit 1 fi while is_rebasing; do tox -c docutils/tox.ini -e py27,py37 && echo "moving on..." || exit 1 git rebase --continue done echo "whoop!" Based on this, I think the resulting code and packages are functionally identical. Please let me know if any of these changes aren't sensible or if I've missed something. Stephen Finucane (39): trivial: Remove unused lxml import blocks trivial: Remove obsolete PyXML handling code Drop support for Python 3.3, 3.4 tox: Run 'python setup.py build,install' tox: Integrate 'style' check Add gitignore Revert "Apply [ 152 ] reset `default role` at end of document." py3: Use new style classes py3: Switch to print functions py3: Switch to 'except foo as bar' syntax py3: Add aliases for removed symbols py3: Resolve some additional undefined symbols py3: Replace deprecated form of raising exception py3: Replace 'ur' prefix py3: Replace 'foo.has_key(bar)' with 'bar in foo' py3: Replace 'sys.maxint' with 'sys.maxsize' py3: Replace 'types.ClassType' with type, 'types.SliceType' with slice py3: Use 'absolute_import' future py3: Use 'sorted(foo)' instead of 'foo.sort()' py3: Use 'isinstance(foo, bar)' instead of 'type(foo) is bar' py3: Consistent Python 3 checks py3: Replace 'foo.next()' with 'next(foo)' py3: Handle 'StringIO' to 'io' migration py3: Handle 'ConfigParser' to 'configparser' rename py3: Handle 'urllib', 'urllib2' to 'urlib.*' rename py3: Fix magic methods py3: Wrap 'foo.keys()', 'zip(foo, bar') in 'list' py3: Handle 'os.getcwdu' to 'os.getcwd' rename setup.py: Remove autoconversion code trivial: Remove duplicate definition of '__contains__' trivial: Misc whitespace fixes trivial: Set 'ListTable.check_list_content.num_cols' always trivial: Stop checking from 'roman' from PyPI trivial: Change ordering of optional imports trivial: Cleanup setup.py setup.py: Switch to setuptools setup.cfg: Mark wheels as universal tox: Remove distutils hacks trivial: Remove 'install.py' script docutils/.gitignore | 14 + docutils/HISTORY.txt | 6 +- docutils/MANIFEST.in | 6 + docutils/README.txt | 37 +- docutils/RELEASE-NOTES.txt | 9 +- docutils/docs/dev/distributing.txt | 2 +- docutils/docs/dev/release.txt | 6 +- docutils/docs/dev/testing.txt | 57 +- docutils/docs/dev/todo.txt | 9 - docutils/docs/dev/wheeling.txt | 204 --- docutils/docutils/__init__.py | 5 +- docutils/docutils/_compat.py | 24 - docutils/docutils/core.py | 45 +- docutils/docutils/frontend.py | 59 +- docutils/docutils/io.py | 36 +- docutils/docutils/languages/__init__.py | 2 +- docutils/docutils/nodes.py | 113 +- docutils/docutils/parsers/rst/__init__.py | 3 - .../parsers/rst/directives/__init__.py | 9 +- .../docutils/parsers/rst/directives/body.py | 5 +- .../docutils/parsers/rst/directives/html.py | 2 +- .../docutils/parsers/rst/directives/images.py | 11 +- .../docutils/parsers/rst/directives/misc.py | 29 +- .../docutils/parsers/rst/directives/tables.py | 27 +- .../parsers/rst/languages/__init__.py | 2 +- docutils/docutils/parsers/rst/roles.py | 9 +- docutils/docutils/parsers/rst/states.py | 30 +- docutils/docutils/parsers/rst/tableparser.py | 9 +- docutils/docutils/statemachine.py | 93 +- docutils/docutils/transforms/__init__.py | 5 +- docutils/docutils/transforms/frontmatter.py | 10 +- docutils/docutils/transforms/parts.py | 4 +- docutils/docutils/transforms/universal.py | 6 +- docutils/docutils/utils/__init__.py | 20 +- docutils/docutils/utils/code_analyzer.py | 4 +- docutils/docutils/utils/error_reporting.py | 16 +- docutils/docutils/utils/math/latex2mathml.py | 33 +- docutils/docutils/utils/math/math2html.py | 1465 +++++++++-------- .../docutils/utils/math/tex2mathml_extern.py | 13 +- docutils/docutils/utils/roman.py | 24 +- docutils/docutils/utils/smartquotes.py | 51 +- docutils/docutils/utils/urischemes.py | 6 +- docutils/docutils/writers/_html_base.py | 43 +- docutils/docutils/writers/docutils_xml.py | 25 +- .../writers/html5_polyglot/__init__.py | 2 +- docutils/docutils/writers/latex2e/__init__.py | 345 ++-- docutils/docutils/writers/manpage.py | 82 +- docutils/docutils/writers/odf_odt/__init__.py | 185 +-- docutils/docutils/writers/xetex/__init__.py | 4 +- docutils/install.py | 27 - docutils/setup.cfg | 5 +- docutils/setup.py | 309 ++-- docutils/test/DocutilsTestSupport.py | 69 +- docutils/test/alltests.py | 34 +- .../functional/tests/math_output_mathml.py | 2 +- docutils/test/local-writer.py | 9 +- docutils/test/package_unittest.py | 19 +- docutils/test/test__init__.py | 4 + docutils/test/test_command_line.py | 2 +- docutils/test/test_dependencies.py | 9 +- docutils/test/test_error_reporting.py | 39 +- docutils/test/test_functional.py | 15 +- docutils/test/test_io.py | 12 +- docutils/test/test_language.py | 19 +- docutils/test/test_nodes.py | 9 +- .../test_parsers/test_get_parser_class.py | 3 +- .../test_rst/test_SimpleTableParser.py | 3 +- .../test_parsers/test_rst/test_TableParser.py | 3 +- .../test_rst/test_block_quotes.py | 3 +- .../test_rst/test_bullet_lists.py | 3 +- .../test_character_level_inline_markup.py | 3 +- .../test_parsers/test_rst/test_citations.py | 3 +- .../test_parsers/test_rst/test_comments.py | 3 +- .../test_rst/test_definition_lists.py | 3 +- .../test_directives/test_admonitions.py | 3 +- .../test_directives/test_block_quotes.py | 3 +- .../test_rst/test_directives/test_class.py | 3 +- .../test_rst/test_directives/test_code.py | 17 +- .../test_directives/test_code_long.py | 10 +- .../test_directives/test_code_none.py | 7 +- .../test_rst/test_directives/test_compound.py | 3 +- .../test_directives/test_container.py | 3 +- .../test_rst/test_directives/test_contents.py | 3 +- .../test_rst/test_directives/test_date.py | 3 +- .../test_directives/test_decorations.py | 4 +- .../test_directives/test_default_role.py | 3 +- .../test_rst/test_directives/test_figures.py | 4 +- .../test_rst/test_directives/test_images.py | 4 +- .../test_rst/test_directives/test_include.py | 10 +- .../test_directives/test_line_blocks.py | 4 +- .../test_rst/test_directives/test_math.py | 4 +- .../test_rst/test_directives/test_meta.py | 4 +- .../test_directives/test_parsed_literals.py | 4 +- .../test_rst/test_directives/test_raw.py | 7 +- .../test_rst/test_directives/test_replace.py | 3 +- .../test_directives/test_replace_fr.py | 3 +- .../test_rst/test_directives/test_role.py | 3 +- .../test_rst/test_directives/test_rubrics.py | 3 +- .../test_rst/test_directives/test_sectnum.py | 4 +- .../test_rst/test_directives/test_sidebars.py | 4 +- .../test_rst/test_directives/test_tables.py | 28 +- .../test_directives/test_target_notes.py | 4 +- .../test_directives/test_test_directives.py | 4 +- .../test_rst/test_directives/test_title.py | 4 +- .../test_rst/test_directives/test_topics.py | 4 +- .../test_rst/test_directives/test_unicode.py | 9 +- .../test_rst/test_directives/test_unknown.py | 4 +- .../test_rst/test_doctest_blocks.py | 16 +- .../test_rst/test_east_asian_text.py | 9 +- .../test_rst/test_enumerated_lists.py | 4 +- .../test_parsers/test_rst/test_field_lists.py | 4 +- .../test_parsers/test_rst/test_footnotes.py | 4 +- .../test_rst/test_inline_markup.py | 4 +- .../test_parsers/test_rst/test_interpreted.py | 4 +- .../test_rst/test_interpreted_fr.py | 4 +- .../test_parsers/test_rst/test_line_blocks.py | 4 +- .../test_rst/test_literal_blocks.py | 4 +- .../test_rst/test_option_lists.py | 4 +- .../test_parsers/test_rst/test_outdenting.py | 4 +- .../test_parsers/test_rst/test_paragraphs.py | 4 +- .../test_rst/test_section_headers.py | 8 +- .../test_rst/test_substitutions.py | 4 +- .../test/test_parsers/test_rst/test_tables.py | 5 +- .../test_parsers/test_rst/test_targets.py | 4 +- .../test_parsers/test_rst/test_transitions.py | 4 +- docutils/test/test_publisher.py | 12 +- .../test_readers/test_get_reader_class.py | 5 +- .../test_pep/test_inline_markup.py | 3 +- .../test_readers/test_pep/test_rfc2822.py | 4 +- docutils/test/test_settings.py | 9 +- docutils/test/test_statemachine.py | 27 +- .../test/test_transforms/test___init__.py | 6 +- docutils/test/test_transforms/test_class.py | 3 +- .../test/test_transforms/test_contents.py | 3 +- docutils/test/test_transforms/test_docinfo.py | 3 +- .../test/test_transforms/test_doctitle.py | 4 +- .../test_transforms/test_expose_internals.py | 4 +- docutils/test/test_transforms/test_filter.py | 3 +- .../test/test_transforms/test_footnotes.py | 3 +- .../test/test_transforms/test_hyperlinks.py | 4 +- .../test/test_transforms/test_messages.py | 3 +- docutils/test/test_transforms/test_peps.py | 3 +- docutils/test/test_transforms/test_sectnum.py | 3 +- .../test/test_transforms/test_smartquotes.py | 13 +- .../test_transforms/test_strip_comments.py | 3 +- .../test_strip_elements_with_class.py | 5 +- .../test_transforms/test_substitutions.py | 3 +- .../test/test_transforms/test_target_notes.py | 3 +- .../test/test_transforms/test_transitions.py | 4 +- .../test/test_transforms/test_writer_aux.py | 3 +- docutils/test/test_utils.py | 12 +- docutils/test/test_viewlist.py | 14 - .../test/test_writers/test_docutils_xml.py | 10 +- .../test_writers/test_get_writer_class.py | 4 +- .../test/test_writers/test_html4css1_misc.py | 7 +- .../test/test_writers/test_html4css1_parts.py | 4 +- .../test_writers/test_html4css1_template.py | 3 +- .../test_writers/test_html5_polyglot_misc.py | 7 +- .../test_writers/test_html5_polyglot_parts.py | 3 +- docutils/test/test_writers/test_latex2e.py | 5 +- docutils/test/test_writers/test_manpage.py | 4 +- docutils/test/test_writers/test_null.py | 4 +- docutils/test/test_writers/test_odt.py | 47 +- docutils/test/test_writers/test_pseudoxml.py | 4 +- docutils/test/test_writers/test_s5.py | 3 +- docutils/tools/buildhtml.py | 6 +- docutils/tools/dev/create_unimap.py | 15 +- .../tools/dev/generate_punctuation_chars.py | 72 +- docutils/tools/dev/profile_docutils.py | 1 + docutils/tools/dev/unicode2rstsubs.py | 11 +- docutils/tools/quicktest.py | 1 + docutils/tools/rst2odt_prepstyles.py | 28 +- docutils/tools/test/test_buildhtml.py | 2 +- docutils/tox.ini | 101 +- 174 files changed, 2224 insertions(+), 2370 deletions(-) create mode 100644 docutils/.gitignore delete mode 100644 docutils/docs/dev/wheeling.txt delete mode 100644 docutils/docutils/_compat.py delete mode 100755 docutils/install.py -- 2.21.0 |