././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.253215 jaraco_stream-3.0.4/0000755000175100001770000000000014661447524013752 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.coveragerc0000644000175100001770000000054514661447477016106 0ustar00runnerdocker[run] omit = # leading `*/` for pytest-dev/pytest-cov#456 */.tox/* disable_warnings = couldnt-parse [report] show_missing = True exclude_also = # Exclude common false positives per # https://coverage.readthedocs.io/en/latest/excluding.html#advanced-exclusion # Ref jaraco/skeleton#97 and jaraco/skeleton#135 class .*\bProtocol\): if TYPE_CHECKING: ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.editorconfig0000644000175100001770000000036614661447477016443 0ustar00runnerdockerroot = true [*] charset = utf-8 indent_style = tab indent_size = 4 insert_final_newline = true end_of_line = lf [*.py] indent_style = space max_line_length = 88 [*.{yml,yaml}] indent_style = space indent_size = 2 [*.rst] indent_style = space ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.249215 jaraco_stream-3.0.4/.github/0000755000175100001770000000000014661447524015312 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.github/dependabot.yml0000644000175100001770000000022414661447477020147 0ustar00runnerdockerversion: 2 updates: - package-ecosystem: "pip" directory: "/" schedule: interval: "daily" allow: - dependency-type: "all" ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.249215 jaraco_stream-3.0.4/.github/workflows/0000755000175100001770000000000014661447524017347 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.github/workflows/main.yml0000644000175100001770000000554614661447477021037 0ustar00runnerdockername: tests on: merge_group: push: branches-ignore: # temporary GH branches relating to merge queues (jaraco/skeleton#93) - gh-readonly-queue/** tags: # required if branches-ignore is supplied (jaraco/skeleton#103) - '**' pull_request: permissions: contents: read env: # Environment variable to support color support (jaraco/skeleton#66) FORCE_COLOR: 1 # Suppress noisy pip warnings PIP_DISABLE_PIP_VERSION_CHECK: 'true' PIP_NO_PYTHON_VERSION_WARNING: 'true' PIP_NO_WARN_SCRIPT_LOCATION: 'true' # Ensure tests can sense settings about the environment TOX_OVERRIDE: >- testenv.pass_env+=GITHUB_*,FORCE_COLOR jobs: test: strategy: # https://blog.jaraco.com/efficient-use-of-ci-resources/ matrix: python: - "3.8" - "3.12" platform: - ubuntu-latest - macos-latest - windows-latest include: - python: "3.9" platform: ubuntu-latest - python: "3.10" platform: ubuntu-latest - python: "3.11" platform: ubuntu-latest - python: pypy3.10 platform: ubuntu-latest runs-on: ${{ matrix.platform }} continue-on-error: ${{ matrix.python == '3.13' }} steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: python-version: ${{ matrix.python }} allow-prereleases: true - name: Install tox run: python -m pip install tox - name: Run run: tox collateral: strategy: fail-fast: false matrix: job: - diffcov - docs runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 with: fetch-depth: 0 - name: Setup Python uses: actions/setup-python@v4 with: python-version: 3.x - name: Install tox run: python -m pip install tox - name: Eval ${{ matrix.job }} run: tox -e ${{ matrix.job }} check: # This job does nothing and is only used for the branch protection if: always() needs: - test - collateral runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed uses: re-actors/alls-green@release/v1 with: jobs: ${{ toJSON(needs) }} release: permissions: contents: write needs: - check if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Python uses: actions/setup-python@v4 with: python-version: 3.x - name: Install tox run: python -m pip install tox - name: Run run: tox -e release env: TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.pre-commit-config.yaml0000644000175100001770000000016414661447477020243 0ustar00runnerdockerrepos: - repo: https://github.com/astral-sh/ruff-pre-commit rev: v0.5.6 hooks: - id: ruff - id: ruff-format ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/.readthedocs.yaml0000644000175100001770000000051614661447477017212 0ustar00runnerdockerversion: 2 python: install: - path: . extra_requirements: - doc # required boilerplate readthedocs/readthedocs.org#10401 build: os: ubuntu-lts-latest tools: python: latest # post-checkout job to ensure the clone isn't shallow jaraco/skeleton#114 jobs: post_checkout: - git fetch --unshallow || true ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/LICENSE0000644000175100001770000000177714661447477015002 0ustar00runnerdockerPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/NEWS.rst0000644000175100001770000000206114661447477015266 0ustar00runnerdockerv3.0.4 ====== Bugfixes -------- - Moved more_itertools into the dependencies. (#5) v3.0.3 ====== Refreshed package metadata. #3: Fixed issue in tests where the connection to the test server would fail on hosts where localhost resolved to ::1. Now the test server binds to IPv6 when available and appropriate. v3.0.2 ====== Rely on PEP 420 for namespace packages. v3.0.1 ====== Refresh package metadata. v3.0.0 ====== Require Python 3.6 or later. Adopt black for code style and other updates from jaraco/skeleton. 2.0 === Switch to `pkgutil namespace technique `_ for the ``jaraco`` namespace. 1.2 === Added ``jaraco.stream.Tee`` from jaraco.util 11. 1.1.2 ===== Refresh packaging. 1.1.1 ===== #2: Fixed issue where ``gzip.load_streams`` would get into an infinite loop at the end of every stream. 1.1 === Declared compatibility with Python 2.7 and gzip module now is also Python 2.7 compatible. 1.0 === Initial release with gzip and buffer module. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.253215 jaraco_stream-3.0.4/PKG-INFO0000644000175100001770000000423114661447524015047 0ustar00runnerdockerMetadata-Version: 2.1 Name: jaraco.stream Version: 3.0.4 Summary: routines for dealing with data streams Author-email: "Jason R. Coombs" Project-URL: Source, https://github.com/jaraco/jaraco.stream Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Requires-Python: >=3.8 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: more_itertools Provides-Extra: test Requires-Dist: pytest!=8.1.*,>=6; extra == "test" Provides-Extra: doc Requires-Dist: sphinx>=3.5; extra == "doc" Requires-Dist: jaraco.packaging>=9.3; extra == "doc" Requires-Dist: rst.linker>=1.9; extra == "doc" Requires-Dist: furo; extra == "doc" Requires-Dist: sphinx-lint; extra == "doc" Provides-Extra: check Requires-Dist: pytest-checkdocs>=2.4; extra == "check" Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check" Provides-Extra: cover Requires-Dist: pytest-cov; extra == "cover" Provides-Extra: enabler Requires-Dist: pytest-enabler>=2.2; extra == "enabler" Provides-Extra: type Requires-Dist: pytest-mypy; extra == "type" .. image:: https://img.shields.io/pypi/v/jaraco.stream.svg :target: https://pypi.org/project/jaraco.stream .. image:: https://img.shields.io/pypi/pyversions/jaraco.stream.svg .. image:: https://github.com/jaraco/jaraco.stream/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.stream/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff .. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest .. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton Routines for handling streaming data, including a set of generators for loading gzip data on the fly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/README.rst0000644000175100001770000000164614661447477015457 0ustar00runnerdocker.. image:: https://img.shields.io/pypi/v/jaraco.stream.svg :target: https://pypi.org/project/jaraco.stream .. image:: https://img.shields.io/pypi/pyversions/jaraco.stream.svg .. image:: https://github.com/jaraco/jaraco.stream/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.stream/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff .. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest .. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton Routines for handling streaming data, including a set of generators for loading gzip data on the fly. ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.249215 jaraco_stream-3.0.4/docs/0000755000175100001770000000000014661447524014702 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/docs/conf.py0000644000175100001770000000214214661447477016207 0ustar00runnerdockerextensions = [ 'sphinx.ext.autodoc', 'jaraco.packaging.sphinx', ] master_doc = "index" html_theme = "furo" # Link dates and other references in the changelog extensions += ['rst.linker'] link_files = { '../NEWS.rst': dict( using=dict(GH='https://github.com'), replace=[ dict( pattern=r'(Issue #|\B#)(?P\d+)', url='{package_url}/issues/{issue}', ), dict( pattern=r'(?m:^((?Pv?\d+(\.\d+){1,2}))\n[-=]+\n)', with_scm='{text}\n{rev[timestamp]:%d %b %Y}\n', ), dict( pattern=r'PEP[- ](?P\d+)', url='https://peps.python.org/pep-{pep_number:0>4}/', ), ], ) } # Be strict about any broken references nitpicky = True # Include Python intersphinx mapping to prevent failures # jaraco/skeleton#51 extensions += ['sphinx.ext.intersphinx'] intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), } # Preserve authored syntax for defaults autodoc_preserve_defaults = True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/docs/history.rst0000644000175100001770000000011614661447477017142 0ustar00runnerdocker:tocdepth: 2 .. _changes: History ******* .. include:: ../NEWS (links).rst ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/docs/index.rst0000644000175100001770000000052114661447477016550 0ustar00runnerdockerWelcome to |project| documentation! =================================== .. sidebar-links:: :home: :pypi: .. toctree:: :maxdepth: 1 history .. automodule:: jaraco.stream :members: :undoc-members: :show-inheritance: Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.245215 jaraco_stream-3.0.4/jaraco/0000755000175100001770000000000014661447524015211 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.249215 jaraco_stream-3.0.4/jaraco/stream/0000755000175100001770000000000014661447524016504 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/jaraco/stream/__init__.py0000644000175100001770000000065214661447477020627 0ustar00runnerdockerimport sys class Tee: """ Copy the standard output to a file, but continue to write it to stdout. """ def __init__(self, name, mode): self.file = open(name, mode) self.stdout = sys.stdout sys.stdout = self def __del__(self): sys.stdout = self.stdout self.file.close() def write(self, data): self.file.write(data) self.stdout.write(data) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/jaraco/stream/buffer.py0000644000175100001770000000620014661447477020334 0ustar00runnerdockerimport re import textwrap import logging log = logging.getLogger(__name__) class LineBuffer: r""" Buffer bytes read in from a connection and serve complete lines back. >>> b = LineBuffer() >>> len(b) 0 >>> b.feed(b'foo\nbar') >>> len(b) 7 >>> list(b.lines()) == [b'foo'] True >>> len(b) 3 >>> b.feed(b'bar\r\nbaz\n') >>> list(b.lines()) == [b'barbar', b'baz'] True >>> len(b) 0 The buffer will not perform any decoding. >>> b.feed(b'Ol\xe9\n') >>> list(b.lines()) == [b'Ol\xe9'] True The LineBuffer should also act as an iterable. >>> b.feed(b'iterate\nthis\n') >>> for line, expected in zip(b, [b'iterate', b'this']): ... assert line == expected """ line_sep_exp = re.compile(b'\r?\n') def __init__(self): self.buffer = b'' def feed(self, bytes): self.buffer += bytes def lines(self): lines = self.line_sep_exp.split(self.buffer) # save the last, unfinished, possibly empty line self.buffer = lines.pop() return iter(lines) def __iter__(self): return self.lines() def __len__(self): return len(self.buffer) class DecodingLineBuffer(LineBuffer): r""" Like LineBuffer, but decode the output (default assumes UTF-8). >>> utf8_word = b'Ol\xc3\xa9' >>> b = DecodingLineBuffer() >>> b.feed(b'bar\r\nbaz\n' + utf8_word + b'\n') >>> list(b.lines()) ['bar', 'baz', 'Ol\xe9'] >>> len(b) 0 Some clients will feed latin-1 or other encodings. If your client should support docoding from these clients (and not raise a UnicodeDecodeError), set errors='replace': >>> b = DecodingLineBuffer() >>> b.errors = 'replace' >>> b.feed(b'Ol\xe9\n') >>> list(b.lines()) == ['Ol\ufffd'] True >>> b = DecodingLineBuffer() >>> b.feed(b'Ol\xe9\n') >>> list(b.lines()) Traceback (most recent call last): ... UnicodeDecodeError: ... """ encoding = 'utf-8' errors = 'strict' def lines(self): for line in super(DecodingLineBuffer, self).lines(): try: yield line.decode(self.encoding, self.errors) except UnicodeDecodeError: self.handle_exception() def handle_exception(self): msg = textwrap.dedent( """ Unknown encoding encountered. See 'Decoding Input' in https://pypi.python.org/pypi/irc for details. """ ) log.warning(msg) raise class LenientDecodingLineBuffer(LineBuffer): r""" Like LineBuffer, but decode the output. First try UTF-8 and if that fails, use latin-1, which decodes all byte strings. >>> b = LenientDecodingLineBuffer() >>> utf8_word = b'Ol\xc3\xa9' >>> b.feed(utf8_word + b'\n') >>> b.feed(b'Ol\xe9\n') >>> list(b.lines()) ['Ol\xe9', 'Ol\xe9'] """ def lines(self): for line in super(LenientDecodingLineBuffer, self).lines(): try: yield line.decode('utf-8', 'strict') except UnicodeDecodeError: yield line.decode('latin-1') ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/jaraco/stream/gzip.py0000644000175100001770000000242014661447477020034 0ustar00runnerdocker""" Routines for reliably decompressing gzip streams in iterables. """ import zlib import itertools from more_itertools.more import peekable from . import buffer def read_chunks(stream, block_size=2**10): """ Given a byte stream with reader, yield chunks of block_size until the stream is consusmed. """ while True: chunk = stream.read(block_size) if not chunk: break yield chunk def load_stream(dc, chunks): """ Given a decompression stream and chunks, yield chunks of decompressed data until the compression window ends. """ while not dc.eof: res = dc.decompress(dc.unconsumed_tail + next(chunks)) yield res def load_streams(chunks): """ Given a gzipped stream of data, yield streams of decompressed data. """ chunks = peekable(chunks) while chunks: dc = zlib.decompressobj(wbits=zlib.MAX_WBITS | 16) yield load_stream(dc, chunks) if dc.unused_data: # pragma: no cover chunks = peekable(itertools.chain((dc.unused_data,), chunks)) def lines_from_stream(chunks): """ Given data in chunks, yield lines of text """ buf = buffer.DecodingLineBuffer() for chunk in chunks: buf.feed(chunk) yield from buf ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/jaraco/stream/test_gzip.py0000644000175100001770000000457514661447477021110 0ustar00runnerdockerimport json import threading import http.server import urllib.request import textwrap import io import gzip as stdgzip import socket import pytest from more_itertools.recipes import flatten, consume from jaraco.stream import gzip @pytest.fixture def gzipped_json(): """ A gzipped json doc. """ payload = textwrap.dedent( """ [ {"id": 1, "data": "foo"}, {"id": 2, "data": "bar"} ] """ ).lstrip() buffer = io.BytesIO() gz = stdgzip.GzipFile(mode='w', fileobj=buffer) gz.write(payload.encode()) gz.close() return bytes(buffer.getbuffer()) # copied from CPython 3.10 def _get_best_family(*address): infos = socket.getaddrinfo( *address, type=socket.SOCK_STREAM, flags=socket.AI_PASSIVE, ) family, type, proto, canonname, sockaddr = next(iter(infos)) return family, sockaddr class BestFamilyServer(http.server.HTTPServer): address_family, _ = _get_best_family(None, 8080) @pytest.fixture def gzip_server(gzipped_json): class MyHandler(http.server.BaseHTTPRequestHandler): def do_GET(s): s.send_response(200) s.send_header("Content-type", "application/octet-stream") s.end_headers() s.wfile.write(gzipped_json) host = '' port = 8080 addr = host, port httpd = BestFamilyServer(addr, MyHandler) url = 'http://localhost:{port}/'.format(**locals()) try: threading.Thread(target=httpd.serve_forever).start() yield url finally: httpd.shutdown() httpd.server_close() @pytest.fixture def gzip_stream(gzip_server): return urllib.request.urlopen(gzip_server) def test_lines_from_stream(gzip_stream): chunks = gzip.read_chunks(gzip_stream) streams = gzip.load_streams(chunks) lines = flatten(map(gzip.lines_from_stream, streams)) first_line = next(lines) assert first_line == '[' second_line = next(lines) result = json.loads(second_line.rstrip('\n,')) assert isinstance(result, dict) assert 'id' in result def test_lines_completes(gzip_stream): """ When reading lines from a gzip stream, the operation should complete when the stream is exhausted. """ chunks = gzip.read_chunks(gzip_stream) streams = gzip.load_streams(chunks) lines = flatten(map(gzip.lines_from_stream, streams)) consume(lines) ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.249215 jaraco_stream-3.0.4/jaraco.stream.egg-info/0000755000175100001770000000000014661447524020175 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272468.0 jaraco_stream-3.0.4/jaraco.stream.egg-info/PKG-INFO0000644000175100001770000000423114661447524021272 0ustar00runnerdockerMetadata-Version: 2.1 Name: jaraco.stream Version: 3.0.4 Summary: routines for dealing with data streams Author-email: "Jason R. Coombs" Project-URL: Source, https://github.com/jaraco/jaraco.stream Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Requires-Python: >=3.8 Description-Content-Type: text/x-rst License-File: LICENSE Requires-Dist: more_itertools Provides-Extra: test Requires-Dist: pytest!=8.1.*,>=6; extra == "test" Provides-Extra: doc Requires-Dist: sphinx>=3.5; extra == "doc" Requires-Dist: jaraco.packaging>=9.3; extra == "doc" Requires-Dist: rst.linker>=1.9; extra == "doc" Requires-Dist: furo; extra == "doc" Requires-Dist: sphinx-lint; extra == "doc" Provides-Extra: check Requires-Dist: pytest-checkdocs>=2.4; extra == "check" Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check" Provides-Extra: cover Requires-Dist: pytest-cov; extra == "cover" Provides-Extra: enabler Requires-Dist: pytest-enabler>=2.2; extra == "enabler" Provides-Extra: type Requires-Dist: pytest-mypy; extra == "type" .. image:: https://img.shields.io/pypi/v/jaraco.stream.svg :target: https://pypi.org/project/jaraco.stream .. image:: https://img.shields.io/pypi/pyversions/jaraco.stream.svg .. image:: https://github.com/jaraco/jaraco.stream/actions/workflows/main.yml/badge.svg :target: https://github.com/jaraco/jaraco.stream/actions?query=workflow%3A%22tests%22 :alt: tests .. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json :target: https://github.com/astral-sh/ruff :alt: Ruff .. .. image:: https://readthedocs.org/projects/PROJECT_RTD/badge/?version=latest .. :target: https://PROJECT_RTD.readthedocs.io/en/latest/?badge=latest .. image:: https://img.shields.io/badge/skeleton-2024-informational :target: https://blog.jaraco.com/skeleton Routines for handling streaming data, including a set of generators for loading gzip data on the fly. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272468.0 jaraco_stream-3.0.4/jaraco.stream.egg-info/SOURCES.txt0000644000175100001770000000103514661447524022060 0ustar00runnerdocker.coveragerc .editorconfig .pre-commit-config.yaml .readthedocs.yaml LICENSE NEWS.rst README.rst mypy.ini pyproject.toml pytest.ini ruff.toml towncrier.toml tox.ini .github/dependabot.yml .github/workflows/main.yml docs/conf.py docs/history.rst docs/index.rst jaraco.stream.egg-info/PKG-INFO jaraco.stream.egg-info/SOURCES.txt jaraco.stream.egg-info/dependency_links.txt jaraco.stream.egg-info/requires.txt jaraco.stream.egg-info/top_level.txt jaraco/stream/__init__.py jaraco/stream/buffer.py jaraco/stream/gzip.py jaraco/stream/test_gzip.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272468.0 jaraco_stream-3.0.4/jaraco.stream.egg-info/dependency_links.txt0000644000175100001770000000000114661447524024243 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272468.0 jaraco_stream-3.0.4/jaraco.stream.egg-info/requires.txt0000644000175100001770000000041614661447524022576 0ustar00runnerdockermore_itertools [check] pytest-checkdocs>=2.4 [check:sys_platform != "cygwin"] pytest-ruff>=0.2.1 [cover] pytest-cov [doc] sphinx>=3.5 jaraco.packaging>=9.3 rst.linker>=1.9 furo sphinx-lint [enabler] pytest-enabler>=2.2 [test] pytest!=8.1.*,>=6 [type] pytest-mypy ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272468.0 jaraco_stream-3.0.4/jaraco.stream.egg-info/top_level.txt0000644000175100001770000000000714661447524022724 0ustar00runnerdockerjaraco ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/mypy.ini0000644000175100001770000000060514661447477015461 0ustar00runnerdocker[mypy] # Is the project well-typed? strict = False # Early opt-in even when strict = False warn_unused_ignores = True warn_redundant_casts = True enable_error_code = ignore-without-code # Support namespace packages per https://github.com/python/mypy/issues/14057 explicit_package_bases = True # Disable overload-overlap due to many false-positives disable_error_code = overload-overlap ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/pyproject.toml0000644000175100001770000000216714661447477016703 0ustar00runnerdocker[build-system] requires = ["setuptools>=61.2", "setuptools_scm[toml]>=3.4.1"] build-backend = "setuptools.build_meta" [project] name = "jaraco.stream" authors = [ { name = "Jason R. Coombs", email = "jaraco@jaraco.com" }, ] description = "routines for dealing with data streams" readme = "README.rst" classifiers = [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", ] requires-python = ">=3.8" dependencies = [ "more_itertools", ] dynamic = ["version"] [project.urls] Source = "https://github.com/jaraco/jaraco.stream" [project.optional-dependencies] test = [ # upstream "pytest >= 6, != 8.1.*", # local ] doc = [ # upstream "sphinx >= 3.5", "jaraco.packaging >= 9.3", "rst.linker >= 1.9", "furo", "sphinx-lint", # local ] check = [ "pytest-checkdocs >= 2.4", "pytest-ruff >= 0.2.1; sys_platform != 'cygwin'", ] cover = [ "pytest-cov", ] enabler = [ "pytest-enabler >= 2.2", ] type = [ # upstream "pytest-mypy", # local ] [tool.setuptools_scm] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/pytest.ini0000644000175100001770000000111014661447477016003 0ustar00runnerdocker[pytest] norecursedirs=dist build .tox .eggs addopts= --doctest-modules --import-mode importlib consider_namespace_packages=true filterwarnings= ## upstream # Ensure ResourceWarnings are emitted default::ResourceWarning # realpython/pytest-mypy#152 ignore:'encoding' argument not specified::pytest_mypy # python/cpython#100750 ignore:'encoding' argument not specified::platform # pypa/build#615 ignore:'encoding' argument not specified::build.env # dateutil/dateutil#1284 ignore:datetime.datetime.utcfromtimestamp:DeprecationWarning:dateutil.tz.tz ## end upstream ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/ruff.toml0000644000175100001770000000102014661447477015611 0ustar00runnerdocker[lint] extend-select = [ "C901", "PERF401", "W", ] ignore = [ # https://docs.astral.sh/ruff/formatter/#conflicting-lint-rules "W191", "E111", "E114", "E117", "D206", "D300", "Q000", "Q001", "Q002", "Q003", "COM812", "COM819", "ISC001", "ISC002", ] [format] # Enable preview to get hugged parenthesis unwrapping and other nice surprises # See https://github.com/jaraco/skeleton/pull/133#issuecomment-2239538373 preview = true # https://docs.astral.sh/ruff/settings/#format_quote-style quote-style = "preserve" ././@PaxHeader0000000000000000000000000000003300000000000010211 xustar0027 mtime=1724272468.253215 jaraco_stream-3.0.4/setup.cfg0000644000175100001770000000004614661447524015573 0ustar00runnerdocker[egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/towncrier.toml0000644000175100001770000000005414661447477016671 0ustar00runnerdocker[tool.towncrier] title_format = "{version}" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1724272447.0 jaraco_stream-3.0.4/tox.ini0000644000175100001770000000255214661447477015300 0ustar00runnerdocker[testenv] description = perform primary checks (tests, style, types, coverage) deps = setenv = PYTHONWARNDEFAULTENCODING = 1 commands = pytest {posargs} usedevelop = True extras = test check cover enabler type [testenv:diffcov] description = run tests and check that diff from main is covered deps = {[testenv]deps} diff-cover commands = pytest {posargs} --cov-report xml diff-cover coverage.xml --compare-branch=origin/main --html-report diffcov.html diff-cover coverage.xml --compare-branch=origin/main --fail-under=100 [testenv:docs] description = build the documentation extras = doc test changedir = docs commands = python -m sphinx -W --keep-going . {toxinidir}/build/html python -m sphinxlint \ # workaround for sphinx-contrib/sphinx-lint#83 --jobs 1 [testenv:finalize] description = assemble changelog and tag a release skip_install = True deps = towncrier jaraco.develop >= 7.23 pass_env = * commands = python -m jaraco.develop.finalize [testenv:release] description = publish the package to PyPI and GitHub skip_install = True deps = build twine>=3 jaraco.develop>=7.1 pass_env = TWINE_PASSWORD GITHUB_TOKEN setenv = TWINE_USERNAME = {env:TWINE_USERNAME:__token__} commands = python -c "import shutil; shutil.rmtree('dist', ignore_errors=True)" python -m build python -m twine upload dist/* python -m jaraco.develop.create-github-release