mirror of
https://github.com/ArchiveBox/ArchiveBox.git
synced 2025-06-03 08:08:43 -04:00
switch to uv builds and rc1 versioning system
This commit is contained in:
parent
0876cc78d9
commit
ce2e19a429
9 changed files with 1956 additions and 47 deletions
|
@ -26,7 +26,7 @@ def _detect_installed_version(PACKAGE_DIR: Path):
|
|||
"""Autodetect the installed archivebox version by using pip package metadata, pyproject.toml file, or package.json file"""
|
||||
try:
|
||||
# if in production install, use pip-installed package metadata
|
||||
return importlib.metadata.version(__package__ or 'archivebox')
|
||||
return importlib.metadata.version(__package__ or 'archivebox').strip()
|
||||
except importlib.metadata.PackageNotFoundError:
|
||||
pass
|
||||
|
||||
|
@ -35,7 +35,7 @@ def _detect_installed_version(PACKAGE_DIR: Path):
|
|||
pyproject_config = (PACKAGE_DIR.parent / 'pyproject.toml').read_text().split('\n')
|
||||
for line in pyproject_config:
|
||||
if line.startswith('version = '):
|
||||
return line.split(' = ', 1)[-1].strip('"')
|
||||
return line.split(' = ', 1)[-1].strip('"').strip()
|
||||
except FileNotFoundError:
|
||||
# building docs, pyproject.toml is not available
|
||||
pass
|
||||
|
@ -45,7 +45,7 @@ def _detect_installed_version(PACKAGE_DIR: Path):
|
|||
package_json = (PACKAGE_DIR / 'package.json').read_text().split('\n')
|
||||
for line in package_json:
|
||||
if '"version": "' in line:
|
||||
return line.replace('"', '').split(':')[-1].strip(',')
|
||||
return line.replace('"', '').split(':')[-1].strip(',').strip()
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue