From 7377d9ebc3e6195a14c3d673f8fb1561dae9fcba Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Fri, 3 Nov 2023 20:07:39 -0700 Subject: [PATCH] bump version to 0.7.1 and fix version autodetection code --- MANIFEST.in | 6 ------ Pipfile | 12 ------------ archivebox/config.py | 3 ++- archivebox/package.json | 14 +++++++++++++- bin/build_pip.sh | 3 +++ bin/release_pip.sh | 14 ++++---------- package-lock.json | 4 ++-- package.json | 2 +- pyproject.toml | 2 +- stdeb.cfg | 2 +- 10 files changed, 27 insertions(+), 35 deletions(-) delete mode 100644 MANIFEST.in delete mode 100644 Pipfile mode change 120000 => 100644 archivebox/package.json diff --git a/MANIFEST.in b/MANIFEST.in deleted file mode 100644 index f33f160f..00000000 --- a/MANIFEST.in +++ /dev/null @@ -1,6 +0,0 @@ -graft archivebox -global-exclude .DS_Store -global-exclude __pycache__ -global-exclude *.pyc - -prune tests/ diff --git a/Pipfile b/Pipfile deleted file mode 100644 index 78cec54d..00000000 --- a/Pipfile +++ /dev/null @@ -1,12 +0,0 @@ -[[source]] -name = "pypi" -url = "https://pypi.org/simple" -verify_ssl = true - -[packages] -# see setup.py for package dependency list -"e1839a8" = {path = ".", editable = true} - -[dev-packages] -# see setup.py for dev package dependency list -"e1839a8" = {path = ".", extras = ["dev"], editable = true} diff --git a/archivebox/config.py b/archivebox/config.py index 18e06f1f..cee39b6e 100644 --- a/archivebox/config.py +++ b/archivebox/config.py @@ -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: diff --git a/archivebox/package.json b/archivebox/package.json deleted file mode 120000 index 4e26811d..00000000 --- a/archivebox/package.json +++ /dev/null @@ -1 +0,0 @@ -../package.json \ No newline at end of file diff --git a/archivebox/package.json b/archivebox/package.json new file mode 100644 index 00000000..f3d5b736 --- /dev/null +++ b/archivebox/package.json @@ -0,0 +1,13 @@ +{ + "name": "archivebox", + "version": "0.7.0", + "description": "ArchiveBox: The self-hosted internet archive", + "author": "Nick Sweeting ", + "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" + } +} diff --git a/bin/build_pip.sh b/bin/build_pip.sh index f86a3e21..bdedbad5 100755 --- a/bin/build_pip.sh +++ b/bin/build_pip.sh @@ -25,6 +25,9 @@ cd "$REPO_DIR" rm -Rf build dist echo "[+] Building sdist, bdist_wheel, and egg_info" +rm -f archivebox/package.json +cp package.json archivebox/package.json + pdm self update pdm install pdm build diff --git a/bin/release_pip.sh b/bin/release_pip.sh index a6b605bb..1b1fbf94 100755 --- a/bin/release_pip.sh +++ b/bin/release_pip.sh @@ -11,17 +11,11 @@ set -o pipefail IFS=$'\n' REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )" -VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")" cd "$REPO_DIR" source "$REPO_DIR/.venv/bin/activate" +echo "[^] Publishing to Test PyPI..." +pdm publish --repository testpypi -# apt install python3 python3-all python3-dev -# pip install '.[dev]' - - -echo "[^] Uploading to test.pypi.org" -python3 -m twine upload --repository testpypi pip_dist/archivebox-${VERSION}*.{whl,tar.gz} - -echo "[^] Uploading to pypi.org" -python3 -m twine upload --repository pypi pip_dist/archivebox-${VERSION}*.{whl,tar.gz} +echo "[^] Publishing to PyPI..." +pdm publish --no-build \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index a4d3dc21..158d57dd 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "archivebox", - "version": "0.7.0", + "version": "0.7.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "archivebox", - "version": "0.7.0", + "version": "0.7.1", "license": "MIT", "dependencies": { "@postlight/parser": "^2.2.3", diff --git a/package.json b/package.json index f3d5b736..9f903598 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "archivebox", - "version": "0.7.0", + "version": "0.7.1", "description": "ArchiveBox: The self-hosted internet archive", "author": "Nick Sweeting ", "repository": "github:ArchiveBox/ArchiveBox", diff --git a/pyproject.toml b/pyproject.toml index 1de11c98..cb3a0c36 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "archivebox" -version = "0.7.0" +version = "0.7.1" description = "Self-hosted internet archiving solution." authors = [ {name = "Nick Sweeting", email = "setup.py@archivebox.io"}, diff --git a/stdeb.cfg b/stdeb.cfg index 40e03a13..a6ee7e69 100644 --- a/stdeb.cfg +++ b/stdeb.cfg @@ -5,7 +5,7 @@ Package3: archivebox Suite: focal Suite3: focal Build-Depends: debhelper, dh-python, python3-all, python3-pip, python3-setuptools, python3-wheel, python3-stdeb -Depends3: nodejs, wget, curl, git, ffmpeg, yt-dlp, python3-all, python3-pip, python3-setuptools, python3-croniter, python3-crontab, python3-dateparser, python3-django, python3-django-extensions, python3-django-jsonfield, python3-mypy-extensions, python3-requests, python3-w3lib, ripgrep +Depends3: nodejs, wget, curl, git, ffmpeg, yt-dlp, ripgrep, python3-all, python3-pip, python3-setuptools, python3-croniter, python3-crontab, python3-dateparser, python3-django, python3-django-extensions, python3-django-jsonfield, python3-mypy-extensions, python3-requests, python3-w3lib X-Python3-Version: >= 3.9 XS-Python-Version: >= 3.9 Setup-Env-Vars: DEB_BUILD_OPTIONS=nocheck