{ "info": { "author": "Saud Wasly", "author_email": "saudalwasli@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "License :: OSI Approved :: MIT License", "Topic :: Utilities" ], "description": "README\n======\n\npymake2 is a simple Python-based make system. It brings simplicity and\nflexibility of Python language to makefiles. The name 'pymake2' is\nchosen because 'pymake' is already used for another tool that\nre-implements the GNU make in python. pymake2 is different from pymake\nas it does not try to re-implements GNU make, but a new simple make\nsystem that uses Python for makefiles to leverage the language richness\nand flexibility. pymake2 parses makefile-like python scripts and\nprovides useful messages to help understand what goes wrong during the\nbuild process.\n\nHow to install pymake2\n~~~~~~~~~~~~~~~~~~~~~~\n\n1. You can use ``pip`` to automatically download and install ``pymake2``\n from the PyPi repository using the following command:\n\n for the current user (user-site-packages):\n\n ::\n\n pip install --user pymake2\n\n for system-wide installation:\n\n ::\n\n sudo pip install pymake2\n\n2. You can always clone the repository and install it manually by\n running the following command:\n\n ::\n\n python setup.py install\n\nUsing pymake2\n~~~~~~~~~~~~~\n\n::\n\n #> pymake2 -h\n usage: pymake2 [-h] [-f MakefilePath] [-j Jobs] Target\n\n pymake2 is a simple make system implemented in python\n\n positional arguments:\n Target the make target in the makefile\n\n optional arguments:\n -h, --help show this help message and exit\n -f MakefilePath to pass a makefile, default = ./makefile.py\n -j Jobs number of jobs used in the make process\n #> \n\npymake2 looks into the current working directory for the default\n``makefile.py`` and provides tab-auto-complete for the targets in that\nmakefile. If the option ``-f /path/to/makefile.py`` is used, pymake2\nprovides tab-auto-complete for the targets in selected makefile instead.\n\nThe following snippet shows a makefile example for arbitrary gcc-based\nC99 project.\n\n.. code:: python\n\n from pymake2 import *\n Debug = True # <-- set it to True to enable more debugging messages \n # HighlightErrors = True # To enable the highliter\n HighlightWarnings = True # To enable the highliter\n HighlightNotes = True # To enable the highliter\n\n # Custom Highlighting using regular expressions\n hl(regx(r'error:.+'), colors.IRed)\n # hl(regx(r'expression'), colors.IGreen, colors.On_Cyan)\n # hl('c', colors.IGreen)\n\n\n CC = 'gcc'\n CFLAGS = '-g -O2 -std=c99'\n LINKFLAGS = ''\n\n executable = 'a.out'\n BUILDdir = './Build/'\n src_files = find(root='./', filter='*.c')\n obj_files = replace(src_files, '.c', '.o')\n obj_files = retarget(obj_files, BUILDdir, '')\n\n\n @target\n def all(Tlink): # depends on Target link\n printcolor('Build Succeeded', colors.IGreen)\n return True\n\n @target\n def Tlink(Tcompile): # depends on Target compile\n return link(CC, LINKFLAGS, obj_files, executable)\n\n @target\n def Tcompile(src_files): # depends on srource files\n return compile(CC, CFLAGS, src_files, obj_files)\n \n\n\n @target\n def clean():\n retV = run(eval('rm -r $(BUILDdir)'))\n retV = run(eval('rm $(executable)'))\n return True\n\nFirst of all, ``makefile.py`` must import pymake2. To enable detailed\nerror messages in the build process, ``Debug`` variable should be set to\nTrue. The above snippet is self-explanatory to any one used to work with\nmakefiles.\n\nThe following makefile example is for arbitrary latex project:\n\n.. code:: python\n\n from pymake2 import *\n Debug = True # <-- set it to True to enable more debugging messages \n HighlightErrors = True # To enable the highliter\n HighlightWarnings = True # To enable the highliter\n HighlightNotes = True # To enable the highliter\n\n latexfile = 'main.tex'\n pdffile = 'main.pdf'\n\n @target\n def all(pdf):\n printcolor('Build Succeded', colors.Green)\n return True\n\n @target\n def pdf(latexfile):\n if run(eval('pdflatex -shell-escape -halt-on-error $(latexfile)'), True, True):\n printcolor('Build Succeded', fg='32', B=True)\n run(eval('evince $(pdffile)&'))\n return True\n\n @target\n def clean():\n retV = run(eval('rm -f *.aux *.log *.blg *.bbl *.synctex.gz *.out *.cut $(pdffile) *.vtc'), True)\n return retV\n\nFeatures of pymake2\n~~~~~~~~~~~~~~~~~~~\n\n- ``makefile.py`` follows similar approach of GNU make, but with the\n flexibility of Python\n- pymake2 automatically highlights error, warning, and info messages\n produced by the compiler or the linker. This is especially useful\n when the used toolchain does not prints colorful outputs. As shown in\n the snippet above, to get highlighted outputs, you need to enable\n ``HighlightErrors``, ``HighlightWarnings``, and ``HighlightNotes``,\n or use custom highlighting as needed. The highlighted outputs only\n works with the commands provided by pymake2 such as ``compile``,\n ``link``, and ``archive`` and not with ``shell``, ``sh``, or ``run``\n commands.\n- the ``eval`` function recognizes the format of makefile-like\n variables, such as ``$(BUILDdir)`` and ``$(CC)``, ...etc. This\n feature helps to port existing makefiles to pymake2. In addition, the\n ``eval`` function evaluates environment variables in the same way.\n However, variables defined in the makefile has precedence over the\n environment variables. In other words, redefining environment\n variables in the makefile overrides them.\n- the target function accepts unlimited number of arguments to specify\n dependencies.\n\n - the dependency can be another target function/s, or a list of\n files.\n - pymake2 tries to satisfy all the dependences before invoking the\n target function.\n - if a target function is in the dependency list of another target\n function, it must return True upon success.\n\n- pymake2 provides a set of helper functions; below I list some of\n them, see ``make.py`` in the source files for more details about\n their parameters.\n\n - ``shell('cmd')`` and ``sh('cmd')``: runs the shell command and\n return the output.\n - ``run('cmd')``: runs the shell command without returning the\n output.\n - ``compile(...)``: if necessary, compiles the source files using\n the specified compiler along with the passed flags.\n - ``link(...)``: if necessary, links the object files to provide the\n executable using the passed linker and flags.\n - ``archive(...)``: if necessary, archives the object files to\n provide the output library using the passed archiver such as\n ``gcc-ar`` along with the passed flags.\n\n- pymake2 automatically recognizes space-separated lists (used in\n makefiles for source or object files) and converts them to Python\n lists. Therefore, the commands provided by pymake2 such as\n ``compile`` and ``link`` accepts both formats (Python list, and\n space-separated list).\n\nScreenshots\n~~~~~~~~~~~\n\nSuccesfull build with highlighted compile warnings.\n\n.. figure:: https://bytebucket.org/saudalwasly/pymake2/raw/eb224dac994da5fb0d660edf19ac2792e46544e9/screenshots/screenshot_1.png\n :alt: screenshot example of a successful build\n\n alt text\n\nRebuilding the same target yields already satisfied dependencies and not\nneed to recompile and link.\n\n.. figure:: https://bytebucket.org/saudalwasly/pymake2/raw/eb224dac994da5fb0d660edf19ac2792e46544e9/screenshots/screenshot_2.png\n :alt: screenshot example of a successful build\n\n alt text\n\nBuilding for the target ``Tlib`` failed after cleaning as it depends on\nall object files ``OBJ_All``.\n\n.. figure:: https://bytebucket.org/saudalwasly/pymake2/raw/eb224dac994da5fb0d660edf19ac2792e46544e9/screenshots/screenshot_3.png\n :alt: screenshot example of a failed on dependency\n\n alt text\n\nLicense\n~~~~~~~\n\npymake2 is distributed under MIT license.\n\nCopyright (c) 2016 Saud Wasly\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/saudalwasly/pymake2/src", "keywords": "make makefile build", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "pymake2", "package_url": "https://pypi.org/project/pymake2/", "platform": "", "project_url": "https://pypi.org/project/pymake2/", "project_urls": { "Homepage": "https://bitbucket.org/saudalwasly/pymake2/src" }, "release_url": "https://pypi.org/project/pymake2/0.5.33/", "requires_dist": null, "requires_python": "", "summary": "pymake2 is a simple Python-based make system. It brings simplicity and flexibility of Python language to makefiles.", "version": "0.5.33" }, "last_serial": 3285097, "releases": { "0.5.2": [ { "comment_text": "", "digests": { "md5": "4fb22a77fc08cc774603509190a45622", "sha256": "af833356d3e7d8d882a730e33ee30dc0828f9aecc55ecf4a7a6d7b0debe0553c" }, "downloads": -1, "filename": "pymake2-0.5.2.tar.gz", "has_sig": false, "md5_digest": "4fb22a77fc08cc774603509190a45622", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17368, "upload_time": "2017-10-27T23:42:43", "url": "https://files.pythonhosted.org/packages/5c/81/dcc4fab9411b02ee22541658ccb779787ddab0c2972a33a4b96198c05833/pymake2-0.5.2.tar.gz" } ], "0.5.3": [ { "comment_text": "", "digests": { "md5": "59eeb1dce5aabb045781284b8622ad06", "sha256": "742736aeca815ccb045555e9410babc006b529699cadd0045d450bb301904a92" }, "downloads": -1, "filename": "pymake2-0.5.3.tar.gz", "has_sig": false, "md5_digest": "59eeb1dce5aabb045781284b8622ad06", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16990, "upload_time": "2017-10-28T00:57:55", "url": "https://files.pythonhosted.org/packages/7e/3b/6959456b8f4dc41ef7bd5699236c68acbbb29506b51f6795f4c925e945df/pymake2-0.5.3.tar.gz" } ], "0.5.31": [ { "comment_text": "", "digests": { "md5": "c26cda9e74587674b07293a2cc62bb9a", "sha256": "cd6a611e1afeca33ddd0d16e37910024d26a1685fb763edc90c2a65eae63c889" }, "downloads": -1, "filename": "pymake2-0.5.31.tar.gz", "has_sig": false, "md5_digest": "c26cda9e74587674b07293a2cc62bb9a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17031, "upload_time": "2017-10-28T01:05:55", "url": "https://files.pythonhosted.org/packages/a8/60/7d20c86e81c1b2429a25a8fd127ee212bb25893b04a74c8c4f935f201588/pymake2-0.5.31.tar.gz" } ], "0.5.32": [ { "comment_text": "", "digests": { "md5": "62eeb9a59357b2acf6af7306f7ada0e3", "sha256": "b1c877a6eaff4cec0aca893c0c1243b15b2c62af22a8ebbc17a8e1d393a14229" }, "downloads": -1, "filename": "pymake2-0.5.32.tar.gz", "has_sig": false, "md5_digest": "62eeb9a59357b2acf6af7306f7ada0e3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17037, "upload_time": "2017-10-28T01:14:33", "url": "https://files.pythonhosted.org/packages/35/91/21db23e8aea41e34db7e26cc84c4a4c9b3c15f6109ec0241d46886e997fb/pymake2-0.5.32.tar.gz" } ], "0.5.33": [ { "comment_text": "", "digests": { "md5": "f97de748d4e1204a84cdecfa0402330a", "sha256": "154afad475323c1eb941ccee381dbe50e22c73ee2decc4dfbdb8a15afc9fa135" }, "downloads": -1, "filename": "pymake2-0.5.33.tar.gz", "has_sig": false, "md5_digest": "f97de748d4e1204a84cdecfa0402330a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17045, "upload_time": "2017-10-28T01:45:22", "url": "https://files.pythonhosted.org/packages/6a/e2/7c5527b927c2aedfd362fcc3370e8819349904bc57b7dc5cbcc86ce03ebb/pymake2-0.5.33.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f97de748d4e1204a84cdecfa0402330a", "sha256": "154afad475323c1eb941ccee381dbe50e22c73ee2decc4dfbdb8a15afc9fa135" }, "downloads": -1, "filename": "pymake2-0.5.33.tar.gz", "has_sig": false, "md5_digest": "f97de748d4e1204a84cdecfa0402330a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17045, "upload_time": "2017-10-28T01:45:22", "url": "https://files.pythonhosted.org/packages/6a/e2/7c5527b927c2aedfd362fcc3370e8819349904bc57b7dc5cbcc86ce03ebb/pymake2-0.5.33.tar.gz" } ] }