Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-varlink for openSUSE:Factory checked in at 2022-01-10 23:53:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-varlink (Old) and /work/SRC/openSUSE:Factory/.python-varlink.new.1892 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-varlink" Mon Jan 10 23:53:44 2022 rev:4 rq:945354 version:31.0.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-varlink/python-varlink.changes 2019-09-27 14:48:33.888746606 +0200 +++ /work/SRC/openSUSE:Factory/.python-varlink.new.1892/python-varlink.changes 2022-01-10 23:54:21.636844164 +0100 @@ -1,0 +2,9 @@ +Mon Jan 10 15:01:45 UTC 2022 - Dirk M??ller <[email protected]> + +- update to 31.0.0: + * fix tests + * remove python 3.4, 3.5 + * fix(scanner): compat code + * fix: reduce test-requirements.txt + +------------------------------------------------------------------- Old: ---- varlink-30.3.0.tar.gz New: ---- varlink-31.0.0.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-varlink.spec ++++++ --- /var/tmp/diff_new_pack.qxS8RV/_old 2022-01-10 23:54:22.908845280 +0100 +++ /var/tmp/diff_new_pack.qxS8RV/_new 2022-01-10 23:54:22.912845283 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-varlink # -# 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-varlink -Version: 30.3.0 +Version: 31.0.0 Release: 0 Summary: Python implementation of the Varlink protocol License: Apache-2.0 ++++++ varlink-30.3.0.tar.gz -> varlink-31.0.0.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/.github/workflows/main.yml new/varlink-31.0.0/.github/workflows/main.yml --- old/varlink-30.3.0/.github/workflows/main.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/varlink-31.0.0/.github/workflows/main.yml 2021-12-06 13:57:41.000000000 +0100 @@ -0,0 +1,27 @@ +on: + push: + branches: + - master + pull_request: + branches: + - master + +name: Run Tox tests + +jobs: + tox_test: + name: Tox test + steps: + - uses: actions/checkout@v2 + - name: Run Tox tests + id: test + uses: fedora-python/tox-github-action@master + with: + tox_env: ${{ matrix.tox_env }} + strategy: + fail-fast: false + matrix: + tox_env: [py27, py36, py37, py38, py39, py310, pypy2, pypy3, pep8] + + # Use GitHub's Linux Docker host + runs-on: ubuntu-latest diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/.github/workflows/publish.yml new/varlink-31.0.0/.github/workflows/publish.yml --- old/varlink-30.3.0/.github/workflows/publish.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/varlink-31.0.0/.github/workflows/publish.yml 2021-12-06 13:57:41.000000000 +0100 @@ -0,0 +1,44 @@ +name: Publish Python ???? distributions ???? to PyPI and TestPyPI + +on: push + +jobs: + build-n-publish: + name: Build and publish Python ???? distributions ???? to PyPI and TestPyPI + runs-on: ubuntu-20.04 + + steps: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Set up Python 3.9 + uses: actions/setup-python@v1 + with: + python-version: 3.9 + + - name: Install pypa/build + run: >- + python -m + pip install + build + --user + - name: Build a binary wheel and a source tarball + run: >- + python -m + build + --sdist + --wheel + --outdir dist/ + . + + - name: Publish distribution ???? to Test PyPI + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.TEST_PYPI_API_TOKEN }} + repository_url: https://test.pypi.org/legacy/ + + - name: Publish distribution ???? to PyPI + if: startsWith(github.ref, 'refs/tags') + uses: pypa/gh-action-pypi-publish@master + with: + password: ${{ secrets.PYPI_API_TOKEN }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/.travis.yml new/varlink-31.0.0/.travis.yml --- old/varlink-30.3.0/.travis.yml 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/.travis.yml 2021-12-06 13:57:41.000000000 +0100 @@ -4,7 +4,6 @@ python: - '3.6' - '3.5' -- '3.4' - '2.7' install: - pip install tox-travis .[devel] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/Makefile new/varlink-31.0.0/Makefile --- old/varlink-30.3.0/Makefile 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/Makefile 2021-12-06 13:57:41.000000000 +0100 @@ -1,6 +1,6 @@ PYTHON := $(shell python -c 'import platform;print(platform.python_version().split(".")[0])') -PYTHON2 := $(shell if which python2 &>/dev/null;then which python2; elif "$(PYTHON)" == 2; then which python; fi) -PYTHON3 := $(shell if which python3 &>/dev/null;then which python3; elif "$(PYTHON)" == 3; then which python; fi) +PYTHON2 := $(shell if which python2 &>/dev/null;then which python2; elif [ "$(PYTHON)" == 2 ]; then which python; fi) +PYTHON3 := $(shell if which python3 &>/dev/null;then which python3; elif [ "$(PYTHON)" == 3 ]; then which python; fi) all: build .PHONY: all @@ -15,8 +15,8 @@ .PHONY: clean check: - if [ -x $(PYTHON2) ]; then $(PYTHON2) -m unittest discover;fi - if [ -x $(PYTHON3) ]; then $(PYTHON3) -m unittest discover;fi + if [ -x "$(PYTHON2)" ]; then $(PYTHON2) -m unittest varlink;fi + if [ -x "$(PYTHON3)" ]; then $(PYTHON3) -m unittest varlink;fi .PHONY: check docs: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/PKG-INFO new/varlink-31.0.0/PKG-INFO --- old/varlink-30.3.0/PKG-INFO 2019-08-14 14:45:13.000000000 +0200 +++ new/varlink-31.0.0/PKG-INFO 2021-12-06 13:57:53.460713000 +0100 @@ -1,19 +1,245 @@ Metadata-Version: 2.1 Name: varlink -Version: 30.3.0 -Summary: Varlink +Version: 31.0.0 +Summary: Python implementation of the Varlink protocol Home-page: https://github.com/varlink/python -Author: Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> -Author-email: [email protected] +Author: Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> +Author-email: [email protected] License: ASL 2.0 -Description: Python implementation of the varlink protocol http://varlink.org -Keywords: ipc varlink rpc +Keywords: ipc,varlink,rpc Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: System :: Networking -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7 Description-Content-Type: text/markdown +License-File: LICENSE.txt + +[](https://www.varlink.org/Language-Bindings) +[](https://travis-ci.org/varlink/python) +[](https://coveralls.io/github/varlink/python?branch=master) +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) + +# python-varlink + +A [varlink](http://varlink.org) implementation for Python. + +* [GIT Repository](https://github.com/varlink/python) +* [API documentation](https://varlink.github.io/python/) + +## python varlink installation + +From pypi: +```bash +$ pip3 install --user varlink +``` + +With Fedora 28/rawhide: +```bash +$ sudo dnf install python3-varlink +``` + +## Examples + +See the [tests](https://github.com/varlink/python-varlink/tree/master/varlink/tests) directory. + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" & +[1] 6434 +$ python -m varlink.cli help unix:/tmp/test/org.example.more +# Example Varlink service +interface org.example.more + +# Enum, returning either start, progress or end +# progress: [0-100] +type State ( + start: ?bool, + progress: ?int, + end: ?bool +) + +# Returns the same string +method Ping(ping: string) -> (pong: string) + +# Dummy progress method +# n: number of progress steps +method TestMore(n: int) -> (state: State) + +# Stop serving +method StopServing() -> () + +# Something failed in TestMore +error TestMoreError (reason: string) + +$ python -m varlink.cli call unix:/tmp/test/org.example.more.Ping '{ "ping": "Ping"}' +{ + "pong": "Ping" +} + + +$ fg +python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" +^C +``` + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --client -A 'python3 -m varlink.tests.test_orgexamplemore --varlink=$VARLINK_ADDRESS' +Connecting to unix:/tmp/tmppxrbqk9p/4927 + +Listening on /tmp/tmppxrbqk9p/4927 +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- +``` + +```bash +$ PYTHONPATH=$(pwd) python3 ./varlink/tests/test_orgexamplemore.py +Connecting to unix:/tmp/tmp7n6zc67d/5257 + +Listening on /tmp/tmp7n6zc67d/5257 +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- +``` + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" & +Listening on /tmp/test +[1] 6434 +python3 -m varlink.tests.test_orgexamplemore --client --varlink="unix:/tmp/test" +Connecting to unix:/tmp/test + +Ping: Test +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- + +$ python3 -m varlink.cli call --more unix:/tmp/test/org.example.more.TestMore '{ "n": 10 }' +{'state': {'start': True}} +{'state': {'progress': 0}} +{'state': {'progress': 10}} +{'state': {'progress': 20}} +{'state': {'progress': 30}} +{'state': {'progress': 40}} +{'state': {'progress': 50}} +{'state': {'progress': 60}} +{'state': {'progress': 70}} +{'state': {'progress': 80}} +{'state': {'progress': 90}} +{'state': {'progress': 100}} +{'state': {'end': True}} + +$ fg +python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" +^C +``` + +You can also start the clients and server with URLs following the [varlink URL standard](https://varlink.org/#address) with `unix:` and `tcp:`. +E.g. +- unix:@anonuds +- unix:/run/myserver/socketfile +- tcp:127.0.0.1:12345 +- tcp:[::1]:12345 + + +### Activation Mode + +Activation mode starts the service to connect to and passes the socket via socket activation. +The ```VARLINK_ADDRESS``` environment variable contains the varlink address URI. + +```bash +$ python3 -m varlink.cli --activate 'python3 -m varlink.tests.test_orgexamplemore --varlink=$VARLINK_ADDRESS' call org.example.more.Ping '{ "ping": "Ping"}' +Listening on @00352 +{'pong': 'Ping'} +``` + + +### Bridge Mode + +Bridge mode allows to tunnel to a remote point via stdin/stdout and call a method. +Running ```varlink bridge``` allows to connect stdio to the host services via ```org.varlink.resolver``` interface resolving. + +```bash +# python3 -m varlink.cli -b "ssh host.example.org varlink bridge" call com.redhat.machine.GetInfo '{}' +{ + "hostname": "host.example.org", + "system": { + "id": "fedora", + "kernel_version": "4.18.0-0.rc5.git1.2.fc29.x86_64", + "name": "Fedora", + "version": "29" + }, + "virtualization": { + "name": "none" + } +} +``` + +### Varlink Certification Server + +``` +$ python3 -m varlink.tests.test_certification --varlink=tcp:127.0.0.1:12345 +``` + +### Varlink Certification Client + +``` +$ python3 -m varlink.tests.test_certification --varlink=tcp:127.0.0.1:12345 --client +``` + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/README.md new/varlink-31.0.0/README.md --- old/varlink-30.3.0/README.md 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/README.md 2021-12-06 13:57:41.000000000 +0100 @@ -1,9 +1,9 @@ [](https://www.varlink.org/Language-Bindings) [](https://travis-ci.org/varlink/python) [](https://coveralls.io/github/varlink/python?branch=master) -] - - +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) # python-varlink @@ -56,6 +56,11 @@ # Something failed in TestMore error TestMoreError (reason: string) +$ python -m varlink.cli call unix:/tmp/test/org.example.more.Ping '{ "ping": "Ping"}' +{ + "pong": "Ping" +} + $ fg python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" @@ -159,7 +164,7 @@ ^C ``` -You can also start the clients and server with URLs following the [varlink URL standard](https://github.com/varlink/documentation/wiki#address). +You can also start the clients and server with URLs following the [varlink URL standard](https://varlink.org/#address) with `unix:` and `tcp:`. E.g. - unix:@anonuds - unix:/run/myserver/socketfile diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/newversion.sh new/varlink-31.0.0/newversion.sh --- old/varlink-30.3.0/newversion.sh 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/newversion.sh 2021-12-06 13:57:41.000000000 +0100 @@ -11,15 +11,6 @@ fi sed -i -e "s/^Version.*/Version: \\t${version}/" python-varlink.spec -sed -i -e "s/^[ \\t]*version.*=.*/ version = \"${version}\",/" setup.py -git commit -m "version ${version}" python-varlink.spec setup.py -git tag -m "version ${version}" --sign "${version}" -git push -git push --tags -rm -fr dist -python3 setup.py bdist_wheel --universal -python3 setup.py sdist -twine upload --skip-existing --sign-with gpg2 -s dist/* curl -L -O https://github.com/varlink/python-varlink/archive/${version}/python-varlink-${version}.tar.gz rm -fr docs/build python3 setup.py build_sphinx --source-dir=docs/ --build-dir=docs/build --all-files diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/pyproject.toml new/varlink-31.0.0/pyproject.toml --- old/varlink-30.3.0/pyproject.toml 1970-01-01 01:00:00.000000000 +0100 +++ new/varlink-31.0.0/pyproject.toml 2021-12-06 13:57:41.000000000 +0100 @@ -0,0 +1,13 @@ +[build-system] +requires = [ + "setuptools >= 44; python_version < '3'", + "setuptools >= 48; python_version > '3'", + "setuptools_scm >= 4, <6; python_version < '3'", + "setuptools_scm[toml]; python_version > '3'", + "setuptools_scm_git_archive", + "wheel >= 0.29.0", +] +build-backend = 'setuptools.build_meta' + +[tool.setuptools_scm] +local_scheme = "no-local-version" \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/python-varlink.spec new/varlink-31.0.0/python-varlink.spec --- old/varlink-30.3.0/python-varlink.spec 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/python-varlink.spec 2021-12-06 13:57:41.000000000 +0100 @@ -3,7 +3,7 @@ %endif Name: python-varlink -Version: 30.2.0 +Version: 30.3.1 Release: 1%{?dist} Summary: Python implementation of Varlink License: ASL 2.0 @@ -14,6 +14,7 @@ BuildRequires: python2-devel BuildRequires: python-rpm-macros BuildRequires: python-setuptools +BuildRequires: python-setuptools_scm %if 0%{?build_py3} BuildRequires: python3-devel @@ -47,6 +48,7 @@ %autosetup -n python-%{version} %build +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %py2_build %if 0%{?build_py3} %py3_build @@ -55,10 +57,12 @@ %if 0%{?build_py3} %check +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} CFLAGS="%{optflags}" %{__python3} %{py_setup} %{?py_setup_args} check %endif %install +export SETUPTOOLS_SCM_PRETEND_VERSION=%{version} %py2_install %if 0%{?build_py3} %py3_install diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/setup.cfg new/varlink-31.0.0/setup.cfg --- old/varlink-30.3.0/setup.cfg 2019-08-14 14:45:13.000000000 +0200 +++ new/varlink-31.0.0/setup.cfg 2021-12-06 13:57:53.460713000 +0100 @@ -1,14 +1,15 @@ [metadata] name = varlink -description = Python implementation of the Varlink protoco +description = Python implementation of the Varlink protocol long_description = file: README.md long_description_content_type = text/markdown -author = Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> -author_email = [email protected] +author = Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> +author_email = [email protected] url = https://github.com/varlink/python keywords = ipc, varlink, rpc license = ASL 2.0 classifiers = + Development Status :: 5 - Production/Stable Intended Audience :: Developers License :: OSI Approved :: Apache Software License Programming Language :: Python @@ -22,11 +23,12 @@ [options] zip_safe = False -python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +python_requires = >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.* include_package_data = True packages = varlink setup_requires = - setuptools_scm + setuptools_scm < 6 ; python_version < "3" + setuptools_scm ; python_version >= "3" [options.package_data] varlink = *.varlink diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/setup.py new/varlink-31.0.0/setup.py --- old/varlink-30.3.0/setup.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/setup.py 2021-12-06 13:57:41.000000000 +0100 @@ -1,26 +1,13 @@ from setuptools import setup +def local_scheme(_): + """Enables a version format so that upload to TestPyPI is successful. + For example: 2.6.2.dev8 + See https://github.com/pypa/setuptools_scm/issues/342. + """ + return "" + setup( - name="varlink", - packages=["varlink"], - version = "30.3.0", - description="Varlink", - long_description="Python implementation of the varlink protocol http://varlink.org", - author="Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]>", - author_email="[email protected]", - url="https://github.com/varlink/python", - license="ASL 2.0", - keywords="ipc varlink rpc", - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", - package_data={ - "varlink": ["*.varlink"] - }, - classifiers=[ - "Intended Audience :: Developers", - "License :: OSI Approved :: Apache Software License", - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python", - "Topic :: System :: Networking" - ] + use_scm_version={"local_scheme": "no-local-version"}, + setup_requires=['setuptools_scm'], ) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/test-requirements.txt new/varlink-31.0.0/test-requirements.txt --- old/varlink-30.3.0/test-requirements.txt 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/test-requirements.txt 2021-12-06 13:57:41.000000000 +0100 @@ -1,6 +1,3 @@ -python-coveralls future -coverage fixtures -nose -nose-timer +nose2 \ No newline at end of file diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/tox.ini new/varlink-31.0.0/tox.ini --- old/varlink-30.3.0/tox.ini 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/tox.ini 2021-12-06 13:57:41.000000000 +0100 @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py38,py37,py36,py35,py27,pep8 +envlist = py310,py39,py38,py37,py36,py27,pep8,pypy2,pypy3 [testenv] usedevelop = True @@ -17,16 +17,16 @@ -r{toxinidir}/test-requirements.txt -r{toxinidir}/requirements.txt commands = - nosetests \ - --with-timer \ - --with-coverage --cover-erase --cover-package=varlink + nose2 \ + --coverage varlink [testenv:py27] commands = - nosetests \ - --with-timer \ - --with-coverage --cover-erase --cover-package=varlink \ - --exclude=(test_mocks.py) + python -m unittest varlink + +[testenv:pypy2] +commands = + python -m unittest varlink [travis] python = 3.7: py37 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/cli.py new/varlink-31.0.0/varlink/cli.py --- old/varlink-30.3.0/varlink/cli.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/cli.py 2021-12-06 13:57:41.000000000 +0100 @@ -27,11 +27,15 @@ method = args.METHOD[deli + 1:] interface = args.METHOD[:deli] - def new_client(interface): - deli = interface.rfind("/") - if deli != -1: - address = interface[:deli] - interface = interface[deli + 1:] + deli = interface.rfind("/") + if deli != -1: + address = interface[:deli] + interface = interface[deli + 1:] + else: + address = None + + def new_client(address): + if address: client = varlink.Client.new_with_address(address) else: if args.activate: @@ -42,7 +46,7 @@ client = varlink.Client.new_with_resolved_interface(interface, args.resolver) return client - with new_client(interface) as client: + with new_client(address) as client: got = False try: with client.open(interface) as con: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/mock.py new/varlink-31.0.0/varlink/mock.py --- old/varlink-30.3.0/varlink/mock.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/mock.py 2021-12-06 13:57:41.000000000 +0100 @@ -299,7 +299,8 @@ def service_start(self): self.service_pid = subprocess.Popen( - [sys.executable, self.mocked_service_file] + [sys.executable, self.mocked_service_file], + env = { "PYTHONPATH": ':'.join(sys.path) } ) time.sleep(2) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/scanner.py new/varlink-31.0.0/varlink/scanner.py --- old/varlink-30.3.0/varlink/scanner.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/scanner.py 2021-12-06 13:57:41.000000000 +0100 @@ -6,6 +6,7 @@ from builtins import str from builtins import int from builtins import object + from builtins import unicode except ImportError: pass @@ -21,7 +22,12 @@ except: # Python 2 from argparse import Namespace as SimpleNamespace -from collections import (Set, OrderedDict, Mapping) +try: + from collections.abc import (Set, Mapping) +except: # Python 2 + from collections import (Set, Mapping) + +from collections import OrderedDict from .error import (MethodNotFound, InvalidParameter) @@ -42,7 +48,7 @@ self.keyword_pattern = re.compile(r'\b[a-z]+\b|[:,(){}]|->|\[\]|\?|\[string\]\(\)|\[string\]', ASCII) self.patterns = { - 'interface-name': re.compile(r'[a-z]([-]*[a-z0-9])*([.][a-z0-9]([-]*[a-z0-9])*)+'), + 'interface-name': re.compile(r'[A-Za-z]([A-Za-z])*([.][A-Za-z0-9]([-]*[A-Za-z0-9])*)+|xn--([0-9a-z])*([.][A-Za-z0-9]([-]*[A-Za-z0-9])*)+'), 'member-name': re.compile(r'\b[A-Z][A-Za-z0-9]*\b', ASCII), 'identifier': re.compile(r'\b[A-Za-z]([_]?[A-Za-z0-9])*\b', ASCII), } @@ -335,7 +341,7 @@ if isinstance(varlink_type, _Object): return args - if isinstance(varlink_type, _Enum) and isinstance(args, str): + if isinstance(varlink_type, _Enum) and ( isinstance(args, str) or isinstance(args, unicode) ): # print("Returned str:", args) return args diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/tests/__init__.py new/varlink-31.0.0/varlink/tests/__init__.py --- old/varlink-30.3.0/varlink/tests/__init__.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/tests/__init__.py 2021-12-06 13:57:41.000000000 +0100 @@ -8,6 +8,9 @@ def suite(): suite = unittest.TestSuite() for fn in os.listdir(here): + if fn.startswith("test_mocks") and sys.version_info.major < 3: + continue + if fn.startswith("test") and fn.endswith(".py"): modname = "varlink.tests." + fn[:-3] __import__(modname) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/tests/test_basic_network.py new/varlink-31.0.0/varlink/tests/test_basic_network.py --- old/varlink-30.3.0/varlink/tests/test_basic_network.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/tests/test_basic_network.py 2021-12-06 13:57:41.000000000 +0100 @@ -59,14 +59,14 @@ if platform.startswith("linux"): self.do_run("unix:@org.varlink.service_anon_test" + str(os.getpid()) - + threading.current_thread().getName() + + threading.current_thread().name ) def test_unix(self): if hasattr(socket, "AF_UNIX"): self.do_run("unix:org.varlink.service_anon_test_" + str(os.getpid()) - + threading.current_thread().getName() + + threading.current_thread().name ) def test_wrong_url(self): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/tests/test_certification.py new/varlink-31.0.0/varlink/tests/test_certification.py --- old/varlink-30.3.0/varlink/tests/test_certification.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/tests/test_certification.py 2021-12-06 13:57:41.000000000 +0100 @@ -456,7 +456,7 @@ if hasattr(socket, "AF_UNIX"): cls.address = "unix:org.varlink.certification_" \ + str(os.getpid()) \ - + threading.current_thread().getName() + + threading.current_thread().name else: cls.address = "tcp:127.0.0.1:23456" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink/tests/test_scanner.py new/varlink-31.0.0/varlink/tests/test_scanner.py --- old/varlink-30.3.0/varlink/tests/test_scanner.py 2019-08-14 14:43:51.000000000 +0200 +++ new/varlink-31.0.0/varlink/tests/test_scanner.py 2021-12-06 13:57:41.000000000 +0100 @@ -88,10 +88,8 @@ self.assertRaises(SyntaxError, varlink.Interface, "interface .a.b.c\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface com.-example.leadinghyphen\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface com.example-.danglinghyphen-\nmethod F()->()") - self.assertRaises(SyntaxError, varlink.Interface, "interface Com.example.uppercase-toplevel\nmethod F()->()") - self.assertRaises(SyntaxError, varlink.Interface, "interface Co9.example.number-toplevel\nmethod F()->()") + self.assertRaises(SyntaxError, varlink.Interface, "interface co9.example.number-toplevel\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface 1om.example.number-toplevel\nmethod F()->()") - self.assertRaises(SyntaxError, varlink.Interface, "interface com.Example\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface ab\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface .a.b.c\nmethod F()->()") self.assertRaises(SyntaxError, varlink.Interface, "interface a.b.c.\nmethod F()->()") @@ -107,13 +105,10 @@ self.assertRaises(SyntaxError, varlink.Interface, "interface a.?\nmethod F()->()") self.assertIsNotNone(varlink.Interface("interface a.b\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface a.b.c\nmethod F()->()").name) - self.assertIsNotNone(varlink.Interface("interface a1.b1.c1\nmethod F()->()").name) - self.assertIsNotNone(varlink.Interface("interface a1.b--1.c--1\nmethod F()->()").name) - self.assertIsNotNone(varlink.Interface("interface a--1.b--1.c--1\nmethod F()->()").name) - self.assertIsNotNone(varlink.Interface("interface a.21.c\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface a.1\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface a.0.0\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface org.varlink.service\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface com.example.0example\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface com.example.example-dash\nmethod F()->()").name) self.assertIsNotNone(varlink.Interface("interface xn--lgbbat1ad8j.example.algeria\nmethod F()->()").name) + self.assertIsNotNone(varlink.Interface("interface xn--c1yn36f.xn--c1yn36f.xn--c1yn36f\nmethod F()->()").name) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink.egg-info/PKG-INFO new/varlink-31.0.0/varlink.egg-info/PKG-INFO --- old/varlink-30.3.0/varlink.egg-info/PKG-INFO 2019-08-14 14:45:13.000000000 +0200 +++ new/varlink-31.0.0/varlink.egg-info/PKG-INFO 2021-12-06 13:57:53.000000000 +0100 @@ -1,19 +1,245 @@ Metadata-Version: 2.1 Name: varlink -Version: 30.3.0 -Summary: Varlink +Version: 31.0.0 +Summary: Python implementation of the Varlink protocol Home-page: https://github.com/varlink/python -Author: Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> -Author-email: [email protected] +Author: Lars Karlitski<[email protected]>, Harald Hoyer<[email protected]> +Author-email: [email protected] License: ASL 2.0 -Description: Python implementation of the varlink protocol http://varlink.org -Keywords: ipc varlink rpc +Keywords: ipc,varlink,rpc Platform: UNKNOWN +Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: Apache Software License -Classifier: Programming Language :: Python :: 3 -Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python +Classifier: Programming Language :: Python :: 2.7 +Classifier: Programming Language :: Python :: 3 +Classifier: Programming Language :: Python :: 3.5 +Classifier: Programming Language :: Python :: 3.6 +Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: System :: Networking -Requires-Python: >=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.* +Requires-Python: !=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7 Description-Content-Type: text/markdown +License-File: LICENSE.txt + +[](https://www.varlink.org/Language-Bindings) +[](https://travis-ci.org/varlink/python) +[](https://coveralls.io/github/varlink/python?branch=master) +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) +[](https://pypi.org/project/varlink/) + +# python-varlink + +A [varlink](http://varlink.org) implementation for Python. + +* [GIT Repository](https://github.com/varlink/python) +* [API documentation](https://varlink.github.io/python/) + +## python varlink installation + +From pypi: +```bash +$ pip3 install --user varlink +``` + +With Fedora 28/rawhide: +```bash +$ sudo dnf install python3-varlink +``` + +## Examples + +See the [tests](https://github.com/varlink/python-varlink/tree/master/varlink/tests) directory. + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" & +[1] 6434 +$ python -m varlink.cli help unix:/tmp/test/org.example.more +# Example Varlink service +interface org.example.more + +# Enum, returning either start, progress or end +# progress: [0-100] +type State ( + start: ?bool, + progress: ?int, + end: ?bool +) + +# Returns the same string +method Ping(ping: string) -> (pong: string) + +# Dummy progress method +# n: number of progress steps +method TestMore(n: int) -> (state: State) + +# Stop serving +method StopServing() -> () + +# Something failed in TestMore +error TestMoreError (reason: string) + +$ python -m varlink.cli call unix:/tmp/test/org.example.more.Ping '{ "ping": "Ping"}' +{ + "pong": "Ping" +} + + +$ fg +python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" +^C +``` + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --client -A 'python3 -m varlink.tests.test_orgexamplemore --varlink=$VARLINK_ADDRESS' +Connecting to unix:/tmp/tmppxrbqk9p/4927 + +Listening on /tmp/tmppxrbqk9p/4927 +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- +``` + +```bash +$ PYTHONPATH=$(pwd) python3 ./varlink/tests/test_orgexamplemore.py +Connecting to unix:/tmp/tmp7n6zc67d/5257 + +Listening on /tmp/tmp7n6zc67d/5257 +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- +``` + +```bash +$ python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" & +Listening on /tmp/test +[1] 6434 +python3 -m varlink.tests.test_orgexamplemore --client --varlink="unix:/tmp/test" +Connecting to unix:/tmp/test + +Ping: Test +--- Start --- +Progress: 0 +Progress: 10 +Progress: 20 +Progress: 30 +Progress: 40 +Progress: 50 +Progress: 60 +Ping: Test +Progress: 70 +Ping: Test +Progress: 80 +Ping: Test +Progress: 90 +Ping: Test +Progress: 100 +Ping: Test +--- End --- + +$ python3 -m varlink.cli call --more unix:/tmp/test/org.example.more.TestMore '{ "n": 10 }' +{'state': {'start': True}} +{'state': {'progress': 0}} +{'state': {'progress': 10}} +{'state': {'progress': 20}} +{'state': {'progress': 30}} +{'state': {'progress': 40}} +{'state': {'progress': 50}} +{'state': {'progress': 60}} +{'state': {'progress': 70}} +{'state': {'progress': 80}} +{'state': {'progress': 90}} +{'state': {'progress': 100}} +{'state': {'end': True}} + +$ fg +python3 -m varlink.tests.test_orgexamplemore --varlink="unix:/tmp/test" +^C +``` + +You can also start the clients and server with URLs following the [varlink URL standard](https://varlink.org/#address) with `unix:` and `tcp:`. +E.g. +- unix:@anonuds +- unix:/run/myserver/socketfile +- tcp:127.0.0.1:12345 +- tcp:[::1]:12345 + + +### Activation Mode + +Activation mode starts the service to connect to and passes the socket via socket activation. +The ```VARLINK_ADDRESS``` environment variable contains the varlink address URI. + +```bash +$ python3 -m varlink.cli --activate 'python3 -m varlink.tests.test_orgexamplemore --varlink=$VARLINK_ADDRESS' call org.example.more.Ping '{ "ping": "Ping"}' +Listening on @00352 +{'pong': 'Ping'} +``` + + +### Bridge Mode + +Bridge mode allows to tunnel to a remote point via stdin/stdout and call a method. +Running ```varlink bridge``` allows to connect stdio to the host services via ```org.varlink.resolver``` interface resolving. + +```bash +# python3 -m varlink.cli -b "ssh host.example.org varlink bridge" call com.redhat.machine.GetInfo '{}' +{ + "hostname": "host.example.org", + "system": { + "id": "fedora", + "kernel_version": "4.18.0-0.rc5.git1.2.fc29.x86_64", + "name": "Fedora", + "version": "29" + }, + "virtualization": { + "name": "none" + } +} +``` + +### Varlink Certification Server + +``` +$ python3 -m varlink.tests.test_certification --varlink=tcp:127.0.0.1:12345 +``` + +### Varlink Certification Client + +``` +$ python3 -m varlink.tests.test_certification --varlink=tcp:127.0.0.1:12345 --client +``` + + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/varlink-30.3.0/varlink.egg-info/SOURCES.txt new/varlink-31.0.0/varlink.egg-info/SOURCES.txt --- old/varlink-30.3.0/varlink.egg-info/SOURCES.txt 2019-08-14 14:45:13.000000000 +0200 +++ new/varlink-31.0.0/varlink.egg-info/SOURCES.txt 2021-12-06 13:57:53.000000000 +0100 @@ -6,12 +6,15 @@ README.md git-deploy-branch.sh newversion.sh +pyproject.toml python-varlink.spec requirements.txt setup.cfg setup.py test-requirements.txt tox.ini +.github/workflows/main.yml +.github/workflows/publish.yml .tito/tito.props .tito/packages/.readme docs/conf.py
