Skip to content

Commit

Permalink
Merge 3ed996c into 7afd64d
Browse files Browse the repository at this point in the history
  • Loading branch information
djc committed Sep 9, 2021
2 parents 7afd64d + 3ed996c commit d8b4e1c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 37 deletions.
28 changes: 10 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,33 +6,25 @@ on:
pull_request:

jobs:
build:
Test:
strategy:
matrix:
os: [ubuntu-latest]
python: [3.7, 3.8, 3.9]
include:
- os: ubuntu-latest
python-version: 2.7
- os: ubuntu-latest
python-version: 3.6
- os: ubuntu-latest
python-version: 3.7
- os: ubuntu-latest
python-version: 3.8
- os: ubuntu-latest
python-version: 3.9
- os: macos-latest
python-version: 3.7
python: 3.9
- os: windows-latest
python-version: 3.7
python: 3.9

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
python: ${{ matrix.python }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand All @@ -46,14 +38,14 @@ jobs:
- name: Run tests
run: python test.py

coverage:
Coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
- name: Set up Python 3.9
uses: actions/setup-python@v1
with:
python-version: 3.7
python: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
Expand Down
14 changes: 3 additions & 11 deletions rnc2rng/parser.py
Original file line number Diff line number Diff line change
@@ -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, urlparse
from contextlib import closing
def urlopen(f):
return closing(_urlopen(f))
else:
from urllib.request import urlopen
from urllib.parse import urljoin, urlparse

KEYWORDS = set([
'attribute', 'datatypes', 'default', 'div', 'element', 'empty', 'external',
Expand Down
6 changes: 1 addition & 5 deletions rnc2rng/serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
3 changes: 0 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
'Operating System :: OS Independent',
'License :: OSI Approved :: MIT License',
'Topic :: Text Processing :: Markup :: XML',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
Expand All @@ -32,6 +30,5 @@
'rnc2rng = rnc2rng.__main__:main',
],
},
use_2to3=True,
install_requires=['rply'],
)

0 comments on commit d8b4e1c

Please sign in to comment.