mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-09-02 10:53:15 +02:00
get version from package.json instead of dedicated file
9
conf.py
9
conf.py
@@ -12,14 +12,17 @@
|
|||||||
#
|
#
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import json
|
||||||
import django
|
import django
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
import recommonmark
|
import recommonmark
|
||||||
from recommonmark.transform import AutoStructify
|
from recommonmark.transform import AutoStructify
|
||||||
|
|
||||||
os.environ['USE_CHROME'] = 'False'
|
os.environ['USE_CHROME'] = 'False'
|
||||||
|
|
||||||
PYTHON_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..', 'archivebox'))
|
REPO_DIR = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), '..'))
|
||||||
|
PYTHON_DIR = os.path.join(REPO_DIR, 'archivebox')
|
||||||
|
|
||||||
sys.path.insert(0, os.path.abspath('.'))
|
sys.path.insert(0, os.path.abspath('.'))
|
||||||
sys.path.insert(0, os.path.abspath('../'))
|
sys.path.insert(0, os.path.abspath('../'))
|
||||||
@@ -27,7 +30,7 @@ sys.path.insert(0, PYTHON_DIR)
|
|||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "core.settings")
|
||||||
django.setup()
|
django.setup()
|
||||||
|
|
||||||
VERSION = open(os.path.join(PYTHON_DIR, 'VERSION'), 'r').read().strip()
|
VERSION = json.loads((Path(REPO_DIR) / 'package.json').read_text().strip())['version']
|
||||||
|
|
||||||
# -- Project information -----------------------------------------------------
|
# -- Project information -----------------------------------------------------
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user