from invoke import Collection
from invocations import docs, testing


# TODO: let from_module specify new name
api = Collection.from_module(docs)
# TODO: maybe allow rolling configuration into it too heh
api.configure({
    'sphinx.source': 'sites/docs',
    'sphinx.target': 'sites/docs/_build',
})
api.name = 'docs'
main = Collection.from_module(docs)
main.name = 'main'
main.configure({
    'sphinx.source': 'sites/main',
    'sphinx.target': 'sites/main/_build',
})

ns = Collection(testing.test, docs=api, main=main)

from invoke import Collection
from invocations import docs, testing


# Usage doc/API site
api = Collection.from_module(docs, name='docs', config={
    'sphinx.source': 'sites/docs',
    'sphinx.target': 'sites/docs/_build',
})
# Main/about/changelog site
main = Collection.from_module(docs, name='main', config={
    'sphinx.source': 'sites/main',
    'sphinx.target': 'sites/main/_build',
})

ns = Collection(testing.test, docs=api, main=main)

Use new behavior from newer Invoke
Use new behavior from newer Invoke

  from invoke import Collection
  from invocations import docs, testing
  
  
+ # Usage doc/API site
+ api = Collection.from_module(docs, name='docs', config={
- # TODO: let from_module specify new name
- api = Collection.from_module(docs)
- # TODO: maybe allow rolling configuration into it too heh
- api.configure({
      'sphinx.source': 'sites/docs',
      'sphinx.target': 'sites/docs/_build',
  })
+ # Main/about/changelog site
+ main = Collection.from_module(docs, name='main', config={
- api.name = 'docs'
- main = Collection.from_module(docs)
- main.name = 'main'
- main.configure({
      'sphinx.source': 'sites/main',
      'sphinx.target': 'sites/main/_build',
  })
  
  ns = Collection(testing.test, docs=api, main=main)
  
Use new behavior from newer Invoke
## Code Before:
from invoke import Collection
from invocations import docs, testing


# TODO: let from_module specify new name
api = Collection.from_module(docs)
# TODO: maybe allow rolling configuration into it too heh
api.configure({
    'sphinx.source': 'sites/docs',
    'sphinx.target': 'sites/docs/_build',
})
api.name = 'docs'
main = Collection.from_module(docs)
main.name = 'main'
main.configure({
    'sphinx.source': 'sites/main',
    'sphinx.target': 'sites/main/_build',
})

ns = Collection(testing.test, docs=api, main=main)

## Instruction:
Use new behavior from newer Invoke
## Code After:
from invoke import Collection
from invocations import docs, testing


# Usage doc/API site
api = Collection.from_module(docs, name='docs', config={
    'sphinx.source': 'sites/docs',
    'sphinx.target': 'sites/docs/_build',
})
# Main/about/changelog site
main = Collection.from_module(docs, name='main', config={
    'sphinx.source': 'sites/main',
    'sphinx.target': 'sites/main/_build',
})

ns = Collection(testing.test, docs=api, main=main)
