From de2bdfedbfdd88332e14243f7f947e63e26e1677 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 25 Apr 2025 10:16:22 +0200 Subject: [PATCH 1/4] Replace deprecated setuptools build-system This commit finishes migration to pyproject driven package creation by replacing deprecated build back-end by standardized, simple and fast `flit_core.buildapi`. An alternative build back-end may be hatchling, but it seems way more bloated with unnecessary features. - Dynamic Versioning A __version__ is added to pyte/__init__.py - as source for dynamic versioning, already specified in pyproject.toml - to follow defacto versioning standard used by most python packages. - obsolete files, related with setuptools are removed. - primary readme is README.rst. - .gitignore is updated to automatically exclude various cache files, created by build/linter/... tools. Creating package still works by just calling `uv build` with build artefacts being placed to dist/ directory. --- .gitignore | 14 ++++++++---- MANIFEST.in | 14 ------------ README | 59 ------------------------------------------------ README.rst | 58 ++++++++++++++++++++++++++++++++++++++++++++++- docs/Makefile | 2 +- pyproject.toml | 10 +++++--- pyte/__init__.py | 1 + setup.py | 48 --------------------------------------- 8 files changed, 76 insertions(+), 130 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 README delete mode 100755 setup.py diff --git a/.gitignore b/.gitignore index d0fa950..841145b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,12 @@ +# python cache +__pycache__/ *.pyc -build/ -dist/ -*.egg-info/ -.eggs/ + +# tool cache .pytest_cache/ +.mypy_cache/ +.venv/ +*.lock + +# build output +dist/ diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index 062a6bc..0000000 --- a/MANIFEST.in +++ /dev/null @@ -1,14 +0,0 @@ -include MANIFEST.in -include AUTHORS -include CHANGES -include LICENSE -include README - -include pyte/py.typed - -recursive-include docs *.rst -include docs/conf.py - -recursive-include examples *.py -recursive-include tests *.py -recursive-include tests/captured * diff --git a/README b/README deleted file mode 100644 index d6a20d7..0000000 --- a/README +++ /dev/null @@ -1,59 +0,0 @@ -.. -*- mode: rst -*- - -:: - - _ - | | - _ __ _ _ | |_ ___ - | '_ \ | | | || __|/ _ \ - | |_) || |_| || |_| __/ - | .__/ \__, | \__|\___| - | | __/ | - |_| |___/ 0.8.3dev - - -What is ``pyte``? ------------------ - -It's an in memory VTXXX-compatible terminal emulator. -*XXX* stands for a series of video terminals, developed by -`DEC `_ between -1970 and 1995. The first, and probably the most famous one, was VT100 -terminal, which is now a de-facto standard for all virtual terminal -emulators. ``pyte`` follows the suit. - -So, why would one need a terminal emulator library? - -* To screen scrape terminal apps, for example ``htop`` or ``aptitude``. -* To write cross platform terminal emulators; either with a graphical - (`xterm `_, - `rxvt `_) or a web interface, like - `AjaxTerm `_. -* To have fun, hacking on the ancient, poorly documented technologies. - -**Note**: ``pyte`` started as a fork of `vt102 `_, -which is an incomplete pure Python implementation of VT100 terminal. - - -Installation ------------- - -If you have `pip `_ you can do the usual:: - - pip install pyte - -Otherwise, download the source from `GitHub `_ -and run:: - - python setup.py install - -Similar projects ----------------- - -``pyte`` is not alone in the weird world of terminal emulator libraries, -here's a few other options worth checking out: -`Termemulator `_, -`pyqonsole `_, -`webtty `_, -`AjaxTerm `_ and of course -`vt102 `_. diff --git a/README.rst b/README.rst index 100b938..f541a4d 120000 --- a/README.rst +++ b/README.rst @@ -1 +1,57 @@ -README \ No newline at end of file +:: + + _ + | | + _ __ _ _ | |_ ___ + | '_ \ | | | || __|/ _ \ + | |_) || |_| || |_| __/ + | .__/ \__, | \__|\___| + | | __/ | + |_| |___/ 0.8.3dev + + +What is ``pyte``? +----------------- + +It's an in memory VTXXX-compatible terminal emulator. +*XXX* stands for a series of video terminals, developed by +`DEC `_ between +1970 and 1995. The first, and probably the most famous one, was VT100 +terminal, which is now a de-facto standard for all virtual terminal +emulators. ``pyte`` follows the suit. + +So, why would one need a terminal emulator library? + +* To screen scrape terminal apps, for example ``htop`` or ``aptitude``. +* To write cross platform terminal emulators; either with a graphical + (`xterm `_, + `rxvt `_) or a web interface, like + `AjaxTerm `_. +* To have fun, hacking on the ancient, poorly documented technologies. + +**Note**: ``pyte`` started as a fork of `vt102 `_, +which is an incomplete pure Python implementation of VT100 terminal. + + +Installation +------------ + +If you have `pip `_ you can do the usual:: + + pip install pyte + +Otherwise, download the source from `GitHub `_ +and run:: + + python setup.py install + +Similar projects +---------------- + +``pyte`` is not alone in the weird world of terminal emulator libraries, +here's a few other options worth checking out: +`Termemulator `_, +`pyqonsole `_, +`webtty `_, +`AjaxTerm `_ and of course +`vt102 `_. diff --git a/docs/Makefile b/docs/Makefile index 92b2a61..8f37be9 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -25,7 +25,7 @@ help: @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" diff --git a/pyproject.toml b/pyproject.toml index c44642c..9224fc1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,10 @@ [build-system] -requires = ["setuptools", "wheel"] -build-backend = "setuptools.build_meta" +requires = ["flit_core"] +build-backend = "flit_core.buildapi" + +[tool.flit.sdist] +include = ["docs/*.rst", "docs/*.py", "examples/", "tests/", "AUTHORS*", "CHANGES*", "LICENSE*"] +exclude = ["**/__pycache__/", "**/.*/", "*.lock"] [tool.mypy] show_error_codes = true @@ -22,7 +26,7 @@ dev = [ name = "pyte" dynamic = ["version"] description = "Simple VTXXX-compatible terminal emulator." -readme = "README" +readme = "README.rst" license = "LGPL-3.0-only" requires-python = ">=3.10" authors = [ diff --git a/pyte/__init__.py b/pyte/__init__.py index e004680..3ed11fd 100644 --- a/pyte/__init__.py +++ b/pyte/__init__.py @@ -21,6 +21,7 @@ see AUTHORS for details. :license: LGPL, see LICENSE for more details. """ +__version__ = "0.8.3.dev" __all__ = ("Screen", "DiffScreen", "HistoryScreen", "DebugScreen", "Stream", "ByteStream") diff --git a/setup.py b/setup.py deleted file mode 100755 index 98be8e7..0000000 --- a/setup.py +++ /dev/null @@ -1,48 +0,0 @@ -#! /usr/bin/env python - -import os - -from setuptools import setup - - -here = os.path.abspath(os.path.dirname(__file__)) - -DESCRIPTION = "Simple VTXXX-compatible terminal emulator." - -try: - with open(os.path.join(here, "README")) as f: - LONG_DESCRIPTION = f.read() -except OSError: - LONG_DESCRIPTION = "" - - -CLASSIFIERS = [ - "Development Status :: 5 - Production/Stable", - "Environment :: Console", - "Intended Audience :: Developers", - "Operating System :: OS Independent", - "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 :: Terminals :: Terminal Emulators/X Terminals", -] - - -setup(name="pyte", - version="0.8.3dev", - packages=["pyte"], - install_requires=["wcwidth"], - python_requires=">=3.10", - platforms=["any"], - package_data={"pyte": ["py.typed"]}, - - author="Sergei Lebedev", - author_email="superbobry@gmail.com", - description=DESCRIPTION, - long_description=LONG_DESCRIPTION, - classifiers=CLASSIFIERS, - keywords=["vt102", "vte", "terminal emulator"], - url="https://github.com/selectel/pyte") From 8919eb9569d68bd5aeb4a8a115790d2eabcb229a Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 25 Apr 2025 10:59:25 +0200 Subject: [PATCH 2/4] Ignore built docs --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 841145b..c8477b2 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,4 @@ __pycache__/ # build output dist/ +docs/_build/ From 811014830126cad58d8ce90f21712739dd5df85c Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 25 Apr 2025 12:08:53 +0200 Subject: [PATCH 3/4] Fix versions to comply with pep440 --- README.rst | 2 +- docs/conf.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index f541a4d..6490783 120000 --- a/README.rst +++ b/README.rst @@ -7,7 +7,7 @@ | |_) || |_| || |_| __/ | .__/ \__, | \__|\___| | | __/ | - |_| |___/ 0.8.3dev + |_| |___/ 0.8.3.dev What is ``pyte``? diff --git a/docs/conf.py b/docs/conf.py index 1d9fb46..784a1be 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -52,7 +52,7 @@ # The short X.Y version. version = '0.8.3' # The full version, including alpha/beta/rc tags. -release = '0.8.3dev' +release = '0.8.3.dev' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. From cde65eebc4d2eba80ded0759f03c5292541c0092 Mon Sep 17 00:00:00 2001 From: deathaxe Date: Fri, 25 Apr 2025 18:55:36 +0200 Subject: [PATCH 4/4] Fix README file-mode --- README.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 120000 => 100644 README.rst diff --git a/README.rst b/README.rst deleted file mode 120000 index 6490783..0000000 --- a/README.rst +++ /dev/null @@ -1,57 +0,0 @@ -:: - - _ - | | - _ __ _ _ | |_ ___ - | '_ \ | | | || __|/ _ \ - | |_) || |_| || |_| __/ - | .__/ \__, | \__|\___| - | | __/ | - |_| |___/ 0.8.3.dev - - -What is ``pyte``? ------------------ - -It's an in memory VTXXX-compatible terminal emulator. -*XXX* stands for a series of video terminals, developed by -`DEC `_ between -1970 and 1995. The first, and probably the most famous one, was VT100 -terminal, which is now a de-facto standard for all virtual terminal -emulators. ``pyte`` follows the suit. - -So, why would one need a terminal emulator library? - -* To screen scrape terminal apps, for example ``htop`` or ``aptitude``. -* To write cross platform terminal emulators; either with a graphical - (`xterm `_, - `rxvt `_) or a web interface, like - `AjaxTerm `_. -* To have fun, hacking on the ancient, poorly documented technologies. - -**Note**: ``pyte`` started as a fork of `vt102 `_, -which is an incomplete pure Python implementation of VT100 terminal. - - -Installation ------------- - -If you have `pip `_ you can do the usual:: - - pip install pyte - -Otherwise, download the source from `GitHub `_ -and run:: - - python setup.py install - -Similar projects ----------------- - -``pyte`` is not alone in the weird world of terminal emulator libraries, -here's a few other options worth checking out: -`Termemulator `_, -`pyqonsole `_, -`webtty `_, -`AjaxTerm `_ and of course -`vt102 `_. diff --git a/README.rst b/README.rst new file mode 100644 index 0000000..6490783 --- /dev/null +++ b/README.rst @@ -0,0 +1,57 @@ +:: + + _ + | | + _ __ _ _ | |_ ___ + | '_ \ | | | || __|/ _ \ + | |_) || |_| || |_| __/ + | .__/ \__, | \__|\___| + | | __/ | + |_| |___/ 0.8.3.dev + + +What is ``pyte``? +----------------- + +It's an in memory VTXXX-compatible terminal emulator. +*XXX* stands for a series of video terminals, developed by +`DEC `_ between +1970 and 1995. The first, and probably the most famous one, was VT100 +terminal, which is now a de-facto standard for all virtual terminal +emulators. ``pyte`` follows the suit. + +So, why would one need a terminal emulator library? + +* To screen scrape terminal apps, for example ``htop`` or ``aptitude``. +* To write cross platform terminal emulators; either with a graphical + (`xterm `_, + `rxvt `_) or a web interface, like + `AjaxTerm `_. +* To have fun, hacking on the ancient, poorly documented technologies. + +**Note**: ``pyte`` started as a fork of `vt102 `_, +which is an incomplete pure Python implementation of VT100 terminal. + + +Installation +------------ + +If you have `pip `_ you can do the usual:: + + pip install pyte + +Otherwise, download the source from `GitHub `_ +and run:: + + python setup.py install + +Similar projects +---------------- + +``pyte`` is not alone in the weird world of terminal emulator libraries, +here's a few other options worth checking out: +`Termemulator `_, +`pyqonsole `_, +`webtty `_, +`AjaxTerm `_ and of course +`vt102 `_.