{"id":13450955,"url":"https://github.com/google/subpar","last_synced_at":"2025-03-23T16:32:44.608Z","repository":{"id":45912810,"uuid":"64876050","full_name":"google/subpar","owner":"google","description":"Subpar is a utility for creating self-contained python executables. It is designed to work well with Bazel.","archived":true,"fork":false,"pushed_at":"2022-12-27T14:53:53.000Z","size":175,"stargazers_count":565,"open_issues_count":44,"forks_count":71,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-03-22T00:42:43.230Z","etag":null,"topics":["bazel","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/google.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":"CODEOWNERS","security":null,"support":null}},"created_at":"2016-08-03T20:11:35.000Z","updated_at":"2025-03-17T22:48:51.000Z","dependencies_parsed_at":"2023-01-31T04:01:45.822Z","dependency_job_id":null,"html_url":"https://github.com/google/subpar","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsubpar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsubpar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsubpar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/google%2Fsubpar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/google","download_url":"https://codeload.github.com/google/subpar/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245131149,"owners_count":20565780,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bazel","python"],"created_at":"2024-07-31T07:00:40.797Z","updated_at":"2025-03-23T16:32:44.211Z","avatar_url":"https://github.com/google.png","language":"Python","readme":"# Subpar (deprecated)\n\n[![Build Status](https://travis-ci.org/google/subpar.svg?branch=master)](https://travis-ci.org/google/subpar)\n\nSubpar is a utility for creating self-contained python executables.  It is\ndesigned to work well with [Bazel](https://bazel.build/).\n\n## Status\n\nThis project is unmaintained and considered deprecated.\nHistorically, subpar was the only way to produce a deployable Python artifact in Bazel. \nThis is no longer true; `--build_python_zip` and the `python_zip_file` output_group allows you to create executable Python zip artifacts with the standard `py_binary` rule.\n`rules_docker` can also be used to build container images that launch `py_binary`.\n\n## Setup\n\n* Add the following to your WORKSPACE file:\n\n```python\ngit_repository(\n    name = \"subpar\",\n    remote = \"https://github.com/google/subpar\",\n    tag = \"1.0.0\",\n)\n```\n\n* Add the following to the top of any BUILD files that declare `par_binary()`\n  rules:\n\n```python\nload(\"@subpar//:subpar.bzl\", \"par_binary\")\n```\n\n## Usage\n\n`par_binary()` is a drop-in replacement for `py_binary()` in your BUILD files\nthat also builds a self-contained, single-file executable for the application,\nwith a `.par` file extension.\n\nTo build the `.par` file associated with a `par_binary(name=myname)` rule, do\n\n``` shell\nbazel build //my/package:myname.par\n```\n\nThe .par file is created alongside the python stub and .runfiles\ndirectories that py_binary() creates, but is independent of them.\nIt can be copied to other directories or machines, and executed\ndirectly without needing the .runfiles directory. The body of the\n.par file contains all the srcs, deps, and data files listed.\n\n## Limitations:\n\n* C extension modules in 'deps' is not yet supported\n* Automatic re-extraction of '.runfiles' is not yet supported\n* Does not include a copy of the Python interpreter ('hermetic .par')\n\n## Example\n\nGiven a `BUILD` file with the following:\n\n```python\nload(\"@subpar//:subpar.bzl\", \"par_binary\")\n\npar_binary(\n    name = 'foo',\n    srcs = ['foo.py', 'bar.py'],\n    deps = ['//baz:some_py_lib'],\n    data = ['quux.dat'],\n)\n```\n\nRun the following build command:\n\n``` shell\nbazel build //package:foo.par\n```\n\nThis results in the following files being created by bazel build:\n\n```\nbazel-bin/\n    package/\n        foo\n        foo.par\n        foo.runfiles/\n            ...\n```\n\nThe .par file can be copied, moved, or renamed, and still run like a\ncompiled executable file:\n\n```\n$ scp bazel-bin/package/foo.par my-other-machine:foo.par\n$ ssh my-other-machine ./foo.par\n```\n\n## System Requirements\n\n* Python Versions: CPython versions 2.7.6+\n* Operating Systems: Debian-derived Linux, including Ubuntu and Goobuntu.\n\n# DISCLAIMER\n\nThis is not an official Google product, it is just code that happens\nto be owned by Google.\n","funding_links":[],"categories":["Python","Resources"],"sub_categories":["Projects"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fsubpar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogle%2Fsubpar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogle%2Fsubpar/lists"}