From 9c76232178b679f2214dfc846f4a2caf487859bb Mon Sep 17 00:00:00 2001 From: EnumDev Date: Fri, 25 Sep 2026 19:55:20 +0300 Subject: [PATCH] Initial commit --- .gitignore | 3 ++ check-version.sh | 9 ++++ info.yml | 23 ++++++++++ recipe.sh | 33 ++++++++++++++ source-files/python-1.13-compatibility.patch | 32 ++++++++++++++ source-files/use-pep-621-metadata.patch | 45 ++++++++++++++++++++ 6 files changed, 145 insertions(+) create mode 100644 .gitignore create mode 100644 check-version.sh create mode 100644 info.yml create mode 100644 recipe.sh create mode 100644 source-files/python-1.13-compatibility.patch create mode 100644 source-files/use-pep-621-metadata.patch diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9d96df7 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# Ignore BPM archives and signatures +*.bpm +*.bpm.sig diff --git a/check-version.sh b/check-version.sh new file mode 100644 index 0000000..7935d89 --- /dev/null +++ b/check-version.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +# Github repository +REPO="pexpect/ptyprocess" + +# Get tag name using Github Rest API +TAG_NAME=$(curl -s -L -H "X-GitHub-Api-Version: 2022-11-28" -H "Authorization: token ${GITHUB_API_TOKEN}" https://api.github.com/repos/"$REPO"/releases/latest | jq -r '.tag_name') + +echo "$TAG_NAME" diff --git a/info.yml b/info.yml new file mode 100644 index 0000000..de7db78 --- /dev/null +++ b/info.yml @@ -0,0 +1,23 @@ +name: python-ptyprocess +description: Run a subprocess in a pseudo terminal +version: 0.7.0 +revision: 1 +url: https://github.com/pexpect/ptyprocess +license: ISC +maintainers: + - enumdev@enumerated.dev +architecture: any +output_architecture: any +type: source +depends: + - python3=3.14.* +make_depends: + - python-build + - python-flit-core + - python-installer + - python-wheel +downloads: + - url: https://github.com/pexpect/ptyprocess/archive/refs/tags/${BPM_PKG_VERSION}.tar.gz + extract_to: ${BPM_SOURCE} + extract_strip_components: 1 + checksum: fdba7eb7833d8bbfb7cdab6d7a348fa0e393078324e406d0ebdad6ae93ed4209 diff --git a/recipe.sh b/recipe.sh new file mode 100644 index 0000000..a5c1739 --- /dev/null +++ b/recipe.sh @@ -0,0 +1,33 @@ +# This is the recipe.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +# The prepare function is executed in the root of the temp directory +# This function is used for putting downloaded files to the correct location or applying patches +prepare() { + cd "$BPM_SOURCE" + # Patches from Fedora + patch -Np1 -i "$BPM_WORKDIR"/python-1.13-compatibility.patch + patch -Np1 -i "$BPM_WORKDIR"/use-pep-621-metadata.patch +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + python -m build --wheel --no-isolation +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + python -m unittest discover -v +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + python -m installer --destdir="$BPM_OUTPUT" dist/*.whl + + # Install package license + install -Dm644 "$BPM_SOURCE"/LICENSE "$BPM_OUTPUT"/usr/share/licenses/python-ptyprocess/LICENSE +} diff --git a/source-files/python-1.13-compatibility.patch b/source-files/python-1.13-compatibility.patch new file mode 100644 index 0000000..a60a6be --- /dev/null +++ b/source-files/python-1.13-compatibility.patch @@ -0,0 +1,32 @@ +From a44312974bd9084aa568d2e18ce5b2a7e0e45983 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= +Date: Mon, 23 Oct 2023 15:18:02 +0200 +Subject: [PATCH] Remove unittest.makeSuite, gone from Python 3.13 + +See https://docs.python.org/3.13/whatsnew/3.13.html + +""" +Removed the following unittest functions, deprecated in Python 3.11: + + unittest.findTestCases() + unittest.makeSuite() + unittest.getTestCaseNames() +""" + +The removed call does not seem to have any effect when the file is executed +directly, run trough unittest discover or pytest. +--- + tests/test_invalid_binary.py | 3 --- + 1 file changed, 3 deletions(-) + +diff --git a/tests/test_invalid_binary.py b/tests/test_invalid_binary.py +index cf28098..545f9f7 100755 +--- a/tests/test_invalid_binary.py ++++ b/tests/test_invalid_binary.py +@@ -69,6 +69,3 @@ def test_invalid_binary(self): + + if __name__ == '__main__': + unittest.main() +- +-suite = unittest.makeSuite(InvalidBinaryChars,'test') +- diff --git a/source-files/use-pep-621-metadata.patch b/source-files/use-pep-621-metadata.patch new file mode 100644 index 0000000..47c642b --- /dev/null +++ b/source-files/use-pep-621-metadata.patch @@ -0,0 +1,45 @@ +From a4fe40cd2d41363d3915cf00b4607e1cf2bb154f Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Fri, 7 Aug 2026 17:10:13 +0200 +Subject: [PATCH] Use PEP 621 metadata to fix flit-core-4 compatibility +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Signed-off-by: Michał Górny +--- + pyproject.toml | 17 ++++++++++------- + 1 file changed, 10 insertions(+), 7 deletions(-) + +diff --git a/pyproject.toml b/pyproject.toml +index 5228534..c8d7d3a 100644 +--- a/pyproject.toml ++++ b/pyproject.toml +@@ -1,13 +1,14 @@ + [build-system] +-requires = ["flit_core >=2,<4"] ++requires = ["flit_core >=2,<5"] + build-backend = "flit_core.buildapi" + +-[tool.flit.metadata] +-module = "ptyprocess" +-author = "Thomas Kluyver" +-author-email = "thomas@kluyver.me.uk" +-home-page = "https://github.com/pexpect/ptyprocess" +-description-file = "README.rst" ++[project] ++name = "ptyprocess" ++authors = [ ++ { name = "Thomas Kluyver", email = "thomas@kluyver.me.uk" }, ++] ++readme = "README.rst" ++dynamic = ["version", "description"] + classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", +@@ -22,3 +23,5 @@ classifiers = [ + "Topic :: Terminals" + ] + ++[project.urls] ++Homepage = "https://github.com/pexpect/ptyprocess"