Using build tools to inject version into init, passing tox tests

This commit is contained in:
James Barnsley
2020-01-31 06:23:34 +13:00
parent 92abf62bae
commit b127cffe4c
5 changed files with 10 additions and 3 deletions

1
.gitignore vendored
View File

@ -14,3 +14,4 @@ venv
docker/mopidy.conf
docker/data/
docker-compose.yml
/.tox/

View File

@ -53,6 +53,12 @@ copydir('src/assets', 'mopidy_iris/static/assets', function(error){
fs.writeFileSync(html_file, html_file_content, 'utf8');
console.log('Setting version in HTML');
console.log('Setting version in Python');
var init_file = "mopidy_iris/__init__.py";
var init_file_content = fs.readFileSync(init_file, "utf8");
init_file_content = init_file_content.replace(/(?:__version__\ \=\ \')(?:.*)'/, "__version__ = '"+version+"'");
fs.writeFileSync(init_file, init_file_content, 'utf8');
console.log('Setting version in NPM');
var package_file = "package.json";
var package_file_content = fs.readFileSync(package_file, "utf8");

View File

@ -3,7 +3,7 @@ import logging, json, pathlib
import pkg_resources
from mopidy import config, ext
__version__ = pkg_resources.get_distribution("Mopidy-Iris").version
__version__ = '3.44.0'
logger = logging.getLogger(__name__)

File diff suppressed because one or more lines are too long

View File

@ -100,7 +100,7 @@
// Release details
// These are automatically injected to built HTML
var build = "1580372023";
var build = "1580404628";
var version = "3.44.0";
// Construct the script tag