Commits

Ali Afshar  committed a20a465

Added a build command

  • Participants
  • Parent commits dbe7709

Comments (0)

Files changed (2)

File kij/commands/build.py

+"""
+
+    :license: MIT/PSF
+    :copyright: 2010 by Ali Afshar <aafshar@gmail.com>
+"""
+
+import sys
+
+from kij.tasks.build import Build
+
+
+VERSION_INFO = tuple(sys.version_info[:2])
+
+
+def build_command(config, queue):
+    build = config.source.ensure('build', dir=True)
+    build_lib = build.ensure('lib', dir=True)
+    build_scripts = build.ensure('scripts-%s.%s' % VERSION_INFO, dir=True)
+    queue.add(Build(
+                   source=config.source,
+                   build_lib=build_lib,
+                   build_scripts=build_scripts,
+                   ))

File tests/cli/test_build.py

+
+import sys
+VERSION_INFO = tuple(sys.version_info[:2])
+
+from kij.commands.build import build_command
+from kij.task_queue import Queue
+
+def test_build_command(config, site, fullsource):
+    queue = Queue()
+    build_command(config, queue)
+    queue.run_all()
+    build = fullsource.join('build')
+    assert build.check()
+    assert build.join('lib').check()
+    assert build.join('scripts-%s.%s' % VERSION_INFO).check()
+