Merge "Have stackviz output a usable python sdist"

This commit is contained in:
Jenkins 2017-05-31 16:02:27 +00:00 committed by Gerrit Code Review
commit baa9a66e9e
7 changed files with 38 additions and 16 deletions

1
.gitignore vendored

@ -2,6 +2,7 @@
.idea .idea
node_modules node_modules
build build
gulp-build
app/js/templates.js app/js/templates.js
app/data app/data
*.py[cod] *.py[cod]

9
MANIFEST.in Normal file

@ -0,0 +1,9 @@
# ignore these; pbr is putting everything in git
# in the sdist, but we're a hybird package
prune test
prune gulp
prune app
# The html/js to view results; created by npm run build
# installed in "html" via data-file in setup.cfg
recursive-include gulp-build *

@ -64,8 +64,21 @@ The production application can be build using::
gulp prod gulp prod
The result will be written to :code:`./build` and should be appropriate for This will automatically build portable html/javascript and python
distribution. Note that all files are not required: utilities into ``dist/stackviz-VERSION.tar.gz``.
You should probably install this into a ``virtualenv`` on the target
system::
virtualenv stackviz
./virtualenv/bin/pip install /path/to/stackviz-VERSION.tar.gz
# to run stackviz export
./virtualenv/bin/stackviz-export
Note the required html will be placed in ``virtualenv/share/stackviz-html``
as a data-file (or elsewhere, if installed as a system package; this
may vary on distributions). This can be moved as required. Note that
all files in there are not required:
- Directory structure (:code:`js/`, :code:`css/`, :code:`fonts/`, - Directory structure (:code:`js/`, :code:`css/`, :code:`fonts/`,
:code:`images/`): required. :code:`images/`): required.
@ -77,10 +90,8 @@ distribution. Note that all files are not required:
- Source maps (:code:`js/main.js.map`, :code:`js/main.js.map.gz`): only required - Source maps (:code:`js/main.js.map`, :code:`js/main.js.map.gz`): only required
for debugging purposes. for debugging purposes.
Data should be written to :code:`build/data/` using :code:`stackviz-export` like Data should be written to :code:`stackviz-html/data/` using
above. Note that the static production code generated above is portable, and can :code:`stackviz-export` like above.
be generated anywhere and copied to another host to be combined with exported
data.
Testing Testing
======= =======

@ -8,17 +8,17 @@ module.exports = {
'styles': { 'styles': {
'src' : 'app/styles/**/*.scss', 'src' : 'app/styles/**/*.scss',
'dest': 'build/css' 'dest': 'gulp-build/css'
}, },
'scripts': { 'scripts': {
'src' : 'app/js/**/*.js', 'src' : 'app/js/**/*.js',
'dest': 'build/js' 'dest': 'gulp-build/js'
}, },
'fonts': { 'fonts': {
'src' : ['app/fonts/**/*'], 'src' : ['app/fonts/**/*'],
'dest': 'build/fonts' 'dest': 'gulp-build/fonts'
}, },
'views': { 'views': {
@ -31,14 +31,14 @@ module.exports = {
}, },
'gzip': { 'gzip': {
'src': 'build/**/*.{html,xml,json,css,js,js.map}', 'src': 'gulp-build/**/*.{html,xml,json,css,js,js.map}',
'rewrite': '**/*.html', 'rewrite': '**/*.html',
'dest': 'build/', 'dest': 'gulp-build/',
'options': {} 'options': {}
}, },
'dist': { 'dist': {
'root' : 'build' 'root' : 'gulp-build'
}, },
'browserify': { 'browserify': {
@ -54,7 +54,7 @@ module.exports = {
'data': { 'data': {
'src' : ['app/data/**/*'], 'src' : ['app/data/**/*'],
'dest': 'build/data' 'dest': 'gulp-build/data'
} }
}; };

@ -17,7 +17,7 @@ gulp.task('server', function() {
// Serve index.html for all routes to leave routing up to Angular // Serve index.html for all routes to leave routing up to Angular
server.all('/*', function(req, res) { server.all('/*', function(req, res) {
res.sendFile('index.html', { root: 'build' }); res.sendFile('index.html', { root: 'gulp-build' });
}); });
// Start webserver if not already running // Start webserver if not already running
@ -33,4 +33,4 @@ gulp.task('server', function() {
s.listen(config.serverPort); s.listen(config.serverPort);
}); });

@ -72,6 +72,6 @@
"postinstall": "if [ ! -d .venv ]; then tox -epy27 --notest; fi", "postinstall": "if [ ! -d .venv ]; then tox -epy27 --notest; fi",
"test": "gulp unit", "test": "gulp unit",
"lint": "eslint ./", "lint": "eslint ./",
"prod": "gulp prod" "prod": "gulp prod; python setup.py sdist"
} }
} }

@ -23,6 +23,7 @@ classifier =
[files] [files]
packages = packages =
stackviz stackviz
data-files = share/stackviz-html = gulp-build/*
[entry_points] [entry_points]
console_scripts = console_scripts =