Ver Fonte

Added fixtures, fixed lots and lots of packaging errors

Marcos Dumay de Medeiros há 9 anos atrás
pai
commit
216d839248
4 ficheiros alterados com 37 adições e 5 exclusões
  1. 3 0
      MANIFEST.in
  2. 0 0
      README
  3. 22 5
      setup.py
  4. 12 0
      src/rapid/fixtures/register_rapid.json

+ 3 - 0
MANIFEST.in

@@ -1 +1,4 @@
 include README.rst
+recursive-include src/rapid *
+prune .git
+prune ENV

+ 0 - 0
README


+ 22 - 5
setup.py

@@ -7,9 +7,26 @@ __author__ = 'marcos.medeiros'
 from setuptools import setup, find_packages
 # To use a consistent encoding
 from codecs import open
+import os
 from os import path
 
+def _recursive_find(root, p):
+    full_p = path.join(root, p)
+    for f in os.listdir(full_p):
+        full_f = path.join(full_p, f)
+        val_f = path.join(p, f)
+        if path.isdir(full_f):
+            for ff in _recursive_find(root, val_f):
+                yield ff
+        else:
+             yield val_f
+
+
 here = path.abspath(path.dirname(__file__))
+rapid = path.join('src', 'rapid')
+rapid_files = list(_recursive_find(os.path.join(here, rapid), ''))
+
+print rapid_files
 
 # Get the long description from the relevant file
 with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
@@ -57,7 +74,7 @@ setup(
 
     # You can just specify the packages manually here if your project is
     # simple. Or you can use find_packages().
-    packages=find_packages('src', exclude=['contrib', 'docs', 'tests*']),
+    packages=['rapid'],
     package_dir = {'': 'src'},
 
     zip_safe = False,
@@ -78,10 +95,10 @@ setup(
     # installed, specify them here.  If using Python 2.6 or less, then these
     # have to be included in MANIFEST.in as well.
 
-    include_package_data=True,
-    # package_data={
-    #     'sample': ['package_data.dat'],
-    # },
+    #include_package_data=True,
+    package_data={
+        'rapid': rapid_files,
+    },
 
     # Although 'package_data' is the preferred approach, in some case you may
     # need to place data files outside of your packages. See:

+ 12 - 0
src/rapid/fixtures/register_rapid.json

@@ -0,0 +1,12 @@
+[
+    {
+	"model": "rapid.application",
+	"pk": 1,
+	"fields": {
+	    "name": "applications",
+	    "python_name": "rapid",
+	    "url": "applications",
+	    "enabled": True
+	}
+    },
+]