Skip to content

Commit 2b52fa2

Browse files
committed
fix: ruff lint issues
1 parent 7f6ff6e commit 2b52fa2

File tree

7 files changed

+317
-73
lines changed

7 files changed

+317
-73
lines changed

json2xml/dicttoxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import numbers
66
from collections.abc import Callable, Sequence
77
from random import SystemRandom
8-
from typing import Any, Dict, Union
8+
from typing import Any, Union
99

1010
from defusedxml.minidom import parseString
1111

json2xml/json2xml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pyexpat import ExpatError
2-
from typing import Any, Dict, Optional
2+
from typing import Any
33

44
from defusedxml.minidom import parseString
55

json2xml/utils.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
"""Utility methods for converting XML data to dictionary from various sources."""
22
import json
3-
from typing import Dict, Optional
43

54
import urllib3
65

pyproject.toml

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,53 @@
1-
[tool.ruff]
2-
exclude = [
3-
".env",
4-
".venv",
5-
"**/migrations/**",
1+
[build-system]
2+
requires = ["setuptools>=61.0"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "json2xml"
7+
version = "3.21.0"
8+
authors = [
9+
{ name = "Vinit Kumar", email = "[email protected]" },
610
]
7-
lint.ignore = [
8-
"E501", # line too long
9-
"F403", # 'from module import *' used; unable to detect undefined names
10-
"E701", # multiple statements on one line (colon)
11-
"F401", # module imported but unused
11+
description = "Simple Python Library to convert JSON to XML"
12+
readme = "README.rst"
13+
license = { text = "Apache Software License 2.0" }
14+
requires-python = ">=3.10"
15+
classifiers = [
16+
"Development Status :: 6 - Mature",
17+
"Intended Audience :: Developers",
18+
"License :: OSI Approved :: Apache Software License",
19+
"Natural Language :: English",
20+
"Programming Language :: Python :: 3.10",
21+
"Programming Language :: Python :: 3.11",
22+
"Programming Language :: Python :: 3.12",
23+
"Programming Language :: Python :: 3.13",
24+
"Programming Language :: Python :: Implementation :: CPython",
25+
"Programming Language :: Python :: Implementation :: PyPy",
26+
"Topic :: Software Development :: Libraries :: Python Modules",
1227
]
13-
line-length = 119
14-
lint.select = [
15-
"I",
16-
"E",
17-
"F",
18-
"W",
28+
keywords = ["json2xml"]
29+
30+
dependencies = [
31+
"defusedxml>=0.7.1",
32+
"requests>=2.31.0"
33+
]
34+
35+
[project.urls]
36+
Homepage = "https://github.com/vinitkumar/json2xml"
37+
Repository = "https://github.com/vinitkumar/json2xml.git"
38+
39+
[tool.setuptools]
40+
packages = ["json2xml"]
41+
include-package-data = true
42+
zip-safe = false
43+
44+
[tool.pytest.ini_options]
45+
testpaths = ["tests"]
46+
python_files = ["test_*.py"]
47+
addopts = "-ra -q"
48+
49+
[project.optional-dependencies]
50+
test = [
51+
"pytest==7.0.1",
52+
"py==1.11.0"
1953
]

setup.py

Lines changed: 2 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,3 @@
1-
#!/usr/bin/env python
1+
from setuptools import setup
22

3-
"""The setup script."""
4-
5-
from setuptools import setup, find_packages
6-
from json2xml import __version__
7-
8-
with open("README.rst", encoding="utf-8") as readme_file:
9-
readme = readme_file.read()
10-
11-
with open("HISTORY.rst", encoding="utf-8") as history_file:
12-
history = history_file.read()
13-
14-
with open("requirements.in", encoding="utf-8") as requirements_in:
15-
requirements = [requirements_in.read()]
16-
17-
setup_requirements = []
18-
19-
test_requirements = ["pytest==7.0.1", "py==1.11.0"]
20-
21-
setup(
22-
author="Vinit Kumar",
23-
author_email="[email protected]",
24-
classifiers=[
25-
"Development Status :: 6 - Mature",
26-
"Intended Audience :: Developers",
27-
"License :: OSI Approved :: Apache Software License",
28-
"Natural Language :: English",
29-
"Programming Language :: Python :: 3.10",
30-
"Programming Language :: Python :: 3.11",
31-
"Programming Language :: Python :: 3.12",
32-
"Programming Language :: Python :: 3.13",
33-
"Programming Language :: Python :: Implementation :: CPython",
34-
"Programming Language :: Python :: Implementation :: PyPy",
35-
"Topic :: Software Development :: Libraries :: Python Modules",
36-
],
37-
description="Simple Python Library to convert JSON to XML",
38-
install_requires=requirements,
39-
license="Apache Software License 2.0",
40-
long_description=readme + "\n\n" + history,
41-
long_description_content_type="text/x-rst",
42-
include_package_data=True,
43-
keywords="json2xml",
44-
name="json2xml",
45-
packages=find_packages(include=["json2xml"]),
46-
setup_requires=setup_requirements,
47-
test_suite="tests",
48-
tests_require=test_requirements,
49-
url="https://github.com/vinitkumar/json2xml",
50-
version=__version__,
51-
zip_safe=False,
52-
python_requires=">=3.10",
53-
)
3+
setup()

tests/test_json2xml.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,8 @@
1313
InvalidDataError,
1414
JSONReadError,
1515
StringReadError,
16-
URLReadError,
1716
readfromjson,
1817
readfromstring,
19-
readfromurl,
2018
)
2119

2220

0 commit comments

Comments
 (0)