get VERSION from package.json instead of VERSION to avoid duplication

This commit is contained in:
Nick Sweeting 2020-08-18 15:00:00 -04:00
parent 8e07fe3f2e
commit 8b427c9d79
8 changed files with 31 additions and 28 deletions

View file

@ -1,4 +1,6 @@
import json
import setuptools
from pathlib import Path
PKG_NAME = "archivebox"
@ -6,13 +8,13 @@ REPO_URL = "https://github.com/pirate/ArchiveBox"
BASE_DIR = Path(__file__).parent.resolve()
SOURCE_DIR = BASE_DIR / PKG_NAME
README = (BASE_DIR / "README.md").read_text()
VERSION = (SOURCE_DIR / "VERSION").read_text().strip()
VERSION = json.loads((BASE_DIR / "package.json").read_text().strip())['version']
# To see when setup.py gets called (uncomment for debugging)
# import sys
# print(SOURCE_DIR, f" (v{VERSION})")
# print('>', sys.executable, *sys.argv)
# raise SystemExit(0)
setuptools.setup(
name=PKG_NAME,