{ "info": { "author": "Tuomas Rintamaki", "author_email": "", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Topic :: Software Development :: Build Tools" ], "description": "# pazel - generate Bazel BUILD files for Python\n\n[![Build Status](https://travis-ci.org/tuomasr/pazel.svg?branch=master)](https://travis-ci.org/tuomasr/pazel)\n\n## Requirements\n\n### pazel\nNo requirements. Tested on Python 2.7 and 3.6 on Ubuntu 16.04 and macOS High Sierra.\n\n### Bazel\nTested on Bazel 0.11.1. All recent versions are expected to work.\n\n## Installation\n\n```\n> git clone https://github.com/tuomasr/pazel.git\n> cd pazel\n> python setup.py install\n```\n\n## Usage\n\nNOTE: `pazel` overwrites any existing BUILD files. Please use version control or have backups of\nyour current BUILD files before using `pazel`.\n\n### Default usage with Bazel\n\nThe following example generates all BUILD files for the sample Python project in `sample_app`.\nStart from the `pazel` root directory to which the repository was cloned.\n\n```\n> bazel run //pazel:app -- /sample_app -r /sample_app\n-c /sample_app/.pazelrc\nGenerated BUILD files for /sample_app.\n```\n\n### Default usage without Bazel\n\nStart from the `pazel` root directory.\n\n```\n> cd sample_app\n> pazel\nGenerated BUILD files for /sample_app.\n```\n\n### Testing the generated BUILD files\n\nNow, we can build, test, and run the sample project by running the following invocations in the\n`sample_app` directory, respectively.\n\n```\n> bazel build\n> bazel test ...\n> bazel run foo:bar3\n```\n\n### Command-line options\n\n`pazel -h` shows a summary of the command-line options. Each of them is explained below.\n\nBy default, BUILD files are generated recursively for the current working directory.\nUse `pazel ` to generate BUILD file(s) recursively for another directory\nor for a single Python file.\n\nAll imports are assumed to be relative to the current working directory. For example,\n`sample_app/foo/bar2.py` imports from `sample_app/foo/bar1.py` using `from foo.bar1 import sample`.\nUse `pazel -r ` to override the path to which the imports are relative.\n\nBy default, `pazel` adds rules to install all external Python packages. If your environment has\npre-installed packages for which these rules are not required, then use `pazel -p`.\n\n`pazel` config file `.pazelrc` is read from the current working directory. Use\n`pazel -c ` to specify an alternative path.\n\n### Ignoring rules in existing BUILD files\n\nThe tag `# pazel-ignore` causes `pazel` to ignore the rule that immediately follows the tag in an\nexisting BUILD file. In particular, the tag can be used to skip custom rules that `pazel` does not\nhandle. `pazel` places the ignored rules at the bottom of the BUILD file. See `sample_app/foo/BUILD`\nfor an example using the tag.\n\n\n### Customizing and extending pazel\n\n`pazel` can be programmed using a `.pazelrc` Python file, which is read from the current\nworking directory or provided explicitly with `pazel -c `.\n\nThe user can define variables `HEADER` and `FOOTER` to add custom header and footer to\nall BUILD files, respectively. See `sample_app/.pazelrc` and `sample_app/BUILD` for an example that\nadds the same `visibility` to all BUILD files.\n\nIf some pip package has different install name than import name, then the user\nshould define `EXTRA_IMPORT_NAME_TO_PIP_NAME` dictionary accordingly. `sample_app/.pazelrc` has\n`{'yaml': 'pyyaml'}` as an example. In addition, the user can specify local packages and their\ncorresponding Bazel dependencies using the `EXTRA_LOCAL_IMPORT_NAME_TO_DEP` dictionary.\n\nThe user can add support for custom Bazel rules by defining a new class implementing the `BazelRule`\ninterface in `pazel/bazel_rules.py` and by adding that class to `EXTRA_BAZEL_RULES` list in\n`.pazelrc`. `sample_app/.pazelrc` defines a custom `PyDoctestRule` class that identifies all\ndoctests and generates custom `py_doctest` Bazel rules for them as defined in\n`sample_app/custom_rules.bzl`.\n\nIn addition, the user can implement custom rules for mapping Python imports to Bazel dependencies\nthat are not natively supported. That is achieved by defining a new class implementing the\n`InferenceImportRule` interface in `pazel/import_inference_rules.py` and by adding the class to\n`EXTRA_IMPORT_INFERENCE_RULES` list in `.pazelrc`. `sample_app/.pazelrc` defines a custom\n`LocalImportAllInferenceRule` class that generates the correct Bazel dependencies for\n`from X import *` type of imports where `X` is a local package.\n\n\n## BUILD file formatting\n\n`pazel` generates BUILD files that are nearly compatible with\n[Buildifier](https://github.com/bazelbuild/buildtools/tree/master/buildifier). Buildifier can be\napplied on `pazel`-generated BUILD files to remove the remaining differences, if needed.\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/tuomasr/pazel", "keywords": "automation", "license": "", "maintainer": "", "maintainer_email": "", "name": "pazel", "package_url": "https://pypi.org/project/pazel/", "platform": "", "project_url": "https://pypi.org/project/pazel/", "project_urls": { "Homepage": "https://github.com/tuomasr/pazel" }, "release_url": "https://pypi.org/project/pazel/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Generate Bazel BUILD files for a Python project.", "version": "0.1.0" }, "last_serial": 5955929, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "e02247b8c61fcbd903c612ae06772db6", "sha256": "6deb4dbb0157adc24eb3ed79c11930de6d1c491ea1fa40c2879a810cefc58267" }, "downloads": -1, "filename": "pazel-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e02247b8c61fcbd903c612ae06772db6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23866, "upload_time": "2019-10-10T16:55:42", "url": "https://files.pythonhosted.org/packages/ea/d8/3538b14dbcba810d1f1b9a367df359f54121528c898a29ed7279962e5f02/pazel-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "842f5c2ae5884c741cbdb6155740b7d0", "sha256": "dad3763fd9a813e0c6909fd547f1511d18fad07773972c4e766128f5c06161f6" }, "downloads": -1, "filename": "pazel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "842f5c2ae5884c741cbdb6155740b7d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16501, "upload_time": "2019-10-10T16:55:45", "url": "https://files.pythonhosted.org/packages/33/64/94741fb37a23e932fb1b6a07ce0a8dc50497c6f6c68189e867eb3579b3fd/pazel-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e02247b8c61fcbd903c612ae06772db6", "sha256": "6deb4dbb0157adc24eb3ed79c11930de6d1c491ea1fa40c2879a810cefc58267" }, "downloads": -1, "filename": "pazel-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e02247b8c61fcbd903c612ae06772db6", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23866, "upload_time": "2019-10-10T16:55:42", "url": "https://files.pythonhosted.org/packages/ea/d8/3538b14dbcba810d1f1b9a367df359f54121528c898a29ed7279962e5f02/pazel-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "842f5c2ae5884c741cbdb6155740b7d0", "sha256": "dad3763fd9a813e0c6909fd547f1511d18fad07773972c4e766128f5c06161f6" }, "downloads": -1, "filename": "pazel-0.1.0.tar.gz", "has_sig": false, "md5_digest": "842f5c2ae5884c741cbdb6155740b7d0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16501, "upload_time": "2019-10-10T16:55:45", "url": "https://files.pythonhosted.org/packages/33/64/94741fb37a23e932fb1b6a07ce0a8dc50497c6f6c68189e867eb3579b3fd/pazel-0.1.0.tar.gz" } ] }