import sys
import os
import yaml
import jinja2
import glob
from conda_build.config import config
from conda_build.metadata import MetaData
from distutils.version import LooseVersion

recipe_metadata = MetaData(os.path.join(sys.argv[1]))
binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(recipe_metadata.name()))
binary_package = sorted(glob.glob(binary_package_glob), key=LooseVersion, reverse = True)[0]

print(binary_package)

import sys
import os
import yaml
import jinja2
import glob
from conda_build.config import Config
from conda_build.metadata import MetaData
from distutils.version import LooseVersion

config = Config()
recipe_metadata = MetaData(os.path.join(sys.argv[1]))
binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(recipe_metadata.name()))
binary_package = sorted(glob.glob(binary_package_glob), key=LooseVersion, reverse = True)[0]

print(binary_package)

Update get build path script for conda-build 2.0
Update get build path script for conda-build 2.0

In conda-build 2.0 the config API changed.

  import sys
  import os
  import yaml
  import jinja2
  import glob
- from conda_build.config import config
+ from conda_build.config import Config
  from conda_build.metadata import MetaData
  from distutils.version import LooseVersion
  
+ config = Config()
  recipe_metadata = MetaData(os.path.join(sys.argv[1]))
  binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(recipe_metadata.name()))
  binary_package = sorted(glob.glob(binary_package_glob), key=LooseVersion, reverse = True)[0]
  
  print(binary_package)
  
Update get build path script for conda-build 2.0
## Code Before:
import sys
import os
import yaml
import jinja2
import glob
from conda_build.config import config
from conda_build.metadata import MetaData
from distutils.version import LooseVersion

recipe_metadata = MetaData(os.path.join(sys.argv[1]))
binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(recipe_metadata.name()))
binary_package = sorted(glob.glob(binary_package_glob), key=LooseVersion, reverse = True)[0]

print(binary_package)

## Instruction:
Update get build path script for conda-build 2.0
## Code After:
import sys
import os
import yaml
import jinja2
import glob
from conda_build.config import Config
from conda_build.metadata import MetaData
from distutils.version import LooseVersion

config = Config()
recipe_metadata = MetaData(os.path.join(sys.argv[1]))
binary_package_glob = os.path.join(config.bldpkgs_dir, '{0}*.tar.bz2'.format(recipe_metadata.name()))
binary_package = sorted(glob.glob(binary_package_glob), key=LooseVersion, reverse = True)[0]

print(binary_package)
