class_docstr: Represents one configuration of a build, i.e.
  a set of versions of dependent libraries.
  
  Members:
      conda_always_copy: avoids hard linking which can behave weirdly.
      conda_debug: get added information about package search
      conda_dirty: see intermediate files after build
      build_inside_tree: output in build/ not ../build
      is_release: whether this is an official versioned release
class_docstr_tok: ["Represents","one","configuration","of","a","build",",","i.e",".","a","set","of","versions","of","dependent","libraries",".","Members",":","conda_always_copy",":","avoids","hard","linking","which","can","behave","weirdly",".","conda_debug",":","get","added","information","about","package","search","conda_dirty",":","see","intermediate","files","after","build","build_inside_tree",":","output","in","build\/","not","..","\/build","is_release",":","whether","this","is","an","official","versioned","release"]
docstr: NOTE: Variables set here won't be visible in `setup.py`
  UNLESS they are also specified in meta.yaml
docstr_tok: ["NOTE",":","Variables","set","here","wo","n't","be","visible","in","`","setup.py","`","UNLESS","they","are","also","specified","in","meta.yaml"]
code: def _set_env_for_build(self) -> None:
      """
      NOTE: Variables set here won't be visible in `setup.py`
      UNLESS they are also specified in meta.yaml
      """
      assert (
          "BUILD_VERSION" in os.environ
      ), "BUILD_VERSION must be set as env variable"
      tag = subprocess.check_output(
          ["git", "rev-parse", "--short", "HEAD"], text=True
      ).strip()
      os.environ["GIT_TAG"] = tag
      os.environ["PYTORCH_VERSION"] = self.pytorch_version
      os.environ["CU_VERSION"] = self.cuda_version
      os.environ["SOURCE_ROOT_DIR"] = str(SOURCE_ROOT_DIR)
  
      # At build time, the same major/minor (otherwise we might get a CPU pytorch ...)
      cuda_constraint_build = "=" + ".".join(
          self.cuda_version.split(".")[:2]
      )
      pytorch_version_tuple = tuple(
          int(v) for v in self.pytorch_version.split(".")[:2]
      )
      if pytorch_version_tuple < (1, 13):
          os.environ[
              "CONDA_CUDA_CONSTRAINT_BUILD"
          ] = f"cudatoolkit{cuda_constraint_build}"
          os.environ[
              "CONDA_CUDA_CONSTRAINT_RUN"
          ] = f"cudatoolkit{self.cuda_dep_runtime}"
      else:
          os.environ[
              "CONDA_CUDA_CONSTRAINT_BUILD"
          ] = f"pytorch-cuda{cuda_constraint_build}"
          os.environ[
              "CONDA_CUDA_CONSTRAINT_RUN"
          ] = f"pytorch-cuda{self.cuda_dep_runtime}"
  
      if self.conda_always_copy:
          os.environ["CONDA_ALWAYS_COPY"] = "true"
  
file_path: xformers/packaging/build_conda.py
imports: import argparse
  import os
  import shutil
  import subprocess
  from dataclasses import dataclass
  from pathlib import Path
  from typing import List
label_desc: Use image node_id 1 for calling the Build obj's underlying member method code with example usage: obj._set_env_for_build() without return types