code: def determine_package_type(filename, args):
      
      if args.package_type:
          package_type = args.package_type
      else:
          logger.info('Detecting file type...')
  
          package_type = detect_package_type(filename)
  
          if package_type is None:
              message = 'Could not detect package type of file %r please specify package type with option --package-type' % filename
              logger.error(message)
              raise errors.BinstarError(message)
  
          logger.info('File type is "%s"', package_type)
  
      return package_type
docs: return the file type from the inspected package or from the
      -t/--package-type argument