improve packaging
- locate are now compiled before build, install and distribution - all resource are installed and distributed
This commit is contained in:
parent
a3e3612d12
commit
fc017fe2d8
15
MANIFEST.in
15
MANIFEST.in
|
@ -1,4 +1,15 @@
|
|||
recursive-include portail_citoyen/apps/*/templates/ *.html
|
||||
recursive-include portail_citoyen/apps/login_plugin/templates/ *.html
|
||||
recursive-include portail_citoyen/apps/login_plugin/static/ *.css *.gif *.png *.js
|
||||
recursive-include portail_citoyen/apps/login_plugin/locale/ *.po *.mo
|
||||
recursive-include portail_citoyen/apps/data_source_plugin/templates/ *.html
|
||||
recursive-include portail_citoyen/apps/data_source_plugin/static/ *.css *.gif *.png *.js
|
||||
recursive-include portail_citoyen/apps/data_source_plugin/locale/ *.po *.mo
|
||||
recursive-include portail_citoyen/apps/a2_service_list_plugin/templates/ *.html
|
||||
recursive-include portail_citoyen/apps/a2_service_list_plugin/static/ *.css *.gif *.png *.js
|
||||
recursive-include portail_citoyen/apps/a2_service_list_plugin/locale/ *.po *.mo
|
||||
recursive-include portail_citoyen/templates/ *.html
|
||||
recursive-include portail_citoyen/static/ *.css *.gif *.png
|
||||
recursive-include portail_citoyen/static/ *.css *.gif *.png *.js
|
||||
recursive-include portail_citoyen/locale/ *.po *.mo
|
||||
recursive-include help *.page
|
||||
include local_settings.py.example
|
||||
include requirements.txt
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
from django.utils.translation import ugettext_lazy as _
|
||||
from django.db import models
|
||||
from authentic2.models import User
|
||||
|
||||
class Citoyen(User):
|
||||
|
|
51
setup.py
51
setup.py
|
@ -4,6 +4,43 @@
|
|||
'''
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
from setuptools.command.install_lib import install_lib as _install_lib
|
||||
from distutils.command.build import build as _build
|
||||
from distutils.command.sdist import sdist as _sdist
|
||||
from distutils.cmd import Command
|
||||
import glob
|
||||
|
||||
class compile_translations(Command):
|
||||
description = 'compile message catalogs to MO files via django compilemessages'
|
||||
user_options = []
|
||||
|
||||
def initialize_options(self):
|
||||
pass
|
||||
|
||||
def finalize_options(self):
|
||||
pass
|
||||
|
||||
def run(self):
|
||||
import os
|
||||
import sys
|
||||
from django.core.management.commands.compilemessages import \
|
||||
compile_messages
|
||||
for path in ['portail_citoyen'] + glob.glob('portail_citoyen/apps/*'):
|
||||
curdir = os.getcwd()
|
||||
os.chdir(os.path.realpath(path))
|
||||
compile_messages(stderr=sys.stderr)
|
||||
os.chdir(curdir)
|
||||
|
||||
class build(_build):
|
||||
sub_commands = [('compile_translations', None)] + _build.sub_commands
|
||||
|
||||
class sdist(_sdist):
|
||||
sub_commands = [('compile_translations', None)] + _sdist.sub_commands
|
||||
|
||||
class install_lib(_install_lib):
|
||||
def run(self):
|
||||
self.run_command('compile_translations')
|
||||
_install_lib.run(self)
|
||||
|
||||
setup(name="portail_citoyen",
|
||||
version=0.1,
|
||||
|
@ -16,8 +53,15 @@ setup(name="portail_citoyen",
|
|||
maintainer_email="info@entrouvert.com",
|
||||
include_package_data=True,
|
||||
package_data={
|
||||
'': ['templates/*.html', 'templates/*/*.html', 'static/**.png', 'static/**.gif',
|
||||
'static/*/*/*']},
|
||||
'': [
|
||||
'templates/**.html',
|
||||
'static/**.png',
|
||||
'static/**.gif',
|
||||
'static/**.css',
|
||||
'static/**.js',
|
||||
'locale/**.mo',
|
||||
]
|
||||
},
|
||||
package_dir={
|
||||
'login_plugin': 'portail_citoyen/apps/login_plugin',
|
||||
'data_source_plugin': 'portail_citoyen/apps/data_source_plugin',
|
||||
|
@ -38,4 +82,7 @@ setup(name="portail_citoyen",
|
|||
'https://github.com/entrouvert/django-cms/archive/365278149a93f488fa9491a6c029c58c63ff3d73.zip#egg=django-cms-2.4.0.beta',
|
||||
'http://repos.entrouvert.org/authentic.git/snapshot/authentic-master.tar.gz#egg=authentic2-2.0.3',
|
||||
],
|
||||
cmdclass={'build': build, 'install_lib': install_lib,
|
||||
'compile_translations': compile_translations,
|
||||
'sdist': sdist},
|
||||
)
|
||||
|
|
Reference in New Issue