{ "info": { "author": "Sundar Nagarajan", "author_email": "sun.nagarajan@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Programming Language :: Python :: Implementation :: PyPy" ], "description": "setupext\n========\n\nThis module contains utility methods for easing writing python\ninstallation scripts (setup.py).\n\nBuilding C extensions: See setupext/doc/setup-sample.py\n\n- Specify location of C sources\n- Specify shared library name\n- Specify specific C source files to be compiled\n\nBundle additional files with package - using get\\_dir\\_tree()\n\n- Include and INSTALL C sources under python module directory\n- Include README, LICENSE ando ther files under python module directory\n\nAdd a LIST of shell commands or python callables to execute at different\nstages of installation:\n\n- build\n- build\\_clib\n- build\\_ext\n- build\\_py\n- build\\_scripts\n- install\\_data\n- install\\_lib\n- install\\_headers\n\n| By setting values in setupext.config, a LIST of shell commands and/or\npython code (callables) can be run before or after each ofthese stages.\nNote that you need to include this package within your package if you\nwant\n| to use the trigger functionality.\n\nTo only use get\\_dir\\_tree(), just copy that function into your setup.py\n\nASSUMPTIONS AND PACKAGE LAYOUT\n==============================\n\n| This setup.py assumes following layout.\n| toplevel --> python package name\n\n::\n\n This directory\n \u251c\u2500\u2500 setup.py - this file\n \u251c\u2500\u2500 setupext.py - required in this directory\n \u251c\u2500\u2500 LICENSE - typical for github etc but not required\n \u2502 Hard-link to a file under data_dirX to keep at top level\n \u2502 and also install the same file\n \u2502\n \u251c\u2500\u2500 README.rst - typical for github etc but not requiredt\n \u2502 Hard-link to a file under data_dirX to keep at top level\n \u2502 and also install the same file\n \u2502\n \u2514\u2500\u2500 toplevel - python package name\n \u00a0\u00a0 \u251c\u2500\u2500 toplevel.__init__.py\n \u00a0\u00a0 \u251c\u2500\u2500 toplevel.module1.py\n \u00a0\u00a0 \u251c\u2500\u2500 toplevel.module2py\n \u2502\n \u00a0\u00a0 \u251c\u2500\u2500 subpkg1\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 subpkg1.module1.py\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 subpkg1.__init__.py\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 subpkg1.module2.py\n \u2502\n \u00a0\u00a0 \u251c\u2500\u2500 data_dir1 - e.g. c_files\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 data_dir1_file1\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u251c\u2500\u2500 data_dir1_file2\n \u00a0\u00a0 \u2502\u00a0\u00a0 \u2514\u2500\u2500 data_dir1_file3\n \u2502\n \u00a0\u00a0 \u2514\u2500\u2500 data_dir2 - e.g. doc\n \u00a0\u00a0 \u00a0\u00a0 \u251c\u2500\u2500 data_dir2_file1 - e.g. LICENSE\n \u00a0\u00a0 \u00a0\u00a0 \u2514\u2500\u2500 data_dir2_file2 - e.g. README.rst\n\nIf your layout is different, you may need to make changes to the\nfollowing:\n\n- Under PACKAGE DATA:\n- Set toplevel to module (dir) under which:\n\n - C Extension shared lib if any will be installed\n - Additional data if any (data\\_dirs) will be installed\n\n- Setting packages\n\n- Under ADDITIONAL keyword args to setup()\n- Add py\\_modules=[] to ADDL\\_KWARGS\n\n- Under C EXTENSION DETAILS - IFF your package includes a C extension:\n\n - Setting libpath\n - Setting c\\_src\\_list\n - Setting ext\\_modules\n\nC EXTENSION DETAILS\n===================\n\nPut the C files in a dir under toplevel so that the C files can also be\ninstalled using data\\_dirs (see ADDITIONAL DATA FILES)\n\nFor simple cases with a single extension, you should only need to set:\n\n::\n\n c_dir-->str: directory\n libname-->str: shared library filename without '.so'\n c_src_files-->list of str: C source filenames within c_dir\n\nADDITIONAL DATA FILES\n=====================\n\nI use package\\_dir and package\\_data to specify installing additional\nfiles that are:\n\n- Files in directories under toplevel\n- Wouldn't be AUTOMATICALLY included or installed because of:\n\n - py\\_modules directive\n - packages=find\\_packages() directive\n - C source required for an extension\n Examples:\n\n- Ship and INSTALL C source under the module directory\n- Ship and INSTALL any other files - e.g:\n\n - Documentation\n - LICENSE\n\nWith this method, we get following features:\n\n- Do NOT require MANIFEST.in\n- Do NOT require include\\_package\\_data directive\n- No code required in setupext.CustomInstallData class\n\nPreparatory steps:\n\n- | If package includes a C-source extension:\n | - Put C source in a dir under toplevel\n | - Set c\\_dir above to the name of the dir UNDER toplevel\n\n- Create other directories with data under toplevel\n- If you want files in TOP-LEVEL (above toplevel) included, HARD LINK\n those FILES to directories under toplevel - e.g.:\n\n - LICENSE\n - README.rst\n\n- Alternatively, hard-link these files FROM the directory under\n toplevel to the top-level so that these files can be visible at top\n level (e.g. in github)\n\n- set data\\_dirs to LIST of directories under toplevel that you want to\n include\n\nCUSTOM STEPS\n============\n\nTo add a LIST of shell commands or python callables to execute at\ndifferent steps during installation, modify setupext.config as follows:\n\n::\n\n - setupext.config is a DICT with keys representing installation steps\n - The steps supported are in setupext.known_steps (list of str)\n - Each element of setupext.config is itself a DICT with following keys:\n - 'pre': dict\n - 'post': dict\n\n 'pre' and 'post' dicts can optionally contain the following keys:\n cmdlist-->list\n each element must be one of:\n str: A shell command to execute with subprocess.call\n The command is executed with shell=True\n No additional cmdline parameters are added\n callable: Will be called with following parameters\n args=(caller): caller is instance of calling class\n Typically instance of distutils.cmd.Command\n pre_post=x: x in ['pre', 'post']\n callable can retrieve step name using\n args[0].get_command_name()\n if cmdlist is not set or is [] or None, the corresponding\n pre / post dict is ignored\n\n see pydoc setupext.run_in_order\n\n show_output-->boolean: Display stdout of shell commands\n ignored for callables\n Default: true\n\n show_err-->boolean: Display stderr of shell commands (on stderr)\n ignored for callables\n Default: true\n\n ignore_err-->boolean: Continue to next element of cmdlist if\n shell command or callable raises an exception or\n shell command returns a non-zero return code\n\n Default is stop processing cmdlist (False)\n\n show_output, show_err and ignore_err apply to ALL elements\n of cmdlist\n\n cmdlist under 'pre' key is executed BEFORE the corresponding\n installation step\n\n cmdlist under 'post' key is executed AFTER the corresponding\n installation step\n\n callables must be defined at time of executing setup.py\n\n Note that cmdlist will be executed ONLY IF corresponding\n step is executed - e.g.:\n - if byte-compiling is disabled, install_lib won't run\n - If package doesn't define a C extension, build_ext won't run\n\nEXAMPLE:\n========\n\n| Assume you want to do the following:\n| - Run shell\\_command\\_1 and callable\\_1 BEFORE\n| installation build (step: build) begins\n| - Ignore and hide errors running command at build.pre step\n| but show outputs\n| - Run shell\\_command\\_2 after build\\_ext step is completed\n\nSteps:\n------\n\n.. code:: python\n\n # Set to True to get DEBUG on stderr when each step is called\n # Debug messages will appear even if you do not setup custom commands\n # to execute for the step\n setupext.trace_triggers = False\n\n # Set shell_command_1, shell_command_2\n # shell_command_1 Will return a non-zero return code\n shell_command_1 = 'echo \"Starting build\"; uname --nosuchoption'\n shell_command_2 = 'echo \"build_ext completed\"'\n\n # define a callable\n def mycallable(*args, **kwargs):\n sys.stderr.write('%s %s\\n' % (\n args[0].get_command_name(),\n kwargs.get('pre_post', 'Unknown')\n ))\n\n # Now setup setupext.config\n setupext.config['build']['pre']['cmdlist'] = [shell_command_1, mycallable]\n setupext.config['build']['post']['ignore_err'] = True\n setupext.config['build']['post']['show_err'] = False\n # shell_command_1 will produce stderr output and return non-zero code\n # but stderr will be suppressed and mycallable will still be executed\n\n setupext.config['build_ext']['post']['cmdlist'] = [shell_command_2]\n # stderr if any from shell_command_2 will be shown (on stderr)", "description_content_type": null, "docs_url": null, "download_url": "https://github.com/sundarnagarajan/setupext.git", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sundarnagarajan/setupext", "keywords": null, "license": "License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)", "maintainer": null, "maintainer_email": null, "name": "setupext", "package_url": "https://pypi.org/project/setupext/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/setupext/", "project_urls": { "Download": "https://github.com/sundarnagarajan/setupext.git", "Homepage": "https://github.com/sundarnagarajan/setupext" }, "release_url": "https://pypi.org/project/setupext/0.24.8/", "requires_dist": null, "requires_python": null, "summary": "Utility classes and methods for using setuptools", "version": "0.24.8" }, "last_serial": 2029538, "releases": { "0.24.7": [ { "comment_text": "", "digests": { "md5": "f5554a0b22cce5470c89f1ffc4438463", "sha256": "485f8df50d64daee5d6bc9edcc03924b95d6441d53287463a9b35d31cc3cba0f" }, "downloads": -1, "filename": "setupext-0.24.7.tar.gz", "has_sig": false, "md5_digest": "f5554a0b22cce5470c89f1ffc4438463", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8931, "upload_time": "2016-03-26T01:04:24", "url": "https://files.pythonhosted.org/packages/80/fd/0b429b1b26874521731208a8604e6eae11c5184df435b31babf74eb9f5b3/setupext-0.24.7.tar.gz" } ], "0.24.8": [ { "comment_text": "", "digests": { "md5": "a4b7f655692adf4d568952eac9433058", "sha256": "7258750e114458c0ca1fd6c7fd0e4f969c021312a48a7e0bfcf678cb1c489592" }, "downloads": -1, "filename": "setupext-0.24.8.tar.gz", "has_sig": false, "md5_digest": "a4b7f655692adf4d568952eac9433058", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23742, "upload_time": "2016-03-27T01:26:31", "url": "https://files.pythonhosted.org/packages/04/1e/563cf6c484badfa013dab9a7919d6370b9ea7f5add3fbedee79597dfe7c2/setupext-0.24.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "a4b7f655692adf4d568952eac9433058", "sha256": "7258750e114458c0ca1fd6c7fd0e4f969c021312a48a7e0bfcf678cb1c489592" }, "downloads": -1, "filename": "setupext-0.24.8.tar.gz", "has_sig": false, "md5_digest": "a4b7f655692adf4d568952eac9433058", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 23742, "upload_time": "2016-03-27T01:26:31", "url": "https://files.pythonhosted.org/packages/04/1e/563cf6c484badfa013dab9a7919d6370b9ea7f5add3fbedee79597dfe7c2/setupext-0.24.8.tar.gz" } ] }