From fbe78ddeb40354ac14072b0dfeb63b88e1d8ebcc Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Wed, 10 Sep 2025 18:48:53 +1200 Subject: [PATCH 1/2] feat: Migrate to pyproject.toml --- .github/workflows/pypi-publish.yml | 3 +- pyproject.toml | 49 ++++++++++++ setup.cfg | 3 - setup.py | 116 ----------------------------- 4 files changed, 50 insertions(+), 121 deletions(-) create mode 100644 pyproject.toml delete mode 100644 setup.cfg delete mode 100644 setup.py diff --git a/.github/workflows/pypi-publish.yml b/.github/workflows/pypi-publish.yml index 181949f..ecd9ed0 100644 --- a/.github/workflows/pypi-publish.yml +++ b/.github/workflows/pypi-publish.yml @@ -89,8 +89,7 @@ jobs: run: | echo "Using version $PKG_VERSION_STRICT" sed -i -r -e "s/^__version__ = '.*'$/__version__ = '$PKG_VERSION_STRICT'/" rfc2html.py - python ./setup.py setopt --command=metadata --option=version --set-value=$PKG_VERSION_STRICT - python ./setup.py sdist --dist-dir dist + python3 -m build - name: Import Test GPG Key uses: crazy-max/ghaction-import-gpg@cb4264d3319acaa2bea23d51ef67f80b4f775013 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..5a0b89f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,49 @@ +[build-system] +requires = ["setuptools>=61.0", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "rfc2html" +dynamic = ["version"] +authors = [ + {name = "IETF Tools", email = "tools-help@ietf.org"}, +] +description = "Convert text-format RFCs and Internet-Drafts to html" +keywords = ["svg", "validation", "rfc", "internet-draft", "html"] +readme = "README.md" +license = "BSD-2-Clause" +license-files = ["LICENSE"] +requires-python = ">=2.7" +classifiers = [ + "Development Status :: 5 - Production/Stable", + "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", + "Topic :: Text Processing", + "Topic :: Text Processing :: Markup :: XML", +] + +[project.urls] +homepage = "https://github.com/ietf-tools/rfc2html" +source = "https://github.com/ietf-tools/rfc2html" +issues = "https://github.com/ietf-tools/rfc2html/issues" +changelog = "https://github.com/ietf-tools/rfc2html/blob/main/CHANGELOG.md" +releasenotes = "https://github.com/ietf-tools/rfc2html/releases" + +[project.optional-dependencies] +tests = [ + "coverage", + "flake8", + "tox", +] + +[project.scripts] +rfc2html = "rfc2html:main" + +[tool.setuptools] +py-modules = ["rfc2html"] + +[tool.setuptools.dynamic] +version = {attr = "rfc2html.__version__"} diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index fb1be5b..0000000 --- a/setup.cfg +++ /dev/null @@ -1,3 +0,0 @@ -[metadata] -version = 2.0.2 - diff --git a/setup.py b/setup.py deleted file mode 100644 index b1dc7bb..0000000 --- a/setup.py +++ /dev/null @@ -1,116 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- -# Copyright 2017-2018 Henrik Levkowtez, All Rights Reserved - -from __future__ import unicode_literals, print_function, division - -import os - -from codecs import open -from setuptools import setup - -# This workaround is necessary under python 2.x to make setup.py upload work -# with non-ascii arguments to setup(). -try: - reload(sys).setdefaultencoding("UTF-8") -except NameError: - pass - -here = os.path.abspath(os.path.dirname(__file__)) - -# Get the long description from the README file -with open(os.path.join(here, 'README.md'), encoding='utf-8') as file: - long_description = file.read() - -setup( - name='rfc2html', - - description="Convert text-format RFCs and Internet-Drafts to html", - long_description=long_description, - long_description_content_type="text/markdown", - - # The project's main homepage. - url='https://github.com/ietf-tools/rfc2html/', - - # Author details - author='Henrik Levkowetz', - author_email='henrik@levkowetz.com', - - # Choose your license - license='Simplified BSD', - - # See https://pypi.python.org/pypi?%3Aaction=list_classifiers - classifiers=[ - # How mature is this project? Common values are - # 3 - Alpha - # 4 - Beta - # 5 - Production/Stable - 'Development Status :: 5 - Production/Stable', - - # Indicate who your project is intended for - 'Intended Audience :: Other Audience', - 'Topic :: Text Processing', - 'Topic :: Text Processing :: Markup :: XML', - - # Pick your license as you wish (should match "license" above) - 'License :: OSI Approved :: BSD License', - - # Specify the Python versions you support here. In particular, ensure - # that you indicate whether you support Python 2, Python 3 or both. - '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', - ], - - # What does your project relate to? - keywords='RFC and Internet-Draft text to html conversion', - - # You can just specify the packages manually here if your project is - # simple. Or you can use find_packages(). - #packages=[], - - # Alternatively, if you want to distribute just a my_module.py, uncomment - # this: - py_modules=["rfc2html"], - - # List run-time dependencies here. These will be installed by pip when - # your project is installed. For an analysis of "install_requires" vs pip's - # requirements files see: - # https://packaging.python.org/en/latest/requirements.html - #install_requires=[], - - # List additional groups of dependencies here (e.g. development - # dependencies). You can install these using the following syntax, - # for example: - # $ pip install -e .[dev,test] - extras_require={ - 'dev': ['twine', ], - #'test': ['coverage'], - }, - - # If there are data files included in your packages that need to be - # installed, specify them here. If using Python 2.6 or less, then these - # have to be included in MANIFEST.in as well. - #package_data={}, - - # Although 'package_data' is the preferred approach, in some case you may - # need to place data files outside of your packages. See: - # http://docs.python.org/3.4/distutils/setupscript.html#installing-additional-files # noqa - # In this case, 'data_file' will be installed into '/my_data' - #data_files=[], - - # To provide executable scripts, use entry points in preference to the - # "scripts" keyword. Entry points provide cross-platform support and allow - # pip to create the appropriate form of executable for the target platform. - entry_points={ - "console_scripts": [ - "rfc2html = rfc2html:main", - ], - }, - - - # We're reading schema files from a package directory. - #zip_safe = True, -) From 292c979e65e70cafe81887cb1f7c9c0b41119314 Mon Sep 17 00:00:00 2001 From: Kesara Rathnayake Date: Wed, 10 Sep 2025 18:50:49 +1200 Subject: [PATCH 2/2] chore: Update license identifier --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 5a0b89f..90bdc12 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -11,7 +11,7 @@ authors = [ description = "Convert text-format RFCs and Internet-Drafts to html" keywords = ["svg", "validation", "rfc", "internet-draft", "html"] readme = "README.md" -license = "BSD-2-Clause" +license = "BSD-3-Clause" license-files = ["LICENSE"] requires-python = ">=2.7" classifiers = [