Commits

Ronny Pfannschmidt committed 441a314

basic sdist_module command thats found by ds1/ds2

Comments (0)

Files changed (7)

genscript/distutils/__init__.py

+__all__ = [
+    'sdist_module'
+]

genscript/distutils/sdist_module.py

+
+from distutils.cmd import Command
+from genscript.module_maker import SdistModuleMixin
+
+
+class sdist_module(SdistModuleMixin, Command):
+    def __init__(self, dist):
+        Command.__init__(self, dist)
+        SdistModuleMixin.__init__(self, dist)

genscript/distutils2/__init__.py

+__all__ = [
+    'sdist_module',
+]

genscript/distutils2/sdist_module.py

+
+from distutils2.command.cmd import Command
+from genscript.module_maker import SdistModuleMixin
+
+
+class sdist_module(SdistModuleMixin, Command):
+    def __init__(self, dist):
+        SdistModuleMixin.__init__(self, dist)
+        Command.__init__(self, dist)

genscript/module_maker.py

     lines[index+1:index] = metadata_lines(metadata)
     return ''.join(lines)
 
+
+class SdistModuleMixin:
+
+    user_options = [
+        ('script', None, 'the script to enrich')
+    ]
+
+    def __init__(self, dist):
+        self.__dist = dist
+
+    def initialize_options(self):
+        self.script = None
+
+    def finalize_options(self):
+        pass
+
+    def run(self):
+
+        self.__dist.dist_files.append(("sdist_module", ''))
+        
Empty file added.

testing/test_sdist_module.py

+
+
+