diff -Nru python-fastbencode-0.0.12/debian/changelog python-fastbencode-0.2/debian/changelog --- python-fastbencode-0.0.12/debian/changelog 2022-09-24 23:01:11.000000000 +0000 +++ python-fastbencode-0.2/debian/changelog 2023-02-11 14:03:04.000000000 +0000 @@ -1,3 +1,9 @@ +python-fastbencode (0.2-1) unstable; urgency=low + + * New upstream release. + + -- Jelmer Vernooij Sat, 11 Feb 2023 14:03:04 +0000 + python-fastbencode (0.0.12-1) unstable; urgency=low * New upstream release. diff -Nru python-fastbencode-0.0.12/disperse.conf python-fastbencode-0.2/disperse.conf --- python-fastbencode-0.0.12/disperse.conf 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/disperse.conf 2022-10-11 18:55:33.000000000 +0000 @@ -0,0 +1,8 @@ +# See https://github.com/jelmer/disperse +timeout_days: 5 +tag_name: "v$VERSION" +verify_command: "python3 -m unittest fastbencode.tests.test_suite" +update_version { + path: "fastbencode/__init__.py" + new_line: '__version__ = $TUPLED_VERSION' +} diff -Nru python-fastbencode-0.0.12/fastbencode/__init__.py python-fastbencode-0.2/fastbencode/__init__.py --- python-fastbencode-0.0.12/fastbencode/__init__.py 2022-09-24 23:00:54.000000000 +0000 +++ python-fastbencode-0.2/fastbencode/__init__.py 2023-02-11 13:50:44.000000000 +0000 @@ -19,6 +19,9 @@ from typing import Type +__version__ = (0, 2) + + _extension_load_failures = [] diff -Nru python-fastbencode-0.0.12/fastbencode/tests/test_bencode.py python-fastbencode-0.2/fastbencode/tests/test_bencode.py --- python-fastbencode-0.0.12/fastbencode/tests/test_bencode.py 2021-08-18 22:44:45.000000000 +0000 +++ python-fastbencode-0.2/fastbencode/tests/test_bencode.py 2023-02-11 13:50:44.000000000 +0000 @@ -67,8 +67,7 @@ yield suite elif isinstance(suite, TestSuite): for item in suite: - for r in iter_suite_tests(item): - yield r + yield from iter_suite_tests(item) else: raise Exception('unknown type %r for object %r' % (type(suite), suite)) @@ -108,7 +107,7 @@ test. :return: The adapted test. """ - new_id = "%s(%s)" % (test.id(), scenario[0]) + new_id = "{}({})".format(test.id(), scenario[0]) new_test = clone_test(test, new_id) for name, value in scenario[1].items(): setattr(new_test, name, value) @@ -211,7 +210,7 @@ 'fastbencode._bencode_pyx') -class RecursionLimit(object): +class RecursionLimit: """Context manager that lowers recursion limit for testing.""" def __init__(self, limit=100): @@ -343,7 +342,7 @@ self._run_check_error(TypeError, None) self._run_check_error(TypeError, lambda x: x) self._run_check_error(TypeError, object) - self._run_check_error(TypeError, u"ie") + self._run_check_error(TypeError, "ie") def test_decoder_type_error(self): self.assertRaises(TypeError, self.module.bdecode, 1) diff -Nru python-fastbencode-0.0.12/fastbencode.egg-info/dependency_links.txt python-fastbencode-0.2/fastbencode.egg-info/dependency_links.txt --- python-fastbencode-0.0.12/fastbencode.egg-info/dependency_links.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/fastbencode.egg-info/dependency_links.txt 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1 @@ + diff -Nru python-fastbencode-0.0.12/fastbencode.egg-info/PKG-INFO python-fastbencode-0.2/fastbencode.egg-info/PKG-INFO --- python-fastbencode-0.0.12/fastbencode.egg-info/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/fastbencode.egg-info/PKG-INFO 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1,50 @@ +Metadata-Version: 2.1 +Name: fastbencode +Version: 0.2 +Summary: Implementation of bencode with optional fast C extensions +Home-page: https://github.com/breezy-team/fastbencode +Maintainer: Breezy Developers +Maintainer-email: breezy-core@googlegroups.com +License: GPLv2 or later +Project-URL: GitHub, https://github.com/breezy-team/fastbencode +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Requires-Python: >=3.7 +Provides-Extra: cext +License-File: COPYING + +fastbencode +=========== + +fastbencode is an implementation of the bencode serialization format originally +used by BitTorrent. + +The package includes both a pure-Python version and an optional C extension +based on Cython. Both provide the same functionality, but the C extension +provides significantly better performance. + +Example: + + >>> from fastbencode import bencode, bdecode + >>> bencode([1, 2, b'a', {b'd': 3}]) + b'li1ei2e1:ad1:di3eee' + >>> bdecode(bencode([1, 2, b'a', {b'd': 3}])) + [1, 2, b'a', {b'd': 3}] + +License +======= +fastbencode is available under the GNU GPL, version 2 or later. + +Copyright +========= + +* Original Pure-Python bencoder (c) Petru Paler +* Cython version and modifications (c) Canonical Ltd +* Split out from Bazaar/Breezy by Jelmer Vernooij diff -Nru python-fastbencode-0.0.12/fastbencode.egg-info/requires.txt python-fastbencode-0.2/fastbencode.egg-info/requires.txt --- python-fastbencode-0.0.12/fastbencode.egg-info/requires.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/fastbencode.egg-info/requires.txt 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1,3 @@ + +[cext] +cython>=0.29 diff -Nru python-fastbencode-0.0.12/fastbencode.egg-info/SOURCES.txt python-fastbencode-0.2/fastbencode.egg-info/SOURCES.txt --- python-fastbencode-0.0.12/fastbencode.egg-info/SOURCES.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/fastbencode.egg-info/SOURCES.txt 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1,27 @@ +.gitignore +CODE_OF_CONDUCT.md +COPYING +MANIFEST.in +README.md +SECURITY.md +disperse.conf +pyproject.toml +setup.cfg +setup.py +.github/workflows/disperse.yml +.github/workflows/pythonpackage.yml +.github/workflows/pythonpublish.yml +fastbencode/__init__.py +fastbencode/_bencode_py.py +fastbencode/_bencode_pyx.h +fastbencode/_bencode_pyx.pyi +fastbencode/_bencode_pyx.pyx +fastbencode/py.typed +fastbencode/python-compat.h +fastbencode.egg-info/PKG-INFO +fastbencode.egg-info/SOURCES.txt +fastbencode.egg-info/dependency_links.txt +fastbencode.egg-info/requires.txt +fastbencode.egg-info/top_level.txt +fastbencode/tests/__init__.py +fastbencode/tests/test_bencode.py \ No newline at end of file diff -Nru python-fastbencode-0.0.12/fastbencode.egg-info/top_level.txt python-fastbencode-0.2/fastbencode.egg-info/top_level.txt --- python-fastbencode-0.0.12/fastbencode.egg-info/top_level.txt 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/fastbencode.egg-info/top_level.txt 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1 @@ +fastbencode diff -Nru python-fastbencode-0.0.12/.github/workflows/pythonpackage.yml python-fastbencode-0.2/.github/workflows/pythonpackage.yml --- python-fastbencode-0.0.12/.github/workflows/pythonpackage.yml 2022-09-24 23:00:54.000000000 +0000 +++ python-fastbencode-0.2/.github/workflows/pythonpackage.yml 1970-01-01 00:00:00.000000000 +0000 @@ -1,32 +0,0 @@ -name: Python package - -on: [push, pull_request] - -jobs: - build: - - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, macos-latest, windows-latest] - python-version: [3.6, 3.7, 3.8, 3.9, '3.10'] - fail-fast: false - - steps: - - uses: actions/checkout@v2 - - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v2 - with: - python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install -U pip flake8 - - name: Style checks - run: | - python -m flake8 - - name: Test suite run - run: | - python -m unittest fastbencode.tests.test_suite - env: - PYTHONHASHSEED: random diff -Nru python-fastbencode-0.0.12/.gitignore python-fastbencode-0.2/.gitignore --- python-fastbencode-0.0.12/.gitignore 2021-08-18 22:48:10.000000000 +0000 +++ python-fastbencode-0.2/.gitignore 1970-01-01 00:00:00.000000000 +0000 @@ -1,8 +0,0 @@ -*.so -build -fastbencode/_bencode_pyx.c -fastbencode/_bencode_pyx.h -__pycache__ -fastbencode.egg-info -*.pyc -dist diff -Nru python-fastbencode-0.0.12/MANIFEST.in python-fastbencode-0.2/MANIFEST.in --- python-fastbencode-0.0.12/MANIFEST.in 2022-09-24 23:00:54.000000000 +0000 +++ python-fastbencode-0.2/MANIFEST.in 2023-02-11 13:50:44.000000000 +0000 @@ -1,3 +1,4 @@ include README.md include COPYING +include fastbencode/py.typed recursive-include fastbencode *.py *.pyx *.pxd *.h *.c diff -Nru python-fastbencode-0.0.12/PKG-INFO python-fastbencode-0.2/PKG-INFO --- python-fastbencode-0.0.12/PKG-INFO 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/PKG-INFO 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1,50 @@ +Metadata-Version: 2.1 +Name: fastbencode +Version: 0.2 +Summary: Implementation of bencode with optional fast C extensions +Home-page: https://github.com/breezy-team/fastbencode +Maintainer: Breezy Developers +Maintainer-email: breezy-core@googlegroups.com +License: GPLv2 or later +Project-URL: GitHub, https://github.com/breezy-team/fastbencode +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 +Classifier: Programming Language :: Python :: 3.9 +Classifier: Programming Language :: Python :: 3.10 +Classifier: Programming Language :: Python :: 3.11 +Classifier: Programming Language :: Python :: Implementation :: CPython +Classifier: Programming Language :: Python :: Implementation :: PyPy +Classifier: Operating System :: POSIX +Classifier: Operating System :: Microsoft :: Windows +Requires-Python: >=3.7 +Provides-Extra: cext +License-File: COPYING + +fastbencode +=========== + +fastbencode is an implementation of the bencode serialization format originally +used by BitTorrent. + +The package includes both a pure-Python version and an optional C extension +based on Cython. Both provide the same functionality, but the C extension +provides significantly better performance. + +Example: + + >>> from fastbencode import bencode, bdecode + >>> bencode([1, 2, b'a', {b'd': 3}]) + b'li1ei2e1:ad1:di3eee' + >>> bdecode(bencode([1, 2, b'a', {b'd': 3}])) + [1, 2, b'a', {b'd': 3}] + +License +======= +fastbencode is available under the GNU GPL, version 2 or later. + +Copyright +========= + +* Original Pure-Python bencoder (c) Petru Paler +* Cython version and modifications (c) Canonical Ltd +* Split out from Bazaar/Breezy by Jelmer Vernooij diff -Nru python-fastbencode-0.0.12/pyproject.toml python-fastbencode-0.2/pyproject.toml --- python-fastbencode-0.0.12/pyproject.toml 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/pyproject.toml 2022-10-19 08:31:10.000000000 +0000 @@ -0,0 +1,3 @@ +[build-system] +requires = ["setuptools", "cython>=0.29", "packaging"] +build-backend = "setuptools.build_meta" diff -Nru python-fastbencode-0.0.12/releaser.conf python-fastbencode-0.2/releaser.conf --- python-fastbencode-0.0.12/releaser.conf 2022-09-24 23:00:54.000000000 +0000 +++ python-fastbencode-0.2/releaser.conf 1970-01-01 00:00:00.000000000 +0000 @@ -1,10 +0,0 @@ -# See https://github.com/jelmer/releaser -timeout_days: 5 -tag_name: "v$VERSION" -verify_command: "python3 setup.py test" -github_url: "https://github.com/breezy-team/fastbencode" -update_version { - path: "setup.py" - match: "^ version=\"(.*)\",$" - new_line: ' version="$VERSION",' -} diff -Nru python-fastbencode-0.0.12/setup.cfg python-fastbencode-0.2/setup.cfg --- python-fastbencode-0.0.12/setup.cfg 1970-01-01 00:00:00.000000000 +0000 +++ python-fastbencode-0.2/setup.cfg 2023-02-11 13:50:44.000000000 +0000 @@ -0,0 +1,35 @@ +[metadata] +name = fastbencode +description = Implementation of bencode with optional fast C extensions +maintainer = Breezy Developers +maintainer_email = breezy-core@googlegroups.com +url = https://github.com/breezy-team/fastbencode +long_description = file:README.md +license = GPLv2 or later +version = attr:fastbencode.__version__ +project_urls = + GitHub = https://github.com/breezy-team/fastbencode +classifiers = + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: Implementation :: CPython + Programming Language :: Python :: Implementation :: PyPy + Operating System :: POSIX + Operating System :: Microsoft :: Windows + +[options] +python_requires = >=3.7 +packages = fastbencode +setup_requires = + cython>=0.29 + +[options.extras_require] +cext = cython>=0.29 + +[egg_info] +tag_build = +tag_date = 0 + diff -Nru python-fastbencode-0.0.12/setup.py python-fastbencode-0.2/setup.py --- python-fastbencode-0.0.12/setup.py 2022-09-24 23:00:54.000000000 +0000 +++ python-fastbencode-0.2/setup.py 2023-02-11 13:50:44.000000000 +0000 @@ -2,8 +2,11 @@ import os import sys -from setuptools import setup -from distutils.version import LooseVersion +from setuptools import setup, Extension +try: + from packaging.version import Version +except ImportError: + from distutils.version import LooseVersion as Version try: from Cython.Distutils import build_ext @@ -20,8 +23,8 @@ from distutils.command.build_ext import build_ext else: minimum_cython_version = '0.29' - cython_version_info = LooseVersion(cython_version) - if cython_version_info < LooseVersion(minimum_cython_version): + cython_version_info = Version(cython_version) + if cython_version_info < Version(minimum_cython_version): print("Version of Cython is too old. " "Current is %s, need at least %s." % (cython_version, minimum_cython_version)) @@ -32,54 +35,6 @@ have_cython = True -from distutils import log -from distutils.errors import CCompilerError, DistutilsPlatformError -from distutils.extension import Extension - - -class build_ext_if_possible(build_ext): - - user_options = build_ext.user_options + [ - ('allow-python-fallback', None, - "When an extension cannot be built, allow falling" - " back to the pure-python implementation.") - ] - - def initialize_options(self): - build_ext.initialize_options(self) - self.allow_python_fallback = False - - def run(self): - try: - build_ext.run(self) - except DistutilsPlatformError: - e = sys.exc_info()[1] - if not self.allow_python_fallback: - log.warn('\n Cannot build extensions.\n' - ' Use "build_ext --allow-python-fallback" to use' - ' slower python implementations instead.\n') - raise - log.warn(str(e)) - log.warn('\n Extensions cannot be built.\n' - ' Using the slower Python implementations instead.\n') - - def build_extension(self, ext): - try: - build_ext.build_extension(self, ext) - except CCompilerError: - if not self.allow_python_fallback: - log.warn('\n Cannot build extension "%s".\n' - ' Use "build_ext --allow-python-fallback" to use' - ' slower python implementations instead.\n' - % (ext.name,)) - raise - log.warn('\n Building of "%s" extension failed.\n' - ' Using the slower Python implementation instead.' - % (ext.name,)) - - -# Override the build_ext if we have Cython available - ext_modules = [] @@ -117,26 +72,11 @@ ext_modules.append( Extension( module_name, source, define_macros=define_macros, - libraries=libraries, include_dirs=include_dirs)) + libraries=libraries, include_dirs=include_dirs, + optional=os.environ.get('CIBUILDWHEEL', '0') != '1')) add_cython_extension('fastbencode._bencode_pyx') -with open('README.md', 'r') as f: - long_description = f.read() - -setup( - name="fastbencode", - description="Implementation of bencode with optional fast C extensions", - version="0.0.12", - long_description=long_description, - maintainer="Breezy Developers", - maintainer_email="breezy-core@googlegroups.com", - url="https://github.com/breezy-team/fastbencode", - ext_modules=ext_modules, - extras_require={'cext': ['cython>=0.29']}, - cmdclass={'build_ext': build_ext_if_possible}, - license="GPLv2 or later", - test_suite="fastbencode.tests.test_suite", - packages=["fastbencode"]) +setup(ext_modules=ext_modules, cmdclass={'build_ext': build_ext})