Browse Source

bump version to 0.7.1 and fix version autodetection code

Nick Sweeting 2 years ago
parent
commit
7377d9ebc3
11 changed files with 27 additions and 35 deletions
  1. 0 6
      MANIFEST.in
  2. 0 12
      Pipfile
  3. 2 1
      archivebox/config.py
  4. 0 1
      archivebox/package.json
  5. 13 0
      archivebox/package.json
  6. 3 0
      bin/build_pip.sh
  7. 4 10
      bin/release_pip.sh
  8. 2 2
      package-lock.json
  9. 1 1
      package.json
  10. 1 1
      pyproject.toml
  11. 1 1
      stdeb.cfg

+ 0 - 6
MANIFEST.in

@@ -1,6 +0,0 @@
-graft archivebox
-global-exclude .DS_Store
-global-exclude __pycache__
-global-exclude *.pyc
-
-prune tests/

+ 0 - 12
Pipfile

@@ -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}

+ 2 - 1
archivebox/config.py

@@ -40,6 +40,7 @@ from typing import Optional, Type, Tuple, Dict, Union, List
 from subprocess import run, PIPE, DEVNULL
 from subprocess import run, PIPE, DEVNULL
 from configparser import ConfigParser
 from configparser import ConfigParser
 from collections import defaultdict
 from collections import defaultdict
+import importlib.metadata
 
 
 from .config_stubs import (
 from .config_stubs import (
     SimpleConfigValueDict,
     SimpleConfigValueDict,
@@ -374,7 +375,7 @@ ALLOWED_IN_OUTPUT_DIR = {
 }
 }
 
 
 def get_version(config):
 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):
 def get_commit_hash(config):
     try:
     try:

+ 0 - 1
archivebox/package.json

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

+ 13 - 0
archivebox/package.json

@@ -0,0 +1,13 @@
+{
+  "name": "archivebox",
+  "version": "0.7.0",
+  "description": "ArchiveBox: The self-hosted internet archive",
+  "author": "Nick Sweeting <[email protected]>",
+  "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"
+  }
+}

+ 3 - 0
bin/build_pip.sh

@@ -25,6 +25,9 @@ cd "$REPO_DIR"
 rm -Rf build dist
 rm -Rf build dist
 
 
 echo "[+] Building sdist, bdist_wheel, and egg_info"
 echo "[+] Building sdist, bdist_wheel, and egg_info"
+rm -f archivebox/package.json
+cp package.json archivebox/package.json
+
 pdm self update
 pdm self update
 pdm install
 pdm install
 pdm build
 pdm build

+ 4 - 10
bin/release_pip.sh

@@ -11,17 +11,11 @@ set -o pipefail
 IFS=$'\n'
 IFS=$'\n'
 
 
 REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
 REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
-VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
 cd "$REPO_DIR"
 cd "$REPO_DIR"
 source "$REPO_DIR/.venv/bin/activate"
 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

+ 2 - 2
package-lock.json

@@ -1,12 +1,12 @@
 {
 {
   "name": "archivebox",
   "name": "archivebox",
-  "version": "0.7.0",
+  "version": "0.7.1",
   "lockfileVersion": 3,
   "lockfileVersion": 3,
   "requires": true,
   "requires": true,
   "packages": {
   "packages": {
     "": {
     "": {
       "name": "archivebox",
       "name": "archivebox",
-      "version": "0.7.0",
+      "version": "0.7.1",
       "license": "MIT",
       "license": "MIT",
       "dependencies": {
       "dependencies": {
         "@postlight/parser": "^2.2.3",
         "@postlight/parser": "^2.2.3",

+ 1 - 1
package.json

@@ -1,6 +1,6 @@
 {
 {
   "name": "archivebox",
   "name": "archivebox",
-  "version": "0.7.0",
+  "version": "0.7.1",
   "description": "ArchiveBox: The self-hosted internet archive",
   "description": "ArchiveBox: The self-hosted internet archive",
   "author": "Nick Sweeting <[email protected]>",
   "author": "Nick Sweeting <[email protected]>",
   "repository": "github:ArchiveBox/ArchiveBox",
   "repository": "github:ArchiveBox/ArchiveBox",

+ 1 - 1
pyproject.toml

@@ -1,6 +1,6 @@
 [project]
 [project]
 name = "archivebox"
 name = "archivebox"
-version = "0.7.0"
+version = "0.7.1"
 description = "Self-hosted internet archiving solution."
 description = "Self-hosted internet archiving solution."
 authors = [
 authors = [
     {name = "Nick Sweeting", email = "[email protected]"},
     {name = "Nick Sweeting", email = "[email protected]"},

+ 1 - 1
stdeb.cfg

@@ -5,7 +5,7 @@ Package3: archivebox
 Suite: focal
 Suite: focal
 Suite3: focal
 Suite3: focal
 Build-Depends: debhelper, dh-python, python3-all, python3-pip, python3-setuptools, python3-wheel, python3-stdeb
 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
 X-Python3-Version: >= 3.9
 XS-Python-Version: >= 3.9
 XS-Python-Version: >= 3.9
 Setup-Env-Vars: DEB_BUILD_OPTIONS=nocheck
 Setup-Env-Vars: DEB_BUILD_OPTIONS=nocheck