Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-requests-unixsocket for openSUSE:Factory checked in at 2022-01-11 21:17:11 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-requests-unixsocket (Old) and /work/SRC/openSUSE:Factory/.python-requests-unixsocket.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-requests-unixsocket" Tue Jan 11 21:17:11 2022 rev:4 rq:945426 version:0.3.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-requests-unixsocket/python-requests-unixsocket.changes 2019-09-02 13:20:19.869366431 +0200 +++ /work/SRC/openSUSE:Factory/.python-requests-unixsocket.new.1892/python-requests-unixsocket.changes 2022-01-11 21:20:32.905012796 +0100 @@ -1,0 +2,18 @@ +Mon Jan 10 22:30:46 UTC 2022 - Dirk M??ller <dmuel...@suse.com> + +- update to 0.3.0: + * Remove urllib3 dep + * Update setup.cfg metadata - => \_ + * Remove Vagrantfile + * Remove .travis.yml + * Update tox to work + * README.rst: Update badge from Travis => GH + * Fix warning from waitress + * Add GitHub Actions tests + * Remove --pep8 option to pytest + * Bump waitress from 1.4.2 to 1.4.3 + * Bump py from 1.4.32 to 1.10.0 + * Bump waitress from 0.9.0 to 1.4.2 + * Allow UnixAdapter to accept max\_retries parameter + +------------------------------------------------------------------- Old: ---- requests-unixsocket-0.2.0.tar.gz New: ---- requests-unixsocket-0.3.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-requests-unixsocket.spec ++++++ --- /var/tmp/diff_new_pack.JBhxjQ/_old 2022-01-11 21:20:33.357013113 +0100 +++ /var/tmp/diff_new_pack.JBhxjQ/_new 2022-01-11 21:20:33.361013116 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-requests-unixsocket # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2022 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,7 +18,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-requests-unixsocket -Version: 0.2.0 +Version: 0.3.0 Release: 0 Summary: UNIX domain socket backend for python-requests License: Apache-2.0 @@ -30,12 +30,10 @@ BuildRequires: fdupes BuildRequires: python-rpm-macros Requires: python-requests >= 1.1 -Requires: python-urllib3 >= 1.8 BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module pytest} BuildRequires: %{python_module requests >= 1.1} -BuildRequires: %{python_module urllib3 >= 1.8} BuildRequires: %{python_module waitress} # /SECTION %python_subpackages ++++++ requests-unixsocket-0.2.0.tar.gz -> requests-unixsocket-0.3.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/.github/workflows/tests.yml new/requests-unixsocket-0.3.0/.github/workflows/tests.yml --- old/requests-unixsocket-0.2.0/.github/workflows/tests.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/requests-unixsocket-0.3.0/.github/workflows/tests.yml 2021-12-24 00:44:46.000000000 +0100 @@ -0,0 +1,41 @@ +name: Run tests + +on: + push: + # branches: + # - "master" + pull_request: + # branches: + # - "master" +jobs: + test: + runs-on: ubuntu-latest + + strategy: + matrix: + # Run in all these versions of Python + python-version: ['3.7', '3.8', '3.9', '3.10'] + + steps: + # Checkout the latest code from the repo + - name: Checkout repo + uses: actions/checkout@v2 + # Setup which version of Python to use + - name: Set Up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + # Display the Python version being used + - name: Display Python version + run: python -c "import sys; print(sys.version)" + # Install the package using the setup.py + - name: Install package + run: python setup.py install + # Install pytest (you can use some other testing utility) + - name: Install deps + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt -r test-requirements.txt + # Run the tests. I'm using pytest and the file is in the tests directory. + - name: Run tests + run: pytest requests_unixsocket/tests diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/.python-version new/requests-unixsocket-0.3.0/.python-version --- old/requests-unixsocket-0.2.0/.python-version 1970-01-01 01:00:00.000000000 +0100 +++ new/requests-unixsocket-0.3.0/.python-version 2021-12-24 00:56:28.000000000 +0100 @@ -0,0 +1,4 @@ +3.7.12 +3.8.1 +3.9.9 +3.10.1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/.travis.yml new/requests-unixsocket-0.3.0/.travis.yml --- old/requests-unixsocket-0.2.0/.travis.yml 2019-08-16 00:13:11.000000000 +0200 +++ new/requests-unixsocket-0.3.0/.travis.yml 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -language: python -matrix: - include: - - python: 2.7 - sudo: true - env: TOXENV=py27 - - python: 3.4 - sudo: true - env: TOXENV=py34 - - python: 3.5 - sudo: true - env: TOXENV=py35 - - python: 3.6 - sudo: true - env: TOXENV=py36 - - python: 3.7 - dist: xenial - sudo: true - env: TOXENV=py37 - -install: - - travis_retry pip install tox - -script: - - tox diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/AUTHORS new/requests-unixsocket-0.3.0/AUTHORS --- old/requests-unixsocket-0.2.0/AUTHORS 2019-08-16 00:52:02.000000000 +0200 +++ new/requests-unixsocket-0.3.0/AUTHORS 2021-12-24 02:37:13.000000000 +0100 @@ -9,3 +9,4 @@ Tomaz Solc <tomaz.s...@tablix.org> Will Rouesnel <w.roues...@gmail.com> William Rouesnel <william.roues...@netregistry.com.au> +dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/ChangeLog new/requests-unixsocket-0.3.0/ChangeLog --- old/requests-unixsocket-0.2.0/ChangeLog 2019-08-16 00:52:02.000000000 +0200 +++ new/requests-unixsocket-0.3.0/ChangeLog 2021-12-24 02:37:13.000000000 +0100 @@ -1,6 +1,23 @@ CHANGES ======= +0.3.0 +----- + +* Remove urllib3 dep +* Update setup.cfg metadata - => \_ +* Remove Vagrantfile +* Remove .travis.yml +* Update tox to work +* README.rst: Update badge from Travis => GH +* Fix warning from waitress +* Add GitHub Actions tests +* Remove --pep8 option to pytest +* Bump waitress from 1.4.2 to 1.4.3 +* Bump py from 1.4.32 to 1.10.0 +* Bump waitress from 0.9.0 to 1.4.2 +* Allow UnixAdapter to accept max\_retries parameter + 0.2.0 ----- @@ -37,12 +54,12 @@ * Non case sensitive url comparison in tests * Pull in more recent code from docker-py * Fix PyPI badge -* Override HTTPAdapter.request_url +* Override HTTPAdapter.request\_url 0.1.5 ----- -* Fix test_unix_domain_adapter_connection_proxies_error +* Fix test\_unix\_domain\_adapter\_connection\_proxies\_error * .travis.yml tweaks * Remove py32; Add py35 * Only reject proxies if they are relevant (which should be never) @@ -71,7 +88,7 @@ * Tweak monkeypatch code * Move/expose testutils like UnixSocketServerThread -* Make monkeypatch url_scheme arg optional +* Make monkeypatch url\_scheme arg optional 0.1.1 ----- diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/PKG-INFO new/requests-unixsocket-0.3.0/PKG-INFO --- old/requests-unixsocket-0.2.0/PKG-INFO 2019-08-16 00:52:04.000000000 +0200 +++ new/requests-unixsocket-0.3.0/PKG-INFO 2021-12-24 02:37:14.483055800 +0100 @@ -1,102 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: requests-unixsocket -Version: 0.2.0 +Version: 0.3.0 Summary: Use requests to talk HTTP via a UNIX domain socket Home-page: https://github.com/msabramo/requests-unixsocket Author: Marc Abramowitz Author-email: m...@marc-abramowitz.com License: Apache-2 -Description: requests-unixsocket - =================== - - .. image:: https://badge.fury.io/py/requests-unixsocket.svg - :target: https://badge.fury.io/py/requests-unixsocket - :alt: Latest Version on PyPI - - .. image:: https://travis-ci.org/msabramo/requests-unixsocket.svg?branch=master - :target: https://travis-ci.org/msabramo/requests-unixsocket - - Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket - - Usage - ----- - - Explicit - ++++++++ - - You can use it by instantiating a special ``Session`` object: - - .. code-block:: python - - import json - - import requests_unixsocket - - session = requests_unixsocket.Session() - - r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - registry_config = r.json()['RegistryConfig'] - print(json.dumps(registry_config, indent=4)) - - - Implicit (monkeypatching) - +++++++++++++++++++++++++ - - Monkeypatching allows you to use the functionality in this module, while making - minimal changes to your code. Note that in the above example we had to - instantiate a special ``requests_unixsocket.Session`` object and call the - ``get`` method on that object. Calling ``requests.get(url)`` (the easiest way - to use requests and probably very common), would not work. But we can make it - work by doing monkeypatching. - - You can monkeypatch globally: - - .. code-block:: python - - import requests_unixsocket - - requests_unixsocket.monkeypatch() - - r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - assert r.status_code == 200 - - or you can do it temporarily using a context manager: - - .. code-block:: python - - import requests_unixsocket - - with requests_unixsocket.monkeypatch(): - r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - assert r.status_code == 200 - - - Abstract namespace sockets - ++++++++++++++++++++++++++ - - To connect to an `abstract namespace - socket <https://utcc.utoronto.ca/~cks/space/blog/python/AbstractUnixSocketsAndPeercred>`_ - (Linux only), prefix the name with a NULL byte (i.e.: `\0`) - e.g.: - - .. code-block:: python - - import requests_unixsocket - - session = requests_unixsocket.Session() - res = session.get('http+unix://\0test_socket/get') - print(res.text) - - For an example program that illustrates this, see - ``examples/abstract_namespace.py`` in the git repo. Since abstract namespace - sockets are specific to Linux, the program will only work on Linux. - - - See also - -------- - - - https://github.com/httpie/httpie-unixsocket - a plugin for `HTTPie <https://httpie.org/>`_ that allows you to interact with UNIX domain sockets - - Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Developers @@ -111,3 +20,98 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +License-File: LICENSE +License-File: AUTHORS + +requests-unixsocket +=================== + +.. image:: https://badge.fury.io/py/requests-unixsocket.svg + :target: https://badge.fury.io/py/requests-unixsocket + :alt: Latest Version on PyPI + +.. image:: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml/badge.svg + :target: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml + +Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket + +Usage +----- + +Explicit +++++++++ + +You can use it by instantiating a special ``Session`` object: + +.. code-block:: python + + import json + + import requests_unixsocket + + session = requests_unixsocket.Session() + + r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + registry_config = r.json()['RegistryConfig'] + print(json.dumps(registry_config, indent=4)) + + +Implicit (monkeypatching) ++++++++++++++++++++++++++ + +Monkeypatching allows you to use the functionality in this module, while making +minimal changes to your code. Note that in the above example we had to +instantiate a special ``requests_unixsocket.Session`` object and call the +``get`` method on that object. Calling ``requests.get(url)`` (the easiest way +to use requests and probably very common), would not work. But we can make it +work by doing monkeypatching. + +You can monkeypatch globally: + +.. code-block:: python + + import requests_unixsocket + + requests_unixsocket.monkeypatch() + + r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + assert r.status_code == 200 + +or you can do it temporarily using a context manager: + +.. code-block:: python + + import requests_unixsocket + + with requests_unixsocket.monkeypatch(): + r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + assert r.status_code == 200 + + +Abstract namespace sockets +++++++++++++++++++++++++++ + +To connect to an `abstract namespace +socket <https://utcc.utoronto.ca/~cks/space/blog/python/AbstractUnixSocketsAndPeercred>`_ +(Linux only), prefix the name with a NULL byte (i.e.: `\0`) - e.g.: + +.. code-block:: python + + import requests_unixsocket + + session = requests_unixsocket.Session() + res = session.get('http+unix://\0test_socket/get') + print(res.text) + +For an example program that illustrates this, see +``examples/abstract_namespace.py`` in the git repo. Since abstract namespace +sockets are specific to Linux, the program will only work on Linux. + + +See also +-------- + +- https://github.com/httpie/httpie-unixsocket - a plugin for `HTTPie <https://httpie.org/>`_ that allows you to interact with UNIX domain sockets + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/README.rst new/requests-unixsocket-0.3.0/README.rst --- old/requests-unixsocket-0.2.0/README.rst 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/README.rst 2021-12-24 00:55:44.000000000 +0100 @@ -5,8 +5,8 @@ :target: https://badge.fury.io/py/requests-unixsocket :alt: Latest Version on PyPI -.. image:: https://travis-ci.org/msabramo/requests-unixsocket.svg?branch=master - :target: https://travis-ci.org/msabramo/requests-unixsocket +.. image:: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml/badge.svg + :target: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/Vagrantfile new/requests-unixsocket-0.3.0/Vagrantfile --- old/requests-unixsocket-0.2.0/Vagrantfile 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/Vagrantfile 1970-01-01 01:00:00.000000000 +0100 @@ -1,25 +0,0 @@ -# -*- mode: ruby -*- -# vi: set ft=ruby : - -Vagrant.configure("2") do |config| - config.vm.box = "ubuntu/xenial64" - config.ssh.shell = "bash -c 'BASH_ENV=/etc/profile exec bash'" - config.vm.provision "shell", inline: <<-SHELL - export DEBIAN_FRONTEND=noninteractive - sudo add-apt-repository -y ppa:fkrull/deadsnakes - sudo add-apt-repository ppa:pypy/ppa - apt-get update - apt-get install -y docker.io jq python2.6-dev python2.7-dev python3.3-dev python3.4-dev python3.5-dev python3.6-dev pypy-dev socat virtualenv - usermod --append --groups docker ubuntu - mkdir -p /home/ubuntu/.virtualenvs - if [ ! -d /home/ubuntu/.virtualenvs/requests-unixsocket ]; then - virtualenv --python=python3.6 /home/ubuntu/.virtualenvs/requests-unixsocket - /home/ubuntu/.virtualenvs/requests-unixsocket/bin/pip install -e /vagrant ipython tox - fi - chown -R ubuntu:ubuntu /home/ubuntu/.virtualenvs - grep -q 'source /home/ubuntu/.virtualenvs/requests-unixsocket/bin/activate' /home/ubuntu/.profile \ - || echo -e '\nsource /home/ubuntu/.virtualenvs/requests-unixsocket/bin/activate' >> /home/ubuntu/.profile - grep -q 'cd /vagrant' /home/ubuntu/.profile \ - || echo -e '\ncd /vagrant' >> /home/ubuntu/.profile - SHELL -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/pytest.ini new/requests-unixsocket-0.3.0/pytest.ini --- old/requests-unixsocket-0.2.0/pytest.ini 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/pytest.ini 2021-12-24 00:26:37.000000000 +0100 @@ -1,2 +1,2 @@ [pytest] -addopts = --tb=short --pep8 +addopts = --tb=short diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket/adapters.py new/requests-unixsocket-0.3.0/requests_unixsocket/adapters.py --- old/requests-unixsocket-0.2.0/requests_unixsocket/adapters.py 2019-08-16 00:50:29.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket/adapters.py 2021-12-24 00:26:37.000000000 +0100 @@ -56,13 +56,12 @@ class UnixAdapter(HTTPAdapter): - def __init__(self, timeout=60, pool_connections=25): - super(UnixAdapter, self).__init__() + def __init__(self, timeout=60, pool_connections=25, *args, **kwargs): + super(UnixAdapter, self).__init__(*args, **kwargs) self.timeout = timeout self.pools = urllib3._collections.RecentlyUsedContainer( pool_connections, dispose_func=lambda p: p.close() ) - super(UnixAdapter, self).__init__() def get_connection(self, url, proxies=None): proxies = proxies or {} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket/testutils.py new/requests-unixsocket-0.3.0/requests_unixsocket/testutils.py --- old/requests-unixsocket-0.2.0/requests_unixsocket/testutils.py 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket/testutils.py 2021-12-24 00:46:13.000000000 +0100 @@ -78,7 +78,11 @@ def run(self): logger.debug('Call waitress.serve in %r ...', self) wsgi_app = WSGIApp() - server = waitress.create_server(wsgi_app, unix_socket=self.usock) + server = waitress.create_server( + wsgi_app, + unix_socket=self.usock, + clear_untrusted_proxy_headers=True, + ) wsgi_app.server = server self.server = server self.server_ready_event.set() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/PKG-INFO new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/PKG-INFO --- old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/PKG-INFO 2019-08-16 00:52:02.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/PKG-INFO 2021-12-24 02:37:13.000000000 +0100 @@ -1,102 +1,11 @@ -Metadata-Version: 1.1 +Metadata-Version: 2.1 Name: requests-unixsocket -Version: 0.2.0 +Version: 0.3.0 Summary: Use requests to talk HTTP via a UNIX domain socket Home-page: https://github.com/msabramo/requests-unixsocket Author: Marc Abramowitz Author-email: m...@marc-abramowitz.com License: Apache-2 -Description: requests-unixsocket - =================== - - .. image:: https://badge.fury.io/py/requests-unixsocket.svg - :target: https://badge.fury.io/py/requests-unixsocket - :alt: Latest Version on PyPI - - .. image:: https://travis-ci.org/msabramo/requests-unixsocket.svg?branch=master - :target: https://travis-ci.org/msabramo/requests-unixsocket - - Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket - - Usage - ----- - - Explicit - ++++++++ - - You can use it by instantiating a special ``Session`` object: - - .. code-block:: python - - import json - - import requests_unixsocket - - session = requests_unixsocket.Session() - - r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - registry_config = r.json()['RegistryConfig'] - print(json.dumps(registry_config, indent=4)) - - - Implicit (monkeypatching) - +++++++++++++++++++++++++ - - Monkeypatching allows you to use the functionality in this module, while making - minimal changes to your code. Note that in the above example we had to - instantiate a special ``requests_unixsocket.Session`` object and call the - ``get`` method on that object. Calling ``requests.get(url)`` (the easiest way - to use requests and probably very common), would not work. But we can make it - work by doing monkeypatching. - - You can monkeypatch globally: - - .. code-block:: python - - import requests_unixsocket - - requests_unixsocket.monkeypatch() - - r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - assert r.status_code == 200 - - or you can do it temporarily using a context manager: - - .. code-block:: python - - import requests_unixsocket - - with requests_unixsocket.monkeypatch(): - r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') - assert r.status_code == 200 - - - Abstract namespace sockets - ++++++++++++++++++++++++++ - - To connect to an `abstract namespace - socket <https://utcc.utoronto.ca/~cks/space/blog/python/AbstractUnixSocketsAndPeercred>`_ - (Linux only), prefix the name with a NULL byte (i.e.: `\0`) - e.g.: - - .. code-block:: python - - import requests_unixsocket - - session = requests_unixsocket.Session() - res = session.get('http+unix://\0test_socket/get') - print(res.text) - - For an example program that illustrates this, see - ``examples/abstract_namespace.py`` in the git repo. Since abstract namespace - sockets are specific to Linux, the program will only work on Linux. - - - See also - -------- - - - https://github.com/httpie/httpie-unixsocket - a plugin for `HTTPie <https://httpie.org/>`_ that allows you to interact with UNIX domain sockets - - Platform: UNKNOWN Classifier: Development Status :: 3 - Alpha Classifier: Intended Audience :: Developers @@ -111,3 +20,98 @@ Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 +License-File: LICENSE +License-File: AUTHORS + +requests-unixsocket +=================== + +.. image:: https://badge.fury.io/py/requests-unixsocket.svg + :target: https://badge.fury.io/py/requests-unixsocket + :alt: Latest Version on PyPI + +.. image:: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml/badge.svg + :target: https://github.com/msabramo/requests-unixsocket/actions/workflows/tests.yml + +Use `requests <http://docs.python-requests.org/>`_ to talk HTTP via a UNIX domain socket + +Usage +----- + +Explicit +++++++++ + +You can use it by instantiating a special ``Session`` object: + +.. code-block:: python + + import json + + import requests_unixsocket + + session = requests_unixsocket.Session() + + r = session.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + registry_config = r.json()['RegistryConfig'] + print(json.dumps(registry_config, indent=4)) + + +Implicit (monkeypatching) ++++++++++++++++++++++++++ + +Monkeypatching allows you to use the functionality in this module, while making +minimal changes to your code. Note that in the above example we had to +instantiate a special ``requests_unixsocket.Session`` object and call the +``get`` method on that object. Calling ``requests.get(url)`` (the easiest way +to use requests and probably very common), would not work. But we can make it +work by doing monkeypatching. + +You can monkeypatch globally: + +.. code-block:: python + + import requests_unixsocket + + requests_unixsocket.monkeypatch() + + r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + assert r.status_code == 200 + +or you can do it temporarily using a context manager: + +.. code-block:: python + + import requests_unixsocket + + with requests_unixsocket.monkeypatch(): + r = requests.get('http+unix://%2Fvar%2Frun%2Fdocker.sock/info') + assert r.status_code == 200 + + +Abstract namespace sockets +++++++++++++++++++++++++++ + +To connect to an `abstract namespace +socket <https://utcc.utoronto.ca/~cks/space/blog/python/AbstractUnixSocketsAndPeercred>`_ +(Linux only), prefix the name with a NULL byte (i.e.: `\0`) - e.g.: + +.. code-block:: python + + import requests_unixsocket + + session = requests_unixsocket.Session() + res = session.get('http+unix://\0test_socket/get') + print(res.text) + +For an example program that illustrates this, see +``examples/abstract_namespace.py`` in the git repo. Since abstract namespace +sockets are specific to Linux, the program will only work on Linux. + + +See also +-------- + +- https://github.com/httpie/httpie-unixsocket - a plugin for `HTTPie <https://httpie.org/>`_ that allows you to interact with UNIX domain sockets + + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/SOURCES.txt new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/SOURCES.txt --- old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/SOURCES.txt 2019-08-16 00:52:04.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/SOURCES.txt 2021-12-24 02:37:14.000000000 +0100 @@ -1,16 +1,16 @@ -.travis.yml +.python-version AUTHORS ChangeLog LICENSE Makefile README.rst -Vagrantfile pytest.ini requirements.txt setup.cfg setup.py test-requirements.txt tox.ini +.github/workflows/tests.yml examples/abstract_namespace.py examples/docker-info.py examples/simple-http.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/pbr.json new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/pbr.json --- old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/pbr.json 2019-08-16 00:52:02.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/pbr.json 2021-12-24 02:19:47.000000000 +0100 @@ -1 +1 @@ -{"is_release": false, "git_version": "f4703e0"} \ No newline at end of file +{"git_version": "9fe7258", "is_release": false} \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/requires.txt new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/requires.txt --- old/requests-unixsocket-0.2.0/requests_unixsocket.egg-info/requires.txt 2019-08-16 00:52:02.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requests_unixsocket.egg-info/requires.txt 2021-12-24 02:37:13.000000000 +0100 @@ -1,2 +1 @@ requests>=1.1 -urllib3>=1.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/requirements.txt new/requests-unixsocket-0.3.0/requirements.txt --- old/requests-unixsocket-0.2.0/requirements.txt 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/requirements.txt 2021-12-24 02:35:55.000000000 +0100 @@ -1,2 +1 @@ requests>=1.1 -urllib3>=1.8 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/setup.cfg new/requests-unixsocket-0.3.0/setup.cfg --- old/requests-unixsocket-0.2.0/setup.cfg 2019-08-16 00:52:04.000000000 +0200 +++ new/requests-unixsocket-0.3.0/setup.cfg 2021-12-24 02:37:14.484028300 +0100 @@ -1,11 +1,11 @@ [metadata] name = requests-unixsocket author = Marc Abramowitz -author-email = m...@marc-abramowitz.com +author_email = m...@marc-abramowitz.com summary = Use requests to talk HTTP via a UNIX domain socket -description-file = README.rst +description_file = README.rst license = Apache-2 -home-page = https://github.com/msabramo/requests-unixsocket +home_page = https://github.com/msabramo/requests-unixsocket classifier = Development Status :: 3 - Alpha Intended Audience :: Developers diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/setup.py new/requests-unixsocket-0.3.0/setup.py --- old/requests-unixsocket-0.2.0/setup.py 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/setup.py 2021-12-24 00:44:46.000000000 +0100 @@ -4,5 +4,6 @@ setup( setup_requires=['pbr'], + install_requires=['requests>=1.1'], pbr=True, ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/test-requirements.txt new/requests-unixsocket-0.3.0/test-requirements.txt --- old/requests-unixsocket-0.2.0/test-requirements.txt 2019-08-13 22:53:24.000000000 +0200 +++ new/requests-unixsocket-0.3.0/test-requirements.txt 2021-12-24 00:44:46.000000000 +0100 @@ -1,12 +1,5 @@ -apipkg==1.4 -appdirs==1.4.0 -execnet==1.4.1 -packaging==16.8 -pep8==1.7.0 -py==1.4.32 -pyparsing==2.1.10 -pytest==2.8.7 -pytest-cache==1.0 -pytest-pep8==1.0.2 -six==1.10.0 -waitress==0.9.0 +pep8 +pytest +pytest-cache +pytest-pep8 +waitress diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/requests-unixsocket-0.2.0/tox.ini new/requests-unixsocket-0.3.0/tox.ini --- old/requests-unixsocket-0.2.0/tox.ini 2019-08-16 00:13:11.000000000 +0200 +++ new/requests-unixsocket-0.3.0/tox.ini 2021-12-24 00:56:28.000000000 +0100 @@ -1,5 +1,5 @@ [tox] -envlist = py26, py27, py33, py34, py35, py36, py37, pypy, flake8 +envlist = py37, py38, py39, py310, flake8 [testenv] commands = py.test {posargs:requests_unixsocket/tests}