# coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.

from __future__ import (
  absolute_import,
  division,
  generators,
  nested_scopes,
  print_function,
  unicode_literals,
  with_statement,
)

from pants.task.task import Task
from pants.util.memo import memoized_property

from fsqio.pants.buildgen.core.subsystems.buildgen_subsystem import BuildgenSubsystem


class BuildgenBase(Task):
  """"A base task that provides the buildgen subsystem to its implementers."""

  @classmethod
  def global_subsystems(cls):
    return super(BuildgenBase, cls).global_subsystems() + (BuildgenSubsystem.Factory,)

  @memoized_property
  def buildgen_subsystem(self):
    # TODO(pl): When pants is a proper library dep, remove this ignore.
    # pylint: disable=no-member
    return BuildgenSubsystem.Factory.global_instance().create()

# coding=utf-8
# Copyright 2016 Foursquare Labs Inc. All Rights Reserved.

from __future__ import (
  absolute_import,
  division,
  generators,
  nested_scopes,
  print_function,
  unicode_literals,
  with_statement,
)

from pants.task.task import Task
from pants.util.memo import memoized_property

from fsqio.pants.buildgen.core.subsystems.buildgen_subsystem import BuildgenSubsystem


class BuildgenBase(Task):
  """"A base task that provides the buildgen subsystem to its implementers."""

  @classmethod
  def global_subsystems(cls):
    return super(BuildgenBase, cls).global_subsystems() + (BuildgenSubsystem.Factory,)

  @classmethod
  def implementation_version(cls):
    return super(BuildgenBase, cls).implementation_version() + [('BuildgenBase', 1)]

  @memoized_property
  def buildgen_subsystem(self):
    # TODO(pl): When pants is a proper library dep, remove this ignore.
    # pylint: disable=no-member
    return BuildgenSubsystem.Factory.global_instance().create()

Add task version to BuildgenBase.
Add task version to BuildgenBase.

Debugging a break after a refactor, I wanted to invalidate
just the buildgen caches.

(sapling split of c73dc81f2af0cdc87d21519b032ae3f6213c932c)