Skip to content

Commit

Permalink
fix: ruff lint issues
Browse files Browse the repository at this point in the history
  • Loading branch information
vinitkumar committed Dec 13, 2024
1 parent 7f6ff6e commit 2b52fa2
Show file tree
Hide file tree
Showing 7 changed files with 317 additions and 73 deletions.
2 changes: 1 addition & 1 deletion json2xml/dicttoxml.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import numbers
from collections.abc import Callable, Sequence
from random import SystemRandom
from typing import Any, Dict, Union
from typing import Any, Union

from defusedxml.minidom import parseString

Expand Down
2 changes: 1 addition & 1 deletion json2xml/json2xml.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pyexpat import ExpatError
from typing import Any, Dict, Optional
from typing import Any

from defusedxml.minidom import parseString

Expand Down
1 change: 0 additions & 1 deletion json2xml/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""Utility methods for converting XML data to dictionary from various sources."""
import json
from typing import Dict, Optional

import urllib3

Expand Down
66 changes: 50 additions & 16 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,53 @@
[tool.ruff]
exclude = [
".env",
".venv",
"**/migrations/**",
[build-system]
requires = ["setuptools>=61.0"]
build-backend = "setuptools.build_meta"

[project]
name = "json2xml"
version = "3.21.0"
authors = [
{ name = "Vinit Kumar", email = "mail@vinitkumar.me" },
]
lint.ignore = [
"E501", # line too long
"F403", # 'from module import *' used; unable to detect undefined names
"E701", # multiple statements on one line (colon)
"F401", # module imported but unused
description = "Simple Python Library to convert JSON to XML"
readme = "README.rst"
license = { text = "Apache Software License 2.0" }
requires-python = ">=3.10"
classifiers = [
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
]
line-length = 119
lint.select = [
"I",
"E",
"F",
"W",
keywords = ["json2xml"]

dependencies = [
"defusedxml>=0.7.1",
"requests>=2.31.0"
]

[project.urls]
Homepage = "https://github.com/vinitkumar/json2xml"
Repository = "https://github.com/vinitkumar/json2xml.git"

[tool.setuptools]
packages = ["json2xml"]
include-package-data = true
zip-safe = false

[tool.pytest.ini_options]
testpaths = ["tests"]
python_files = ["test_*.py"]
addopts = "-ra -q"

[project.optional-dependencies]
test = [
"pytest==7.0.1",
"py==1.11.0"
]
54 changes: 2 additions & 52 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,53 +1,3 @@
#!/usr/bin/env python
from setuptools import setup

"""The setup script."""

from setuptools import setup, find_packages
from json2xml import __version__

with open("README.rst", encoding="utf-8") as readme_file:
readme = readme_file.read()

with open("HISTORY.rst", encoding="utf-8") as history_file:
history = history_file.read()

with open("requirements.in", encoding="utf-8") as requirements_in:
requirements = [requirements_in.read()]

setup_requirements = []

test_requirements = ["pytest==7.0.1", "py==1.11.0"]

setup(
author="Vinit Kumar",
author_email="mail@vinitkumar.me",
classifiers=[
"Development Status :: 6 - Mature",
"Intended Audience :: Developers",
"License :: OSI Approved :: Apache Software License",
"Natural Language :: English",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Software Development :: Libraries :: Python Modules",
],
description="Simple Python Library to convert JSON to XML",
install_requires=requirements,
license="Apache Software License 2.0",
long_description=readme + "\n\n" + history,
long_description_content_type="text/x-rst",
include_package_data=True,
keywords="json2xml",
name="json2xml",
packages=find_packages(include=["json2xml"]),
setup_requires=setup_requirements,
test_suite="tests",
tests_require=test_requirements,
url="https://github.com/vinitkumar/json2xml",
version=__version__,
zip_safe=False,
python_requires=">=3.10",
)
setup()
2 changes: 0 additions & 2 deletions tests/test_json2xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
InvalidDataError,
JSONReadError,
StringReadError,
URLReadError,
readfromjson,
readfromstring,
readfromurl,
)


Expand Down
Loading

0 comments on commit 2b52fa2

Please sign in to comment.