From 414346683eb57fa13b6b04308ccf033024021f39 Mon Sep 17 00:00:00 2001 From: "Kali Kaneko (leap communications)" Date: Thu, 24 Mar 2016 18:57:30 -0400 Subject: [feature] package web-ui as a distributable python module in this way, we can generate wheels and pip-install it from pypi or other sources. we intend to use this for easing the shipping of the Pixelated UI in our packages/bundles. a separate debian package can also be easily generated form this artifact. --- .gitignore | 3 +++ web-ui/Makefile | 9 ++++++++ web-ui/pixelated_www/__init__.py | 0 web-ui/setup.py | 47 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 59 insertions(+) create mode 100644 web-ui/pixelated_www/__init__.py create mode 100644 web-ui/setup.py diff --git a/.gitignore b/.gitignore index 52a387de..392a831e 100644 --- a/.gitignore +++ b/.gitignore @@ -38,3 +38,6 @@ _trial_temp web-ui/coverage .nyc_output web-ui/npm-debug.log.* +web-ui/pixelated_www/* +web-ui/build/* +!web-ui/pixelated_www/__init__.py diff --git a/web-ui/Makefile b/web-ui/Makefile index 0bc9d5d4..3ee83eb4 100644 --- a/web-ui/Makefile +++ b/web-ui/Makefile @@ -31,6 +31,15 @@ install: cp -r dist/* $(DESTDIR)/usr/share/pixelated-user-agent +pydist-clean: clean + rm -rf build/ + + +pydist-wheel: + cp -r dist/* pixelated_www/ + python setup.py bdist_wheel + + all: clean compile install .PHONY: clean compile install all diff --git a/web-ui/pixelated_www/__init__.py b/web-ui/pixelated_www/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/web-ui/setup.py b/web-ui/setup.py new file mode 100644 index 00000000..04c59be2 --- /dev/null +++ b/web-ui/setup.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python +# +# Copyright (c) 2014 ThoughtWorks, Inc. +# +# Pixelated is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# Pixelated is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with Pixelated. If not, see . + +from setuptools import setup + +import datetime +import time + +now = datetime.datetime.now() +timestamp = time.strftime('%Y%m%d', now.timetuple()) + +setup(name='pixelated-www', + version='0.1.%s' % timestamp, + description='Pixelated User Agent UI', + author='Thoughtworks', + author_email='pixelated-team@thoughtworks.com', + url='http://pixelated-project.github.io', + packages=['pixelated_www'], + package_data={ + '': [ + '404.html', + 'index.html', + 'app.min.js', + 'sandbox.html', + 'sandbox.min.js', + 'bower_components/jquery-file-upload/css/*', + 'bower_components/font-awesome/css/*', + 'css/*', + 'fonts/*', + 'locales/en-us/*', + 'locales/pt/*', + 'locales/sv/*', + ]}) -- cgit v1.2.3