{ "info": { "author": "Charles Fl\u00e8che", "author_email": "charles.fleche@free.fr", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3 :: Only" ], "description": "Blender distutils commands\n==========================\n\nThis Python module adds a new command to\n`distutils `_ to build `Blender `__ addons: ``bdist_blender_addon``. It also provides a simple mechanism to package extra modules not included with Blender's Python distribution within the addon.\n\nExample\n-------\n\nSee the `info_example_distutils `_ addon to see how this ``distutils`` module is used.\n\nInstallation\n------------\n\nInstalling the ``blender.distutils`` module\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe module is available on PiPy and installable with ``pip``.\n\n.. code:: sh\n\n $ pip install blender.distutils\n\nIt is suggested to add a\n`requirements.txt `_ file to the Blender addon plugin that lists the module dependencies.\n\n::\n\n # This is requirements.txt\n\n # This module adds the setup.py bdist_blender_addon command\n\n blender.distutils\n\n # This module is required by the addon, but not distributed with blender\n # bdist_blender_addon will ship it if with the addon\n # Dependencies to be included are listed in setup.cfg\n\n dateutils\n\nAdd a simple ``setup.py`` to the blender addon\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe ``bdist_blender_addon`` is a ``distutils`` command. As such, a ``setup.py`` file is required. Addon name and version are defined by this file. I suggest using `bumpversion `_ to keep ``setup.py``, ``bl_info`` and your git tags in sync.\n\nThe `setup.py `_ for a blender addon is actually quite straightforward. The ``install_requires`` argument should only list the first-level dependencies needed by the addon: those may require their own dependencies. The actual modules to be shipped with the addon are cherry picked in ``setup.cfg``.\n\n.. code:: python\n\n from setuptools import setup, find_packages\n\n setup(\n name='info_example_distutils',\n version='1.0.0',\n description='Blender example distutils',\n long_description=open('README.md').read(),\n url='https://github.com/charlesfleche/blender.distutils/io_example_distutils',\n author='Charles Fl\u00e8che',\n author_email='charles.fleche@free.fr',\n license='MIT',\n classifiers=[\n 'Development Status :: 5 - Production/Stable',\n 'Intended Audience :: End Users/Desktop',\n 'Topic :: Multimedia :: Graphics :: 3D Modeling',\n 'Topic :: Multimedia :: Graphics :: 3D Rendering',\n 'License :: OSI Approved :: MIT License',\n 'Programming Language :: Python :: 3 :: Only'\n ],\n packages=find_packages(),\n keywords='blender',\n\n # Here are listed first level dependencies needed by the module. Themselves\n # may require dependencies. The actual modules to be shipped with the addon\n # are cherry picked in setup.cfg\n install_requires=['dateutils']\n )\n\nIncluding third-party modules not shipped with blender\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe ``bdist_blender_addon`` command allows to include additional python\nmodules that are not shipped with Blender. These modules will be\nincluded in the root folder of the addon. Currently an explicit list of\nmodules, including their dependencies, needs to be configured.\n\nCherry pick the modules to be shipped with the blender addon\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe modules to be included to the blender addon are listed as an option\nof the ``[bdist_blender_addon]`` section in ``setup.cfg``. This list\nincludes all the modules and their dependencies.\n\n::\n\n # This is in setup.cfg\n\n [bdist_blender_addon]\n\n # Here are listed the modules (and their dependencies) to be shipped\n # with the blender module. In this example the addon requires `dateutils`,\n # which in turns requires `dateutil`, `pytz` and `six`.\n addon_require = dateutil,dateutils,pytz,six\n\nInclude the additional modules folder in the addon code\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThe addon needs to explicitly register the path to third party modules.\nDuring development, those modules will be in a virtual environment. When\nthe addon is installed in production, those modules will be at the root\nof the addon folder.\n\n.. code:: python\n\n import pathlib\n import os\n import site\n import sys\n\n\n def third_party_modules_sitedir():\n # If we are in a VIRTUAL_ENV, while developing for example, we want the\n # addon to hit the modules installed in the virtual environment\n if 'VIRTUAL_ENV' in os.environ:\n env = pathlib.Path(os.environ['VIRTUAL_ENV'])\n v = sys.version_info\n path = env / 'lib/python{}.{}/site-packages'.format(v.major, v.minor)\n\n # However outside of a virtual environment, the additionnal modules not\n # shipped with Blender are expected to be found in the root folder of\n # the addon\n else:\n path = pathlib.Path(__file__).parent\n\n return str(path.resolve())\n\n # The additionnal modules location (virtual env or addon folder) is\n # appended here\n site.addsitedir(third_party_modules_sitedir())\n\n # This module is not part of the standard blender distribution\n # It is shipped alongside the plugin when `python setup.py bdist_blender_addon`\n import dateutils\n\nBuild the module\n~~~~~~~~~~~~~~~~\n\nThe ``bdist_blender_addon`` command will copy the addon code, copy the\nadditional modules over, clean unneeded files (like the ``*.pyc``\nbytecode files) and package them all in a versioned zip archive under\nthe ``dist`` folder.\n\n.. code:: bash\n\n $ python setup.py bdist_blender_addon\n running bdist_blender_addon\n running build\n running build_py\n creating build/lib/info_example_distutils\n copying info_example_distutils/__init__.py -> build/lib/info_example_distutils\n creating build/lib/info_example_distutils/dateutil\n [long list of files being copied or added to the addon zip archive]\n\n $ ls dist/\n info_example_distutils-v1.0.0.zip\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/charlesfleche/blender.distutils", "keywords": "distutils blender", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "blender.distutils", "package_url": "https://pypi.org/project/blender.distutils/", "platform": "", "project_url": "https://pypi.org/project/blender.distutils/", "project_urls": { "Homepage": "https://github.com/charlesfleche/blender.distutils" }, "release_url": "https://pypi.org/project/blender.distutils/1.0.5/", "requires_dist": null, "requires_python": "", "summary": "Blender distutils addon", "version": "1.0.5" }, "last_serial": 4063964, "releases": { "1.0.3": [ { "comment_text": "", "digests": { "md5": "37d03def1e8e82544041d685eabaedc0", "sha256": "53d09b90841c5253975522f658c0567965ff5c743fb61ecbaa8113ec85916d59" }, "downloads": -1, "filename": "blender.distutils-1.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "37d03def1e8e82544041d685eabaedc0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 3555, "upload_time": "2018-07-15T22:01:09", "url": "https://files.pythonhosted.org/packages/40/38/690aa3d55b595136c5ad995709770ad4e77897329ff55dce654eb7e1858f/blender.distutils-1.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d4de3799db637267aecd3c68d49fa90b", "sha256": "88260330b12d46e60b7de66a93b1f8719b154546bd2db036c4ba075fecd7cb28" }, "downloads": -1, "filename": "blender.distutils-1.0.3.tar.gz", "has_sig": false, "md5_digest": "d4de3799db637267aecd3c68d49fa90b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3654, "upload_time": "2018-07-15T22:01:10", "url": "https://files.pythonhosted.org/packages/8b/d1/cbb3393844a95ccb32229f6d51c264d83b23b95e9b3cf1c80903fb1eef28/blender.distutils-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "4a50ad491fd212f026904452fc5963d8", "sha256": "b69e03763271f000bd006d7ab007df2dc924558a46b30a96cfdf7e5659a9de3e" }, "downloads": -1, "filename": "blender.distutils-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4a50ad491fd212f026904452fc5963d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4681, "upload_time": "2018-07-15T22:29:15", "url": "https://files.pythonhosted.org/packages/e2/c1/58f2d79e4ff21d35f430d8edf18f99112d81c8bbfa3bb89c18720e33cd6a/blender.distutils-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "803227dd4bf432ba6ed5d75c68fd779f", "sha256": "1b4b46449b1703ab4c69b003c11507735d66dfc2dcf4afbb6eee4a8ff869f7e5" }, "downloads": -1, "filename": "blender.distutils-1.0.5.tar.gz", "has_sig": false, "md5_digest": "803227dd4bf432ba6ed5d75c68fd779f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4231, "upload_time": "2018-07-15T22:29:17", "url": "https://files.pythonhosted.org/packages/9f/b0/5c4b5d41d45e80afd3a978fc9faed2c8f2264cdaf85bdc1345b8ef438ce3/blender.distutils-1.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "4a50ad491fd212f026904452fc5963d8", "sha256": "b69e03763271f000bd006d7ab007df2dc924558a46b30a96cfdf7e5659a9de3e" }, "downloads": -1, "filename": "blender.distutils-1.0.5-py3-none-any.whl", "has_sig": false, "md5_digest": "4a50ad491fd212f026904452fc5963d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4681, "upload_time": "2018-07-15T22:29:15", "url": "https://files.pythonhosted.org/packages/e2/c1/58f2d79e4ff21d35f430d8edf18f99112d81c8bbfa3bb89c18720e33cd6a/blender.distutils-1.0.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "803227dd4bf432ba6ed5d75c68fd779f", "sha256": "1b4b46449b1703ab4c69b003c11507735d66dfc2dcf4afbb6eee4a8ff869f7e5" }, "downloads": -1, "filename": "blender.distutils-1.0.5.tar.gz", "has_sig": false, "md5_digest": "803227dd4bf432ba6ed5d75c68fd779f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4231, "upload_time": "2018-07-15T22:29:17", "url": "https://files.pythonhosted.org/packages/9f/b0/5c4b5d41d45e80afd3a978fc9faed2c8f2264cdaf85bdc1345b8ef438ce3/blender.distutils-1.0.5.tar.gz" } ] }