{"id":26503117,"url":"https://github.com/helly25/bzl","last_synced_at":"2026-05-09T14:02:57.113Z","repository":{"id":282490013,"uuid":"948704014","full_name":"helly25/bzl","owner":"helly25","description":"Collection of Bazel support functionality.","archived":false,"fork":false,"pushed_at":"2025-03-15T09:49:59.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-15T10:18:47.441Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Starlark","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/helly25.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-14T20:03:54.000Z","updated_at":"2025-03-15T09:49:10.000Z","dependencies_parsed_at":"2025-03-15T10:18:49.082Z","dependency_job_id":null,"html_url":"https://github.com/helly25/bzl","commit_stats":null,"previous_names":["helly25/mbo_bzl","helly25/bzl"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helly25%2Fbzl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helly25%2Fbzl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helly25%2Fbzl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/helly25%2Fbzl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/helly25","download_url":"https://codeload.github.com/helly25/bzl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244676317,"owners_count":20491827,"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":[],"created_at":"2025-03-20T18:58:11.434Z","updated_at":"2026-05-09T14:02:52.071Z","avatar_url":"https://github.com/helly25.png","language":"Starlark","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Helly25 bzl, a Bazel support library\n\nThis library provides [Bazel](http://bazel.build) [Starlark](https://bazel.build/rules/language) functionality meant to help in maintaining other libraries.\n\n[![Test](https://github.com/helly25/bzl/actions/workflows/main.yml/badge.svg)](https://github.com/helly25/bzl/actions/workflows/main.yml)\n\n## Versions\n\nImplements versioning functions that mostly follow [Semver](https://semver.org/).\n\nComparators correctly respect major, minor and patch components, as well as\nSemver compliant 'pre-release' and 'build' components. The pre-release and build\ncomponents are split at \".\". Comparing pre-release parts works for alphabetical\nprefixes and numeric suffixes, so 'alpha', 'beta' and 'rc' as well as numbered\nversion of those (e.g. 'alpha1' or rc-1') are supported. For pre-releases and\nbuild pieces a single '-' in front of the numeric parts is dropped (e.g. 'rc-1'\nbecomes 'rc' + '1' while 'alpha--2' becomes 'alpha-' + '2').\n\nThe full functionality is exposed as a singele struct containing all functions.\n\nThe version parameters support:\n- a string that can be parsed according to:\n     `major`['.' `minor` [ '.' `patch` [ '.' `digits`]\\*]] ['-' [^+]+] ['+' .\\*]\n- a `list` or `tuple` where each component is a version part. If present, then:\n  - a pre-release component must be separated by a single \"-\" and split by \".\".\n  - a build component must be separated by a single \"+\" and split by \".\"\n- a single `int` which will be the major version.\n- anything else is an error and the functions will `fail`.\n- unlike Semver, the function allows any number of numeric version components.\n\nNote: Most functions support a `skip_build` parameter. If `True`, then any\npresent build component will be dropped. Conclusively the parameter is `True`\nby default for parsing and `False` for comparisons since Semver dictates that\nthat the build component must be ignored for precedence (see\n[Semver-10](https://semver.org/#spec-item-10)).\n\nThe functionality has exhaustive tests. If something still works wrong please,\nfile a bug report or propose a fix.\n\nExample:\n```bazel\nmy_version = \"25.33.42\"\nmin_version = (10, 11, 12)\nif _versions.lt(my_version, min_version):\n  fail(\"My version {my_version} is earlier than {min_version}.\".format(\n    my_version = my_version,\n    min_version = min_version,\n  ))\n```\n\nProvides:\n\n* `load(\"@helly25_bzl//bzl/versions:versions_bzl\", _versions = \"versions\")`\n  * `versions` is a single import structure:\n    * `parse`: Parses a version.\n    * `ge`: Implements `L \u003e= R`.\n    * `gt`: Implements `L \u003e R`.\n    * `le`: Implements `L \u003c= R`.\n    * `lt`: Implements `L \u003c R`.\n    * `eq`: Implements `L == R`.\n    * `ne`: Implements `L != R`.\n    * `cmp`: Implements `L \u003c=\u003e R` aka `(L \u003c R) - (L \u003e R)`.\n    * `compare`: Implements `L OP R`.\n    * `check_one_requirement`: Checks a version adheres to a single requirement.\n    * `check_all_requirements`: Checks a version adheres to a requirements list.\n    * `parse_requirements`: Parses a requirements specification.\n\n## Installation\n\nThe library is available for both Bazelmod and Workspace installations and works\non MacOS, Ubuntu and Windows with Bazel version 7.x and 8.x (Other systems are\nsimply not tested). However future version may drop Windows support.\n\n### For MODULES.bazel\n\nSee https://github.com/helly25/bzl/releases to replace the version number.\n\n```\nbazel_dep(name = \"helly25_bzl\", version = \"0.0.0\")\n```\n\n### For WORKSPACE\n\n```bazel\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nhttp_archive(\n  name = \"helly25_bzl\",\n  url = \"https://github.com/helly25/bzl/releases/download/0.0.0/bzl-0.0.0.tar.gz\",\n  sha256 = \"....\" # see https://github.com/helly25/bzl/releases for version numbers SHA256 codes.\n)\n```\n\n### Dependencies\n\n* `bazel_skylib`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelly25%2Fbzl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelly25%2Fbzl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelly25%2Fbzl/lists"}