1# Copyright 2024 The Bazel Authors. All rights reserved. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14"""Allows detecting of rules_python features that aren't easily detected.""" 15 16# This is a magic string expanded by `git archive`, as set by `.gitattributes` 17# See https://git-scm.com/docs/git-archive/2.29.0#Documentation/git-archive.txt-export-subst 18_VERSION_PRIVATE = "$Format:%(describe:tags=true)$" 19 20features = struct( 21 version = _VERSION_PRIVATE if "$Format" not in _VERSION_PRIVATE else "", 22 precompile = True, 23) 24