mirror of
https://github.com/ArchiveBox/ArchiveBox
synced 2024-11-10 06:34:16 +00:00
minor build fixes
This commit is contained in:
parent
aa84a7ff2b
commit
783f597955
5 changed files with 19 additions and 5 deletions
|
@ -263,7 +263,9 @@ def run(subcommand: str,
|
||||||
@enforce_types
|
@enforce_types
|
||||||
def init(force: bool=False, out_dir: Path=OUTPUT_DIR) -> None:
|
def init(force: bool=False, out_dir: Path=OUTPUT_DIR) -> None:
|
||||||
"""Initialize a new ArchiveBox collection in the current directory"""
|
"""Initialize a new ArchiveBox collection in the current directory"""
|
||||||
|
|
||||||
from core.models import Snapshot
|
from core.models import Snapshot
|
||||||
|
|
||||||
Path(out_dir).mkdir(exist_ok=True)
|
Path(out_dir).mkdir(exist_ok=True)
|
||||||
is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)
|
is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)
|
||||||
|
|
||||||
|
|
|
@ -47,8 +47,8 @@ def atomic_write(path: Union[Path, str], contents: Union[dict, str, bytes], over
|
||||||
f.write(contents)
|
f.write(contents)
|
||||||
except OSError as e:
|
except OSError as e:
|
||||||
print(f"[X] OSError: Failed to write {path} with fcntl.F_FULLFSYNC. ({e})")
|
print(f"[X] OSError: Failed to write {path} with fcntl.F_FULLFSYNC. ({e})")
|
||||||
print(" For data integrity, ArchiveBox requires a filesystem that supports atomic writes.")
|
print(" You can store the archive/ subfolder on a hard drive or network share that doesn't support support syncronous writes,")
|
||||||
print(" Filesystems and network drives that don't implement FSYNC are incompatible and require workarounds.")
|
print(" but the main folder containing the index.sqlite3 and ArchiveBox.conf files must be on a filesystem that supports FSYNC.")
|
||||||
raise SystemExit(1)
|
raise SystemExit(1)
|
||||||
os.chmod(path, int(OUTPUT_PERMISSIONS, base=8))
|
os.chmod(path, int(OUTPUT_PERMISSIONS, base=8))
|
||||||
|
|
||||||
|
|
|
@ -12,14 +12,14 @@ 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")"
|
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
||||||
SHORT_VERSION="$(echo "$VERSION" | perl -pe 's/(\d+)\.(\d+)\.(\d+)/$1.$2/g')"
|
|
||||||
cd "$REPO_DIR"
|
cd "$REPO_DIR"
|
||||||
|
|
||||||
|
|
||||||
echo "[^] Pushing docs to github"
|
echo "[^] Pushing docs to github"
|
||||||
cd docs/
|
cd docs/
|
||||||
git commit -am "$NEW_VERSION release"
|
git add .
|
||||||
|
git commit -am "$VERSION release"
|
||||||
git push
|
git push
|
||||||
git tag -a "v$NEW_VERSION" -m "v$NEW_VERSION"
|
git tag -a "v$VERSION" -m "v$VERSION"
|
||||||
git push origin master
|
git push origin master
|
||||||
git push origin --tags
|
git push origin --tags
|
||||||
|
|
|
@ -13,6 +13,7 @@ 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")"
|
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
|
||||||
cd "$REPO_DIR"
|
cd "$REPO_DIR"
|
||||||
|
source "$REPO_DIR/.venv/bin/activate"
|
||||||
|
|
||||||
|
|
||||||
# apt install python3 python3-all python3-dev
|
# apt install python3 python3-all python3-dev
|
||||||
|
|
11
setup.py
11
setup.py
|
@ -1,5 +1,6 @@
|
||||||
import json
|
import json
|
||||||
import setuptools
|
import setuptools
|
||||||
|
from setuptools.command.test import test
|
||||||
|
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
|
@ -32,6 +33,13 @@ VERSION = json.loads((PACKAGE_DIR / "package.json").read_text().strip())['versio
|
||||||
# print('>', sys.executable, *sys.argv)
|
# print('>', sys.executable, *sys.argv)
|
||||||
|
|
||||||
|
|
||||||
|
class CustomTest(test):
|
||||||
|
def run(self):
|
||||||
|
# setup.py test is deprecated, disable it here by force so stdeb doesnt run it
|
||||||
|
#super().run()
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name=PKG_NAME,
|
name=PKG_NAME,
|
||||||
version=VERSION,
|
version=VERSION,
|
||||||
|
@ -120,4 +128,7 @@ setuptools.setup(
|
||||||
"Framework :: Django",
|
"Framework :: Django",
|
||||||
"Typing :: Typed",
|
"Typing :: Typed",
|
||||||
],
|
],
|
||||||
|
cmdclass={
|
||||||
|
"test": CustomTest,
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue