{ "info": { "author": "Selim Naji, Adam Radomski and Marko Ristin", "author_email": "selim.naji@parquery.com, adam.radomski@parquery.com, marko.ristin@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "pylddwrap\n=========\n.. image:: https://travis-ci.com/Parquery/pylddwrap.svg?branch=master\n :target: https://travis-ci.com/Parquery/pylddwrap.svg?branch=master\n :alt: Build Status\n\n.. image:: https://coveralls.io/repos/github/Parquery/pylddwrap/badge.svg?branch=master\n :target: https://coveralls.io/github/Parquery/pylddwrap?branch=master\n :alt: Coverage\n\n.. image:: https://badges.frapsoft.com/os/mit/mit.png?v=103\n :target: https://opensource.org/licenses/mit-license.php\n :alt: MIT License\n\n.. image:: https://badge.fury.io/py/pylddwrap.svg\n :target: https://badge.fury.io/py/pylddwrap\n :alt: PyPI - version\n\n.. image:: https://img.shields.io/pypi/pyversions/pylddwrap.svg\n :alt: PyPI - Python Version\n\n.. image:: https://readthedocs.org/projects/pylddwrap/badge/?version=latest\n :target: https://pylddwrap.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nPylddwrap wraps ldd \\*nix utility to determine shared libraries required by a program.\n\nWe need to dynamically package subset of our system at deployment time. Consequently, we have to determine the\ndependencies on shared libraries of our binaries programmatically.\n\nThe output of ldd Linux command, while informative, is not structured enough to be easily integrated into a program.\nAt the time of this writing, we only found two alternative ldd wrappers on Internet\n`python-ldd `_ and `ldd.py `_, but their\noutput was either too basic for our use case or the project was still incipient.\n\nPylddwrap, in contrast, returns a well-structured list of the dependencies. The command-line tool outputs the\ndependencies either as a table (for visual inspection) or as a JSON-formatted string (for use with other tools).\nThe included Python module lddwrap returns a Python object with type annotations so that it can be used readily by the\ndeployment scripts and other modules.\n\nFor more information on the ldd tool, please see `ldd manual `_.\n\nUsage\n=====\n\nCommand-Line Tool pylddwrap\n---------------------------\n\n* Assume we need the dependencies of the /bin/ls. The following command gives them as a table:\n\n.. code-block:: bash\n\n pylddwrap /bin/ls\n\n* The output of the command looks like this:\n\n.. code-block:: text\n\n soname | path | found | mem_address | unused\n ----------------+---------------------------------------+-------+----------------------+-------\n linux-vdso.so.1 | None | True | (0x00007ffd8750f000) | False\n libselinux.so.1 | /lib/x86_64-linux-gnu/libselinux.so.1 | True | (0x00007f4e73dc3000) | True\n libc.so.6 | /lib/x86_64-linux-gnu/libc.so.6 | True | (0x00007f4e739f9000) | False\n libpcre.so.3 | /lib/x86_64-linux-gnu/libpcre.so.3 | True | (0x00007f4e73789000) | False\n libdl.so.2 | /lib/x86_64-linux-gnu/libdl.so.2 | True | (0x00007f4e73585000) | False\n None | /lib64/ld-linux-x86-64.so.2 | True | (0x00007f4e73fe5000) | False\n libpthread.so.0 | /lib/x86_64-linux-gnu/libpthread.so.0 | True | (0x00007f4e73368000) | False\n\n\n* To obtain the dependencies as JSON, invoke:\n\n.. code-block:: bash\n\n pylddwrap --format json /bin/ls\n\n* The JSON output is structured like this:\n\n.. code-block:: text\n\n [\n {\n \"soname\": \"linux-vdso.so.1\",\n \"path\": \"None\",\n \"found\": true,\n \"mem_address\": \"(0x00007ffed857f000)\",\n \"unused\": false\n },\n ...\n ]\n\n\n\nldwrap Python Module\n--------------------\n\nWe provide lddwrap Python module which you can integrate into your deployment scripts and other modules.\n\n* The following example shows how to list the dependencies of /bin/ls:\n\n.. code-block:: python\n\n import pathlib\n import lddwrap\n\n path = pathlib.Path(\"/bin/ls\")\n deps = lddwrap.list_dependencies(path=path)\n for dep in deps:\n print(dep)\n\n \"\"\"\n soname: linux-vdso.so.1, path: None, found: True, mem_address: (0x00007ffe8e2fb000), unused: None\n soname: libselinux.so.1, path: /lib/x86_64-linux-gnu/libselinux.so.1, found: True, mem_address: (0x00007f7759ccc000), unused: None\n soname: libc.so.6, path: /lib/x86_64-linux-gnu/libc.so.6, found: True, mem_address: (0x00007f7759902000), unused: None\n ...\n \"\"\"\n\n* List all dependencies of the /bin/ls utility and check if the direct dependencies are used.\n If unused for list_dependencies is set to False then the unused variable of the dependencies will not be determined\n and are therefore unknown and set to None. Otherwise information about direct usage will be retrieved and added to the\n dependencies.\n\n.. code-block:: python\n\n import pathlib\n import lddwrap\n\n path = pathlib.Path(\"/bin/ls\")\n deps = lddwrap.list_dependencies(path=path, unused=True)\n print(deps[1])\n # soname: libselinux.so.1,\n # path: /lib/x86_64-linux-gnu/libselinux.so.1,\n # found: True,\n # mem_address: (0x00007f5a6064a000),\n # unused: True\n\n* Lddwrap operates normally with the environment variables of the caller. In cases where your dependencies are\n determined differently than the current environment, you pass a separate environment (in form of a dictionary) as an argument:\n\n.. code-block:: python\n\n import os\n import pathlib\n import lddwrap\n\n env = os.environ.copy()\n env['LD_LIBRARY_PATH'] = \"some/important/path\"\n path = pathlib.Path(\"/bin/ls\")\n deps = lddwrap.list_dependencies(path=path, env=env)\n\nInstallation\n============\n\n* Install pylddwrap with pip:\n\n.. code-block:: bash\n\n pip3 install pylddwrap\n\n\nDevelopment\n===========\n\n* Check out the repository.\n\n* In the repository root, create the virtual environment:\n\n.. code-block:: bash\n\n python3 -m venv venv3\n\n* Activate the virtual environment:\n\n.. code-block:: bash\n\n source venv3/bin/activate\n\n* Install the development dependencies:\n\n.. code-block:: bash\n\n pip3 install -e .[dev]\n\nWe use tox for testing and packaging the distribution. Assuming that the virtual environment has been activated and the\ndevelopment dependencies have been installed, run:\n\n.. code-block:: bash\n\n tox\n\n\nPre-commit Checks\n-----------------\n\nWe provide a set of pre-commit checks that lint and check code for formatting.\n\nNamely, we use:\n\n* `yapf `_ to check the formatting.\n* The style of the docstrings is checked with `pydocstyle `_.\n* Static type analysis is performed with `mypy `_.\n* Various linter checks are done with `pylint `_.\n\nRun the pre-commit checks locally from an activated virtual environment with development dependencies:\n\n.. code-block:: bash\n\n ./precommit.py\n\n* The pre-commit script can also automatically format the code:\n\n.. code-block:: bash\n\n ./precommit.py --overwrite\n\n\nVersioning\n==========\nWe follow `Semantic Versioning `_. The version X.Y.Z indicates:\n\n* X is the major version (backward-incompatible),\n* Y is the minor version (backward-compatible), and\n* Z is the patch version (backward-compatible bug fix).", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/Parquery/lddwrap", "keywords": "ldd dependency dependencies lddwrap pylddwrap", "license": "License :: OSI Approved :: MIT License", "maintainer": "", "maintainer_email": "", "name": "pylddwrap", "package_url": "https://pypi.org/project/pylddwrap/", "platform": "", "project_url": "https://pypi.org/project/pylddwrap/", "project_urls": { "Homepage": "http://github.com/Parquery/lddwrap" }, "release_url": "https://pypi.org/project/pylddwrap/1.0.1/", "requires_dist": null, "requires_python": "", "summary": "Wrap ldd *nix utility to determine shared libraries required by a program.", "version": "1.0.1" }, "last_serial": 5410377, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "1afbab449cd32b3ce96e5c93930b8b03", "sha256": "d4cc62822604cd958be3c9cbf19238807f7f74b498e0eeaa65b243edcdf22455" }, "downloads": -1, "filename": "pylddwrap-1.0.0.tar.gz", "has_sig": false, "md5_digest": "1afbab449cd32b3ce96e5c93930b8b03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9287, "upload_time": "2018-10-29T07:05:52", "url": "https://files.pythonhosted.org/packages/76/80/6bd47c710f8abca02815edaacca0afb1c5fce84fcb448262de1b2873edfd/pylddwrap-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "e86461f9d3bffc7b82687052303ce84a", "sha256": "171a39fc7feb33e607706c57c08373ceb2f6fd4362af9241ccc65e80c948ccdf" }, "downloads": -1, "filename": "pylddwrap-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e86461f9d3bffc7b82687052303ce84a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10011, "upload_time": "2018-10-29T08:16:15", "url": "https://files.pythonhosted.org/packages/e7/e1/5ff0cbb7f06a7b1bdde316d0437c9c34600db64e07e46db5e70fec1a2f6a/pylddwrap-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e86461f9d3bffc7b82687052303ce84a", "sha256": "171a39fc7feb33e607706c57c08373ceb2f6fd4362af9241ccc65e80c948ccdf" }, "downloads": -1, "filename": "pylddwrap-1.0.1.tar.gz", "has_sig": false, "md5_digest": "e86461f9d3bffc7b82687052303ce84a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10011, "upload_time": "2018-10-29T08:16:15", "url": "https://files.pythonhosted.org/packages/e7/e1/5ff0cbb7f06a7b1bdde316d0437c9c34600db64e07e46db5e70fec1a2f6a/pylddwrap-1.0.1.tar.gz" } ] }