Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,30 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Initialize CodeQL
uses: github/codeql-action/init@v2
uses: github/codeql-action/init@v4
with:
languages: python

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
uses: github/codeql-action/analyze@v4

tests-linux:
name: Unit Tests (Linux)
runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -50,7 +50,7 @@ jobs:
echo "Installing pip + wheel..."
python -m pip install --upgrade pip wheel
echo "Installing python dependencies..."
python -m pip install -r requirements.txt
python -m pip install .

- name: Test
env:
Expand All @@ -63,14 +63,14 @@ jobs:

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10']
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- name: Checkout repository
uses: actions/checkout@v2
uses: actions/checkout@v6

- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.3.1
uses: actions/setup-python@v6.2.0
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -80,7 +80,7 @@ jobs:
echo "Installing pip + wheel..."
python -m pip install --upgrade pip wheel
echo "Installing dependencies..."
python -m pip install -r requirements.txt
python -m pip install .

- name: Test
env:
Expand Down
25 changes: 12 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@

version := $(shell python id2xml/run.py --version | awk '{print $$2}' )

pyversion := $(shell python -c "import sys; print(str(sys.version_info.major) + str(sys.version_info.minor))" )

testfiles= \
draft-baba-iot-problems-03.txt \
draft-ietf-6man-rfc2460bis-11.txt \
Expand Down Expand Up @@ -32,26 +34,23 @@ diffiles = $(addsuffix .diff, $(basename $(resfiles)))
tests = $(addsuffix .test, $(basename $(resfiles)))
pyfiles = $(wildcard id2xml/*.py)

all: install upload
all: install upload man

%.1: id2xml/run.py id2xml/__init__.py Makefile
id2xml -h | sed -e 's/^ -/\n -/' \
| sed -e '/^ -/N;s/\n */ /' \
| txt2man -s1 -r'RFC Format Tools' -t $< > $@


%.1.gz: %.1
man: %.1
gzip < $< > $@

pyflakes:
pyflakes id2xml


install: id2xml/id2xml.1.gz
python setup.py -q install

env/bin/id2xml: $(pyfiles) setup.py
python setup.py -q install
install: $(pyfiles) pyproject.toml
python -m pip install .[test]


# ------------------------------------------------------------------------
Expand All @@ -62,7 +61,7 @@ env/bin/id2xml: $(pyfiles) setup.py
# ------------------------------------------------------------------------
# test

test: env/bin/id2xml clean $(resfiles) $(xml3files) $(diffiles) $(tests)
test: id2xml clean $(resfiles) $(xml3files) $(diffiles) $(tests)

.PHONY: clean
clean:
Expand Down Expand Up @@ -114,17 +113,17 @@ test/out/%.v3.xml: test/in/%.txt $(pyfiles)

# ------------------------------------------------------------------------

dist/id2xml-$(version).tar.gz: MANIFEST.in setup.py $(pyfiles)
python setup.py -q sdist
dist/id2xml-$(version).tar.gz: MANIFEST.in pyproject.toml $(pyfiles)
python -m build --sdist

dist/id2xml-$(version)-py27-none-any.whl: MANIFEST.in setup.py $(pyfiles)
python setup.py -q bdist_wheel --python-tag py27
dist/id2xml-$(version)-py$(pyversion)-none-any.whl: MANIFEST.in pyproject.toml $(pyfiles)
python -m build --wheel

dist/%.asc: dist/%
gpg --detach-sign -a $<

sdist: dist/id2xml-$(version).tar.gz dist/id2xml-$(version).tar.gz.asc
bdist_wheel: dist/id2xml-$(version)-py27-none-any.whl dist/id2xml-$(version)-py27-none-any.whl.asc
bdist_wheel: dist/id2xml-$(version)-py$(pyversion)-none-any.whl dist/id2xml-$(version)-py$(pyversion)-none-any.whl.asc

dist: test sdist # bdist_wheel

Expand Down
2 changes: 1 addition & 1 deletion bin/mkrelease
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ changes=$( sed -n "/^$PROJ ($VER)/,/^ -- /p" changelog )
note "$changes"

note "Upgrading the python library modules before checking migrations and running tests ..."
$do pip install --upgrade -r requirements.txt
$do pip install --upgrade .

note "Running the tests suite ..."
$do make test
Expand Down
66 changes: 66 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# -------------------------------------------------------
# Copyright The IETF Trust 2011-2026, All Rights Reserved
# -------------------------------------------------------
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "id2xml"
version = "1.5.2"
authors = [
{name = "Henrik Levkowetz", email = "henrik@levkowetz.com"},
]

description = "Convert text-format RFCs and Internet-Drafts to .xml format"
keywords = ["ietf", "rfc", "text", "internet-draft", "xml"]
readme = "README.rst"
license = "BSD-3-Clause"
license-files = ["LICENSE"]
requires-python = ">=3.9"
classifiers = [
'Intended Audience :: Other Audience',
'Topic :: Text Processing',
'Topic :: Text Processing :: Markup :: XML',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: 3.13',
'Programming Language :: Python :: 3.14',
]

dependencies = [
"lxml",
"pathlib2",
"six",
"xml2rfc>=2.8.2",
"decorator",
]

[project.urls]
homepage = "https://github.com/ietf-tools/id2xml"
source = "https://github.com/ietf-tools/id2xml"
issues = "https://github.com/ietf-tools/id2xml/issues"
releasenotes = "https://github.com/ietf-tools/id2xml/releases"

[project.optional-dependencies]
test = [
"coverage",
"pycodestyle",
"pyflakes",
"tox",
]
dev = [
"twine",
]

[project.scripts]
id2xml = "id2xml.run:run"

[tool.setuptools]
packages = ["id2xml"]
include-package-data = true

[tool.setuptools.package-data]
id2xml = ["data/*", "debug.py", "utils.py", "run.py"]
5 changes: 0 additions & 5 deletions requirements.txt

This file was deleted.

167 changes: 0 additions & 167 deletions setup.py

This file was deleted.

Loading