Commits

Andriy Kornatskyy committed 45c86c0

Updated new project template.

Comments (0)

Files changed (6)

 
 test-demos:
 	$(PYTEST) -q -x --pep8 demos/hello
+	make clean test -sC demos/template VERSION=$(VERSION)
 	make clean test -sC demos/public VERSION=$(VERSION)

demos/template/MANIFEST.in

+include README

demos/template/Makefile

-.SILENT: clean po run test benchmark
-.PHONY: clean po run test benchmark
+.SILENT: env clean po run test benchmark
+.PHONY: env clean po run test benchmark
 
 VERSION=2.7
+PYPI=http://pypi.python.org/simple
+ENV=../../env
 
-ENV=../../env
 PYTHON=$(ENV)/bin/python$(VERSION)
+EASY_INSTALL=$(ENV)/bin/easy_install-$(VERSION)
 PYTEST=$(ENV)/bin/py.test-$(VERSION)
 NOSE=$(ENV)/bin/nosetests-$(VERSION)
 
 
+all: clean po test-cover release
+
+env:
+	PYTHON_EXE=/usr/local/bin/python$(VERSION); \
+	if [ ! -x $$PYTHON_EXE ]; then \
+		    PYTHON_EXE=/usr/bin/python$(VERSION); \
+	fi;\
+	virtualenv --python=$$PYTHON_EXE env
+	$(EASY_INSTALL) -i $(PYPI) -O2 coverage nose pytest \
+	        pytest-pep8 pytest-cov wsgiref
+	$(PYTHON) setup.py develop -i $(PYPI)
+
 clean:
 	find src/ -type d -name __pycache__ | xargs rm -rf
 	find src/ -name '*.py[co]' -delete
 	find src/ -name '*.mo' -delete
 	rm -rf /tmp/mako_modules/
 
+release:
+	$(PYTHON) setup.py -q egg_info sdist
+
 po:
 	xgettext --join-existing --sort-by-file --omit-header \
 		--language=Python \

demos/template/README

Empty file added.

demos/template/setup.cfg

+[egg_info]
+tag_build=
+tag_date=0
+tag_svn_revision=0
+
+[bdist_egg]
+exclude-source-files=0
+
+[pytest]

demos/template/setup.py

+#!/usr/bin/env python
+
+import os
+
+try:
+    from setuptools import setup
+except:
+    from distutils.core import setup
+
+README = open(os.path.join(os.path.dirname(__file__), 'README')).read()
+
+install_requires = [
+    'wheezy.core>=0.1.65',
+    'wheezy.caching>=0.1.53',
+    'wheezy.html>=0.1.60',
+    'wheezy.http>=0.1.186',
+    'wheezy.routing>=0.1.122',
+    'wheezy.security>=0.1.28',
+    'wheezy.validation>=0.1.62',
+    'wheezy.web>=0.1.167',
+    'mako>=0.6.2'
+]
+
+try:
+    import uuid
+except:
+    install_requires.append('uuid')
+
+setup(
+    name='mysite',
+    version='0.1',
+    description='MySite Project',
+    long_description=README,
+    url='https://scm.dev.local/svn/mysite/trunk',
+
+	author='MySite Team',
+    author_email='mysite at dev.local',
+
+    license='COMMERCIAL',
+    classifiers=[
+        'Development Status :: 4 - Beta',
+        'Environment :: Web Environment',
+        'Intended Audience :: Developers',
+        'Natural Language :: English',
+        'Operating System :: OS Independent',
+        'Programming Language :: Python :: 2.7',
+        'Programming Language :: Python :: Implementation :: CPython',
+        'Programming Language :: Python :: Implementation :: PyPy',
+        'Topic :: Internet :: WWW/HTTP',
+        'Topic :: Internet :: WWW/HTTP :: Dynamic Content',
+        'Topic :: Internet :: WWW/HTTP :: WSGI',
+        'Topic :: Internet :: WWW/HTTP :: WSGI :: Application',
+        'Topic :: Software Development :: Libraries :: Python Modules'
+    ],
+    packages=[
+        'membership',
+        'public',
+    ],
+    package_dir={'': 'src'},
+
+    zip_safe=False,
+    install_requires=install_requires,
+    extras_require={
+        'dev': [
+            'coverage',
+            'nose',
+            'pytest',
+            'pytest-pep8',
+            'pytest-cov'
+        ]
+    },
+
+    platforms='any'
+)