bump version to 0.7.1 and fix version autodetection code

This commit is contained in:
Nick Sweeting 2023-11-03 20:07:39 -07:00
parent 907d170614
commit 7377d9ebc3
10 changed files with 27 additions and 35 deletions

View file

@ -40,6 +40,7 @@ from typing import Optional, Type, Tuple, Dict, Union, List
from subprocess import run, PIPE, DEVNULL
from configparser import ConfigParser
from collections import defaultdict
import importlib.metadata
from .config_stubs import (
SimpleConfigValueDict,
@ -374,7 +375,7 @@ ALLOWED_IN_OUTPUT_DIR = {
}
def get_version(config):
return json.loads((Path(config['PACKAGE_DIR']) / 'package.json').read_text(encoding='utf-8').strip())['version']
return importlib.metadata.version(__package__ or 'archivebox')
def get_commit_hash(config):
try:

View file

@ -1 +0,0 @@
../package.json

13
archivebox/package.json Normal file
View file

@ -0,0 +1,13 @@
{
"name": "archivebox",
"version": "0.7.0",
"description": "ArchiveBox: The self-hosted internet archive",
"author": "Nick Sweeting <archivebox-npm@sweeting.me>",
"repository": "github:ArchiveBox/ArchiveBox",
"license": "MIT",
"dependencies": {
"@postlight/parser": "^2.2.3",
"readability-extractor": "git+https://github.com/ArchiveBox/readability-extractor.git",
"single-file-cli": "^1.1.12"
}
}