diff -Nru rnc2rng-2.6.4/.coveragerc rnc2rng-2.6.6/.coveragerc --- rnc2rng-2.6.4/.coveragerc 2016-02-03 20:34:43.000000000 +0000 +++ rnc2rng-2.6.6/.coveragerc 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -[run] -source = rnc2rng - -[report] -exclude_lines = - pragma: no cover - def __repr__ - assert diff -Nru rnc2rng-2.6.4/debian/changelog rnc2rng-2.6.6/debian/changelog --- rnc2rng-2.6.4/debian/changelog 2020-09-25 13:28:51.000000000 +0000 +++ rnc2rng-2.6.6/debian/changelog 2021-11-25 18:56:05.000000000 +0000 @@ -1,4 +1,4 @@ -rnc2rng (2.6.4-1) unstable; urgency=low +rnc2rng (2.6.6-1) unstable; urgency=medium [ Debian Janitor ] * Trim trailing whitespace. @@ -11,11 +11,17 @@ * d/control: Update Vcs-* fields with new Debian Python Team Salsa layout. - [ Yaroslav Halchenko ] - * Fresh upstream upload (needed for citeproc 0.5.1) - * debian/patches/* - removed, upstreamed + [ Emmanuel Arias ] + * New upstream version 2.6.6 (Closes: #997644). + * d/control: Bump debhelper-compat to 13. + * d/control: Bump Standards-Version to 4.6.0.1. + * d/patches: Remove patch. Upstream already apply the change. + * d/rules: Run tests for all supported Python version. + * d/tests: Add autopkgtests. + * d/control: Add Rules-Requires-Root: no. + * wrap-and-sort. - -- Yaroslav Halchenko Fri, 25 Sep 2020 09:28:51 -0400 + -- Emmanuel Arias Thu, 25 Nov 2021 15:56:05 -0300 rnc2rng (2.6.2-1) unstable; urgency=medium diff -Nru rnc2rng-2.6.4/debian/control rnc2rng-2.6.6/debian/control --- rnc2rng-2.6.4/debian/control 2020-09-25 13:28:51.000000000 +0000 +++ rnc2rng-2.6.6/debian/control 2021-11-25 18:56:05.000000000 +0000 @@ -3,21 +3,23 @@ Priority: optional Maintainer: Debian Python Team Uploaders: Emmanuel Arias , - Yaroslav Halchenko -Build-Depends: debhelper-compat (= 12), + Yaroslav Halchenko , +Build-Depends: debhelper-compat (= 13), dh-python, - python3-setuptools, python3-all, - python3-rply -Standards-Version: 4.5.0 + python3-rply, + python3-setuptools, +Standards-Version: 4.6.0.1 Homepage: https://github.com/djc/rnc2rng Vcs-Browser: https://salsa.debian.org/python-team/packages/rnc2rng Vcs-Git: https://salsa.debian.org/python-team/packages/rnc2rng.git Testsuite: autopkgtest-pkg-python +Rules-Requires-Root: no Package: python3-rnc2rng Architecture: all -Depends: ${python3:Depends}, ${misc:Depends} +Depends: ${misc:Depends}, + ${python3:Depends}, Description: RELAX NG Compact to regular syntax conversion library Converts RELAX NG schemata in Compact syntax (rnc) to the equivalent schema in the XML-based default RELAX NG syntax. diff -Nru rnc2rng-2.6.4/debian/rules rnc2rng-2.6.6/debian/rules --- rnc2rng-2.6.4/debian/rules 2020-09-25 13:28:51.000000000 +0000 +++ rnc2rng-2.6.6/debian/rules 2021-11-25 18:56:05.000000000 +0000 @@ -2,8 +2,15 @@ export PYBUILD_NAME=rnc2rng + +PYTHON3S:=$(shell py3versions -vr) + %: dh $@ --with python3 --buildsystem=pybuild override_dh_auto_test: - python3 test.py +ifeq (,$(filter nocheck, $(DEB_BUILD_OPTIONS))) + set -e ; for pyvers in $(PYTHON3S); do \ + PYTHONPATH=. python$$pyvers test.py ;\ + done +endif diff -Nru rnc2rng-2.6.4/debian/tests/control rnc2rng-2.6.6/debian/tests/control --- rnc2rng-2.6.4/debian/tests/control 1970-01-01 00:00:00.000000000 +0000 +++ rnc2rng-2.6.6/debian/tests/control 2021-11-25 18:56:05.000000000 +0000 @@ -0,0 +1,4 @@ +Tests: unittests +Depends: python3-all, + @, +Restrictions: allow-stderr diff -Nru rnc2rng-2.6.4/debian/tests/unittests rnc2rng-2.6.6/debian/tests/unittests --- rnc2rng-2.6.4/debian/tests/unittests 1970-01-01 00:00:00.000000000 +0000 +++ rnc2rng-2.6.6/debian/tests/unittests 2021-11-25 18:56:05.000000000 +0000 @@ -0,0 +1,11 @@ +#!/bin/sh + +set -e -u -x + +cp -r tests "$AUTOPKGTEST_TMP" +cp test.py "$AUTOPKGTEST_TMP" +cd "$AUTOPKGTEST_TMP" + +for py in $(py3versions -s); do + $py test.py +done diff -Nru rnc2rng-2.6.4/.github/workflows/ci.yml rnc2rng-2.6.6/.github/workflows/ci.yml --- rnc2rng-2.6.4/.github/workflows/ci.yml 2020-04-06 07:45:55.000000000 +0000 +++ rnc2rng-2.6.6/.github/workflows/ci.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,44 +0,0 @@ -name: CI - -on: [push] - -jobs: - build: - strategy: - matrix: - include: - - os: ubuntu-latest - python-version: 2.7 - - os: ubuntu-latest - python-version: 3.5 - - os: ubuntu-latest - python-version: 3.6 - - os: ubuntu-latest - python-version: 3.7 - - os: ubuntu-latest - python-version: 3.8 - - os: macos-latest - python-version: 3.5 - - runs-on: ${{ matrix.os }} - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v1 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install flake8 coverage coveralls rply - - name: Lint with flake8 - run: | - # stop the build if there are Python syntax errors or undefined names - flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics - # exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide - flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics - - name: Test with pytest - run: | - coverage run test.py - COVERALLS_REPO_TOKEN=${{ secrets.COVERALLS_REPO_TOKEN }} coveralls diff -Nru rnc2rng-2.6.4/.gitignore rnc2rng-2.6.6/.gitignore --- rnc2rng-2.6.4/.gitignore 2016-02-03 20:34:43.000000000 +0000 +++ rnc2rng-2.6.6/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,4 +0,0 @@ -**.pyc -.coverage -*.egg-info -dist diff -Nru rnc2rng-2.6.4/PKG-INFO rnc2rng-2.6.6/PKG-INFO --- rnc2rng-2.6.4/PKG-INFO 2020-04-21 20:19:39.000000000 +0000 +++ rnc2rng-2.6.6/PKG-INFO 2021-09-09 08:32:57.535621000 +0000 @@ -1,82 +1,85 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: rnc2rng -Version: 2.6.4 +Version: 2.6.6 Summary: RELAX NG Compact to regular syntax conversion library Home-page: https://github.com/djc/rnc2rng Author: David Mertz Maintainer: Dirkjan Ochtman Maintainer-email: dirkjan@ochtman.nl License: UNKNOWN -Description: RELAX NG Compact to RELAX NG conversion library - =============================================== - - .. image:: https://travis-ci.org/djc/rnc2rng.svg?branch=master - :target: https://travis-ci.org/djc/rnc2rng - .. image:: https://coveralls.io/repos/djc/rnc2rng/badge.svg?branch=master&service=github - :target: https://coveralls.io/github/djc/rnc2rng?branch=master - - Converts RELAX NG schemata in Compact syntax (`rnc`) to the equivalent schema - in the XML-based default RELAX NG syntax. Dependencies: - - - Python 2.x (tested with 2.6, 2.7) - - Python 3.x (tested with 3.3, 3.4, 3.5, 3.7, 3.8) - - `rply`_ - - Feedback welcome on `GitHub`_. - - .. _GitHub: https://github.com/djc/rnc2rng - .. _rply: https://pypi.python.org/pypi/rply - - History - ------- - - rnc2rng was originally written by `David Mertz`_ in 2003 and published as part - of a collection of files around RELAX NG `on his site`_ into the Public Domain. - `Hartmut Goebel`_ published it as a package on PyPI to make it easier to access. - It was mirrored on GitHub by `Dustin J. Mitchell`_ in 2010 after he fixed some - bugs. `Timmy Zhu`_ forked his repository and contributed further enhancements. - Recently, I (Dirkjan Ochtman) was interested in playing with RELAX NG Compact - and started making further updates. I asked Hartmut for maintainership on PyPI - and received it. While I cannot promise many updates, I should be responsive to - bug reports and (especially!) pull requests. - - .. _David Mertz: http://www.gnosis.cx/publish/ - .. _on his site: http://www.gnosis.cx/download/relax/ - .. _Hartmut Goebel: http://www.goebel-consult.de/ - .. _Dustin J. Mitchell: http://code.v.igoro.us/ - .. _Timmy Zhu: https://github.com/nattofriends - - How to install - -------------- - - The usual should work: - - .. code-block:: shell - - $ sudo pip install . - - Getting started - --------------- - - .. code-block:: shell - - $ python -m rnc2rng test.rnc > test.rng - - License - ------- - - All of the code is released under MIT License. - Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License Classifier: Topic :: Text Processing :: Markup :: XML -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +License-File: LICENSE +License-File: AUTHORS + +RELAX NG Compact to RELAX NG conversion library +=============================================== + +.. image:: https://github.com/djc/rnc2rng/workflows/CI/badge.svg + :target: https://github.com/djc/rnc2rng/actions?query=workflow%3ACI +.. image:: https://coveralls.io/repos/djc/rnc2rng/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/djc/rnc2rng?branch=master + +Converts RELAX NG schemata in Compact syntax (`rnc`) to the equivalent schema +in the XML-based default RELAX NG syntax. Dependencies: + +- Python 3.x (tested with 3.7, 3.8, 3.9) +- `rply`_ + +Feedback welcome on `GitHub`_. Please consider funding continued maintenance of this +project through `Patreon`_ or `GitHub Sponsors`_. + +.. _GitHub: https://github.com/djc/rnc2rng +.. _rply: https://pypi.python.org/pypi/rply +.. _Patreon: https://patreon.com/dochtman +.. _GitHub Sponsors: https://github.com/sponsors/djc + +History +------- + +rnc2rng was originally written by `David Mertz`_ in 2003 and published as part +of a collection of files around RELAX NG `on his site`_ into the Public Domain. +`Hartmut Goebel`_ published it as a package on PyPI to make it easier to access. +It was mirrored on GitHub by `Dustin J. Mitchell`_ in 2010 after he fixed some +bugs. `Timmy Zhu`_ forked his repository and contributed further enhancements. +Recently, I (Dirkjan Ochtman) was interested in playing with RELAX NG Compact +and started making further updates. I asked Hartmut for maintainership on PyPI +and received it. While I cannot promise many updates, I should be responsive to +bug reports and (especially!) pull requests. + +.. _David Mertz: http://www.gnosis.cx/publish/ +.. _on his site: http://www.gnosis.cx/download/relax/ +.. _Hartmut Goebel: http://www.goebel-consult.de/ +.. _Dustin J. Mitchell: http://code.v.igoro.us/ +.. _Timmy Zhu: https://github.com/nattofriends + +How to install +-------------- + +The usual should work: + +.. code-block:: shell + + $ sudo pip install . + +Getting started +--------------- + +.. code-block:: shell + + $ python -m rnc2rng test.rnc > test.rng + +License +------- + +All of the code is released under MIT License. + + diff -Nru rnc2rng-2.6.4/README.rst rnc2rng-2.6.6/README.rst --- rnc2rng-2.6.4/README.rst 2020-04-21 20:18:19.000000000 +0000 +++ rnc2rng-2.6.6/README.rst 2021-09-09 08:30:59.000000000 +0000 @@ -1,22 +1,24 @@ RELAX NG Compact to RELAX NG conversion library =============================================== -.. image:: https://travis-ci.org/djc/rnc2rng.svg?branch=master - :target: https://travis-ci.org/djc/rnc2rng +.. image:: https://github.com/djc/rnc2rng/workflows/CI/badge.svg + :target: https://github.com/djc/rnc2rng/actions?query=workflow%3ACI .. image:: https://coveralls.io/repos/djc/rnc2rng/badge.svg?branch=master&service=github :target: https://coveralls.io/github/djc/rnc2rng?branch=master Converts RELAX NG schemata in Compact syntax (`rnc`) to the equivalent schema in the XML-based default RELAX NG syntax. Dependencies: -- Python 2.x (tested with 2.6, 2.7) -- Python 3.x (tested with 3.3, 3.4, 3.5, 3.7, 3.8) +- Python 3.x (tested with 3.7, 3.8, 3.9) - `rply`_ -Feedback welcome on `GitHub`_. +Feedback welcome on `GitHub`_. Please consider funding continued maintenance of this +project through `Patreon`_ or `GitHub Sponsors`_. .. _GitHub: https://github.com/djc/rnc2rng .. _rply: https://pypi.python.org/pypi/rply +.. _Patreon: https://patreon.com/dochtman +.. _GitHub Sponsors: https://github.com/sponsors/djc History ------- diff -Nru rnc2rng-2.6.4/rnc2rng/parser.py rnc2rng-2.6.6/rnc2rng/parser.py --- rnc2rng-2.6.4/rnc2rng/parser.py 2020-04-21 20:18:19.000000000 +0000 +++ rnc2rng-2.6.6/rnc2rng/parser.py 2021-09-09 08:21:08.000000000 +0000 @@ -1,16 +1,8 @@ -from __future__ import print_function +from codecs import BOM_UTF16_BE, BOM_UTF16_LE +from urllib.request import urlopen +from urllib.parse import urljoin, urlparse import rply, sys, os -from codecs import BOM_UTF16_BE, BOM_UTF16_LE -if sys.version_info[0] < 3: - from urllib2 import urlopen as _urlopen - from urlparse import urljoin - from contextlib import closing - def urlopen(f): - return closing(_urlopen(f)) -else: - from urllib.request import urlopen - from urllib.parse import urljoin KEYWORDS = set([ 'attribute', 'datatypes', 'default', 'div', 'element', 'empty', 'external', @@ -213,7 +205,7 @@ @pg.production('component : INCLUDE strlit opt-inherit opt-include-content') def component_include(s, p): - if ':' in s.path or ':' in p[1].value: # it's a URL + if is_url(s.path) or is_url(p[1].value): # it's a URL url = urljoin(s.path, p[1].value) else: url = os.path.join(s.path, p[1].value) @@ -540,7 +532,7 @@ @pg.production('documentations : DOCUMENTATION documentations') def documentations_multi(s, p): cur = Node('DOCUMENTATION', None, []) if not p[1] else p[1][0] - cur.value.insert(0, p[0].value.lstrip('# ')) + cur.value.insert(0, p[0].value.lstrip('# ').rstrip('\r')) return [cur] @pg.production('documentations : ') @@ -678,7 +670,7 @@ self.fn = fn self.path = os.getcwd() if fn is not None: - self.path = os.path.dirname(os.path.abspath(fn)) if ':' not in fn else fn + self.path = os.path.dirname(os.path.abspath(fn)) if not is_url(fn) else fn self.lines = src.splitlines() if sys.version_info[0] < 3: @@ -686,11 +678,15 @@ else: str_types = str, bytes +def is_url(fn): + parse_result = urlparse(fn) + return parse_result.scheme in ('http', 'https', 'file') + def parse(src=None, f=None): assert src is None or f is None if f is not None and isinstance(f, str_types): fn = f - if ':' in fn: + if is_url(fn): with urlopen(fn) as f: bytes = f.read() else: diff -Nru rnc2rng-2.6.4/rnc2rng/serializer.py rnc2rng-2.6.6/rnc2rng/serializer.py --- rnc2rng-2.6.4/rnc2rng/serializer.py 2020-04-06 07:45:55.000000000 +0000 +++ rnc2rng-2.6.6/rnc2rng/serializer.py 2021-09-09 08:27:54.000000000 +0000 @@ -8,11 +8,7 @@ PARAM, PARENT, REF, ROOT, SEQ, SOME, TEXT, ) -import sys -if sys.version_info[0] < 3: - import cgi as html -else: - import html +import html QUANTS = {SOME: 'oneOrMore', MAYBE: 'optional', ANY: 'zeroOrMore'} TYPELIB_NS = 'http://www.w3.org/2001/XMLSchema-datatypes' diff -Nru rnc2rng-2.6.4/rnc2rng.egg-info/PKG-INFO rnc2rng-2.6.6/rnc2rng.egg-info/PKG-INFO --- rnc2rng-2.6.4/rnc2rng.egg-info/PKG-INFO 2020-04-21 20:19:39.000000000 +0000 +++ rnc2rng-2.6.6/rnc2rng.egg-info/PKG-INFO 2021-09-09 08:32:57.000000000 +0000 @@ -1,82 +1,85 @@ -Metadata-Version: 1.2 +Metadata-Version: 2.1 Name: rnc2rng -Version: 2.6.4 +Version: 2.6.6 Summary: RELAX NG Compact to regular syntax conversion library Home-page: https://github.com/djc/rnc2rng Author: David Mertz Maintainer: Dirkjan Ochtman Maintainer-email: dirkjan@ochtman.nl License: UNKNOWN -Description: RELAX NG Compact to RELAX NG conversion library - =============================================== - - .. image:: https://travis-ci.org/djc/rnc2rng.svg?branch=master - :target: https://travis-ci.org/djc/rnc2rng - .. image:: https://coveralls.io/repos/djc/rnc2rng/badge.svg?branch=master&service=github - :target: https://coveralls.io/github/djc/rnc2rng?branch=master - - Converts RELAX NG schemata in Compact syntax (`rnc`) to the equivalent schema - in the XML-based default RELAX NG syntax. Dependencies: - - - Python 2.x (tested with 2.6, 2.7) - - Python 3.x (tested with 3.3, 3.4, 3.5, 3.7, 3.8) - - `rply`_ - - Feedback welcome on `GitHub`_. - - .. _GitHub: https://github.com/djc/rnc2rng - .. _rply: https://pypi.python.org/pypi/rply - - History - ------- - - rnc2rng was originally written by `David Mertz`_ in 2003 and published as part - of a collection of files around RELAX NG `on his site`_ into the Public Domain. - `Hartmut Goebel`_ published it as a package on PyPI to make it easier to access. - It was mirrored on GitHub by `Dustin J. Mitchell`_ in 2010 after he fixed some - bugs. `Timmy Zhu`_ forked his repository and contributed further enhancements. - Recently, I (Dirkjan Ochtman) was interested in playing with RELAX NG Compact - and started making further updates. I asked Hartmut for maintainership on PyPI - and received it. While I cannot promise many updates, I should be responsive to - bug reports and (especially!) pull requests. - - .. _David Mertz: http://www.gnosis.cx/publish/ - .. _on his site: http://www.gnosis.cx/download/relax/ - .. _Hartmut Goebel: http://www.goebel-consult.de/ - .. _Dustin J. Mitchell: http://code.v.igoro.us/ - .. _Timmy Zhu: https://github.com/nattofriends - - How to install - -------------- - - The usual should work: - - .. code-block:: shell - - $ sudo pip install . - - Getting started - --------------- - - .. code-block:: shell - - $ python -m rnc2rng test.rnc > test.rng - - License - ------- - - All of the code is released under MIT License. - Platform: UNKNOWN Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: Operating System :: OS Independent Classifier: License :: OSI Approved :: MIT License Classifier: Topic :: Text Processing :: Markup :: XML -Classifier: Programming Language :: Python :: 2 -Classifier: Programming Language :: Python :: 2.6 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 3.3 -Classifier: Programming Language :: Python :: 3.4 -Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +License-File: LICENSE +License-File: AUTHORS + +RELAX NG Compact to RELAX NG conversion library +=============================================== + +.. image:: https://github.com/djc/rnc2rng/workflows/CI/badge.svg + :target: https://github.com/djc/rnc2rng/actions?query=workflow%3ACI +.. image:: https://coveralls.io/repos/djc/rnc2rng/badge.svg?branch=master&service=github + :target: https://coveralls.io/github/djc/rnc2rng?branch=master + +Converts RELAX NG schemata in Compact syntax (`rnc`) to the equivalent schema +in the XML-based default RELAX NG syntax. Dependencies: + +- Python 3.x (tested with 3.7, 3.8, 3.9) +- `rply`_ + +Feedback welcome on `GitHub`_. Please consider funding continued maintenance of this +project through `Patreon`_ or `GitHub Sponsors`_. + +.. _GitHub: https://github.com/djc/rnc2rng +.. _rply: https://pypi.python.org/pypi/rply +.. _Patreon: https://patreon.com/dochtman +.. _GitHub Sponsors: https://github.com/sponsors/djc + +History +------- + +rnc2rng was originally written by `David Mertz`_ in 2003 and published as part +of a collection of files around RELAX NG `on his site`_ into the Public Domain. +`Hartmut Goebel`_ published it as a package on PyPI to make it easier to access. +It was mirrored on GitHub by `Dustin J. Mitchell`_ in 2010 after he fixed some +bugs. `Timmy Zhu`_ forked his repository and contributed further enhancements. +Recently, I (Dirkjan Ochtman) was interested in playing with RELAX NG Compact +and started making further updates. I asked Hartmut for maintainership on PyPI +and received it. While I cannot promise many updates, I should be responsive to +bug reports and (especially!) pull requests. + +.. _David Mertz: http://www.gnosis.cx/publish/ +.. _on his site: http://www.gnosis.cx/download/relax/ +.. _Hartmut Goebel: http://www.goebel-consult.de/ +.. _Dustin J. Mitchell: http://code.v.igoro.us/ +.. _Timmy Zhu: https://github.com/nattofriends + +How to install +-------------- + +The usual should work: + +.. code-block:: shell + + $ sudo pip install . + +Getting started +--------------- + +.. code-block:: shell + + $ python -m rnc2rng test.rnc > test.rng + +License +------- + +All of the code is released under MIT License. + + diff -Nru rnc2rng-2.6.4/rnc2rng.egg-info/SOURCES.txt rnc2rng-2.6.6/rnc2rng.egg-info/SOURCES.txt --- rnc2rng-2.6.4/rnc2rng.egg-info/SOURCES.txt 2020-04-21 20:19:39.000000000 +0000 +++ rnc2rng-2.6.6/rnc2rng.egg-info/SOURCES.txt 2021-09-09 08:32:57.000000000 +0000 @@ -1,5 +1,3 @@ -.coveragerc -.gitignore AUTHORS LICENSE MANIFEST.in @@ -7,7 +5,6 @@ setup.cfg setup.py test.py -.github/workflows/ci.yml rnc2rng/__init__.py rnc2rng/__main__.py rnc2rng/parser.py diff -Nru rnc2rng-2.6.4/setup.py rnc2rng-2.6.6/setup.py --- rnc2rng-2.6.4/setup.py 2020-04-21 20:19:09.000000000 +0000 +++ rnc2rng-2.6.6/setup.py 2021-09-09 08:30:24.000000000 +0000 @@ -2,7 +2,7 @@ setup( name='rnc2rng', - version='2.6.4', + version='2.6.6', url='https://github.com/djc/rnc2rng', author='David Mertz', description='RELAX NG Compact to regular syntax conversion library', @@ -15,13 +15,10 @@ 'Operating System :: OS Independent', 'License :: OSI Approved :: MIT License', 'Topic :: Text Processing :: Markup :: XML', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.6', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.8', + 'Programming Language :: Python :: 3.9', ], packages=['rnc2rng'], entry_points={ @@ -29,6 +26,5 @@ 'rnc2rng = rnc2rng.__main__:main', ], }, - use_2to3=True, install_requires=['rply'], ) diff -Nru rnc2rng-2.6.4/test.py rnc2rng-2.6.6/test.py --- rnc2rng-2.6.4/test.py 2020-04-06 07:45:55.000000000 +0000 +++ rnc2rng-2.6.6/test.py 2020-12-04 14:49:40.000000000 +0000 @@ -1,5 +1,12 @@ import rnc2rng import unittest, os +import sys +if sys.version_info[0] < 3: + from urllib import pathname2url, url2pathname + from urlparse import urljoin, urlparse +else: + from urllib.parse import urljoin, urlparse + from urllib.request import pathname2url, url2pathname class TestUtils(unittest.TestCase): @@ -21,10 +28,11 @@ return 'TestCase(%r)' % self.fn def runTest(self): - root = rnc2rng.load(self.fn) ref = self.fn.replace('.rnc', '.rng') - ref = ref[7:] if ref.startswith('file://') else ref + if ref.startswith('file:'): + parse_result = urlparse(ref) + ref = url2pathname(parse_result.path) with open(ref) as f: expected = f.read().rstrip() @@ -50,7 +58,8 @@ fn = os.path.join('tests', fn) suite.addTest(FileTest(fn)) # synthesize a test that reads its input from a URL - suite.addTest(FileTest('file://' + os.path.abspath('tests/include.rnc'))) + url_test_path = os.path.abspath('tests/include.rnc') + suite.addTest(FileTest(urljoin('file:', pathname2url(url_test_path)))) return suite