diff --git a/HISTORY.rst b/HISTORY.rst index 6f1d19d..a2f8d68 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -2,6 +2,10 @@ History ------- +0.2.1 (Unreleased) +~~~~~~~~~~~~~~~~~~ +- Added ``pyproject.toml`` and uv install instructions while maintaining + Python 2.7 compatibility. 0.2.0 (21 Nov 2018) ~~~~~~~~~~~~~~~~~~~~~ - ``xmljson`` command line script converts from XML to JSON (@tribals) diff --git a/README.rst b/README.rst index 24d8ed5..eb9a61a 100644 --- a/README.rst +++ b/README.rst @@ -200,10 +200,14 @@ The `Parker`_ convention absorbs the root element by default. Installation ------------ -This is a pure-Python package built for Python 2.7+ and Python 3.0+. To set up:: +This is a pure-Python package built for Python 2.7+ and Python 3.0+. To install +using pip or the ``uv`` package manager:: pip install xmljson + # or with uv + uv pip install xmljson + Simple CLI utility ------------------ diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bc7b60c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,33 @@ +[build-system] +requires = ["setuptools<45", "wheel"] +build-backend = "setuptools.build_meta" + +[project] +name = "xmljson" +version = "0.2.1" +description = "Converts XML into JSON/Python dicts/arrays and vice-versa." +readme = "README.rst" +requires-python = ">=2.7" +authors = [{name = "S Anand", email = "root.node@gmail.com"}] +license = {file = "LICENSE"} +classifiers = [ + "Development Status :: 4 - Beta", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[project.scripts] +xml2json = "xmljson.__main__:main" + +[project.optional-dependencies] +test = ["lxml", "pytest"] + +[tool.uv] +managed = true diff --git a/xmljson/__init__.py b/xmljson/__init__.py index 87f8216..dfdea54 100644 --- a/xmljson/__init__.py +++ b/xmljson/__init__.py @@ -2,14 +2,15 @@ import sys from collections import Counter, OrderedDict + try: from lxml.etree import Element -except ImportError: +except ImportError: # pragma: no cover - fallback for environments without lxml from xml.etree.cElementTree import Element __author__ = 'S Anand' __email__ = 'root.node@gmail.com' -__version__ = '0.2.0' +__version__ = '0.2.1' # Python 3: define unicode() as str() if sys.version_info[0] == 3: