From 4a7aab7554009125b6262ce444293e9f6bb2d2f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Szczepan=20Cie=C5=9Blik?= Date: Tue, 19 Dec 2023 18:00:17 +0100 Subject: [PATCH] Add pyproject.toml --- jsonmodels/__init__.py | 3 -- pyproject.toml | 62 +++++++++++++++++++++++++++++ requirements.txt | 20 ---------- setup.cfg | 7 ---- setup.py | 89 ------------------------------------------ 5 files changed, 62 insertions(+), 119 deletions(-) create mode 100644 pyproject.toml delete mode 100644 requirements.txt delete mode 100644 setup.cfg delete mode 100755 setup.py diff --git a/jsonmodels/__init__.py b/jsonmodels/__init__.py index d5035e1..e69de29 100644 --- a/jsonmodels/__init__.py +++ b/jsonmodels/__init__.py @@ -1,3 +0,0 @@ -__author__ = "Szczepan Cieślik" -__email__ = "szczepan.cieslik@gmail.com" -__version__ = "2.7.0" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..4e2c4a7 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,62 @@ +[project] +name = "jsonmodels" +version = "2.7.0" +description="Models to make easier to deal with structures that are converted to, or read from JSON." +readme = "README.rst" +requires-python = ">=3.8" +license = {file = "LICENSE"} +dependencies = ["python-dateutil"] +classifiers=[ + "Intended Audience :: Developers", + "License :: OSI Approved :: BSD License", + "Natural Language :: English", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.8", + "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", + "Programming Language :: Python :: 3.11", + "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3 :: Only", +] +authors = [ + {name = "Szczepan Cieślik", email = "szczepan.cieslik@gmail.com"} +] + +[project.optional-dependencies] +dev = [ + "Jinja2", + "MarkupSafe", + "Pygments", + "Sphinx", + "coverage", + "docutils", + "flake8", + "flake8-pyproject", + "invoke", + "importlib-metadata==4.13.0", + "mccabe", + "pep8", + "py", + "pyflakes", + "pytest", + "pytest-cov", + "sphinxcontrib-spelling", + "tox", + "virtualenv", + "wheel", +] + +[project.urls] +"Home" = "https://github.com/jazzband/jsonmodels" + +[tool.flake8] +exclude = ["./docs/conf.py"] +max-complexity = 8 +max_line_length = 88 + +[tool.isort] +profile = "black" + +[build-system] +requires = ["setuptools>=43.0.0", "wheel"] +build-backend = "setuptools.build_meta" diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 6b732c1..0000000 --- a/requirements.txt +++ /dev/null @@ -1,20 +0,0 @@ --e . -Jinja2 -MarkupSafe -Pygments -Sphinx -coverage -docutils -flake8 -invoke -importlib-metadata==4.13.0 -mccabe -pep8 -py -pyflakes -pytest -pytest-cov -sphinxcontrib-spelling -tox -virtualenv -wheel diff --git a/setup.cfg b/setup.cfg deleted file mode 100644 index a620aad..0000000 --- a/setup.cfg +++ /dev/null @@ -1,7 +0,0 @@ -[flake8] -exclude = ./docs/conf.py -max-complexity = 8 -max_line_length = 88 - -[isort] -profile=black diff --git a/setup.py b/setup.py deleted file mode 100755 index 9d158ae..0000000 --- a/setup.py +++ /dev/null @@ -1,89 +0,0 @@ -#!/usr/bin/env python -import os -import sys - -from setuptools import setup -from setuptools.command.test import test as TestCommand - -from jsonmodels import __author__, __email__, __version__ - -PROJECT_NAME = "jsonmodels" - -if sys.argv[-1] == "publish": - os.system("python setup.py sdist upload") - sys.exit() - - -class PyTest(TestCommand): - user_options = [("pytest-args=", "a", "Arguments to pass to py.test")] - - def initialize_options(self): - TestCommand.initialize_options(self) - self.pytest_args = ["--cov", PROJECT_NAME] - - def finalize_options(self): - TestCommand.finalize_options(self) - self.test_args = [] - self.test_suite = True - - def run_tests(self): - import pytest - - errno = pytest.main(self.pytest_args) - sys.exit(errno) - - -# Hacking tests. -try: - import tests -except ImportError: - pass -else: - if "test" in sys.argv and "--no-lint" in sys.argv: - tests.LINT = False - del sys.argv[sys.argv.index("--no-lint")] - - if "test" in sys.argv and "--spelling" in sys.argv: - tests.CHECK_SPELLING = True - del sys.argv[sys.argv.index("--spelling")] - -readme = open("README.rst").read() -history = open("HISTORY.rst").read().replace(".. :changelog:", "") - -setup( - name=PROJECT_NAME, - version=__version__, - description="Models to make easier to deal with structures that" - " are converted to, or read from JSON.", - long_description=readme + "\n\n" + history, - author=__author__, - author_email=__email__, - url="https://github.com/jazzband/jsonmodels", - packages=[ - PROJECT_NAME, - ], - package_dir={PROJECT_NAME: PROJECT_NAME}, - include_package_data=True, - install_requires=[ - "python-dateutil", - ], - license="BSD", - zip_safe=False, - keywords=PROJECT_NAME, - python_requires=">=3.8", - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: BSD License", - "Natural Language :: English", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.11", - "Programming Language :: Python :: 3.12", - "Programming Language :: Python :: 3 :: Only", - ], - cmdclass={ - "test": PyTest, - }, -)