diff --git a/.gitignore b/.gitignore index 3071bb70..8a0eb032 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,6 @@ traceback*txt .coverage coverage.xml tags + +doc/_build +doc/README.rst diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index b96b1e81..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,15 +0,0 @@ -include debug_me.py -include try-the-debugger.sh -include example-*.py -include README.rst -include LICENSE - -include doc/*.rst -include doc/Makefile -include doc/*.py -include doc/conf.py -include doc/images/*.png - -include examples/*.py - -include manual-tests/*.py diff --git a/doc/.gitignore b/doc/.gitignore deleted file mode 100644 index fca9edb6..00000000 --- a/doc/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -_build -README.rst diff --git a/pudb/__init__.py b/pudb/__init__.py index b543480b..462c3810 100644 --- a/pudb/__init__.py +++ b/pudb/__init__.py @@ -24,13 +24,17 @@ """ +import re import sys +from importlib import metadata from pudb.settings import load_config -NUM_VERSION = (2024, 1, 2) -VERSION = ".".join(str(nv) for nv in NUM_VERSION) +VERSION = metadata.version("pudb") +_ver_match = re.match("^([0-9.]+)([a-z0-9]*?)$", VERSION) +assert _ver_match +NUM_VERSION = tuple(int(nr) for nr in _ver_match.group(1).split(".")) __version__ = VERSION diff --git a/pyproject.toml b/pyproject.toml index 58a19c6c..058fab83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,61 @@ +[build-system] +requires = ["hatchling"] +build-backend = "hatchling.build" + +[project] +name = "pudb" +version = "2024.1.2" +description = "A full-screen, console-based Python debugger" +readme = "README.rst" +license = "MIT" +requires-python = "~=3.8" +authors = [ + { name = "Andreas Kloeckner", email = "inform@tiker.net" }, +] +classifiers = [ + "Development Status :: 4 - Beta", + "Environment :: Console", + "Environment :: Console :: Curses", + "Intended Audience :: Developers", + "License :: OSI Approved :: MIT License", + "Natural Language :: English", + "Operating System :: POSIX", + "Operating System :: Unix", + "Programming Language :: Python", + "Programming Language :: Python :: 3", + "Topic :: Software Development", + "Topic :: Software Development :: Debuggers", + "Topic :: Software Development :: Quality Assurance", + "Topic :: System :: Recovery Tools", + "Topic :: System :: Software Distribution", + "Topic :: Terminals", + "Topic :: Utilities", +] +dependencies = [ + "jedi>=0.18,<1", + "packaging>=20.0", + "pygments>=2.7.4", + "urwid>=2.4", + "urwid_readline", +] + +[project.optional-dependencies] +completion = [ + "shtab", +] + +[project.scripts] +pudb = "pudb.run:main" + +[tool.hatch.build.targets.sdist] +include = [ + "/pudb", + "/doc", + "/try-the-debugger.sh", + "/debug_me.py", + "/examples", +] + [tool.ruff] preview = true diff --git a/setup.py b/setup.py deleted file mode 100644 index f79fe20f..00000000 --- a/setup.py +++ /dev/null @@ -1,58 +0,0 @@ -#!/usr/bin/env python - -from setuptools import find_packages, setup - -from pudb import VERSION - - -with open("README.rst") as readme: - long_description = str(readme.read()) - -setup( - name="pudb", - version=VERSION, - description="A full-screen, console-based Python debugger", - long_description=long_description, - author="Andreas Kloeckner", - author_email="inform@tiker.net", - python_requires="~=3.8", - install_requires=[ - "urwid>=2.4", - "pygments>=2.7.4", - "jedi>=0.18,<1", - "urwid_readline", - "packaging>=20.0", - ], - extras_require={"completion": ["shtab"]}, - test_requires=[ - "pytest>=2", - "pytest-mock", - ], - classifiers=[ - "Development Status :: 4 - Beta", - "Environment :: Console", - "Environment :: Console :: Curses", - "Intended Audience :: Developers", - "License :: OSI Approved :: MIT License", - "Natural Language :: English", - "Operating System :: POSIX", - "Operating System :: Unix", - "Programming Language :: Python", - "Programming Language :: Python :: 3", - "Topic :: Software Development", - "Topic :: Software Development :: Debuggers", - "Topic :: Software Development :: Quality Assurance", - "Topic :: System :: Recovery Tools", - "Topic :: System :: Software Distribution", - "Topic :: Terminals", - "Topic :: Utilities", - ], - packages=find_packages(), - entry_points={ - "console_scripts": [ - # Deprecated. Should really use python -m pudb. - "pudb = pudb.run:main", - ], - "gui_script": [], - }, -)