1
0
Fork 0

minor build fixes

This commit is contained in:
Nick Sweeting 2021-02-01 05:13:46 -05:00
parent aa84a7ff2b
commit 783f597955
5 changed files with 19 additions and 5 deletions

View file

@ -263,7 +263,9 @@ def run(subcommand: str,
@enforce_types
def init(force: bool=False, out_dir: Path=OUTPUT_DIR) -> None:
"""Initialize a new ArchiveBox collection in the current directory"""
from core.models import Snapshot
Path(out_dir).mkdir(exist_ok=True)
is_empty = not len(set(os.listdir(out_dir)) - ALLOWED_IN_OUTPUT_DIR)

View file

@ -47,8 +47,8 @@ def atomic_write(path: Union[Path, str], contents: Union[dict, str, bytes], over
f.write(contents)
except OSError as 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(" Filesystems and network drives that don't implement FSYNC are incompatible and require workarounds.")
print(" You can store the archive/ subfolder on a hard drive or network share that doesn't support support syncronous writes,")
print(" but the main folder containing the index.sqlite3 and ArchiveBox.conf files must be on a filesystem that supports FSYNC.")
raise SystemExit(1)
os.chmod(path, int(OUTPUT_PERMISSIONS, base=8))

View file

@ -12,14 +12,14 @@ IFS=$'\n'
REPO_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && cd .. && pwd )"
VERSION="$(jq -r '.version' < "$REPO_DIR/package.json")"
SHORT_VERSION="$(echo "$VERSION" | perl -pe 's/(\d+)\.(\d+)\.(\d+)/$1.$2/g')"
cd "$REPO_DIR"
echo "[^] Pushing docs to github"
cd docs/
git commit -am "$NEW_VERSION release"
git add .
git commit -am "$VERSION release"
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 --tags

View file

@ -13,6 +13,7 @@ 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"
# apt install python3 python3-all python3-dev

View file

@ -1,5 +1,6 @@
import json
import setuptools
from setuptools.command.test import test
from pathlib import Path
@ -32,6 +33,13 @@ VERSION = json.loads((PACKAGE_DIR / "package.json").read_text().strip())['versio
# 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(
name=PKG_NAME,
version=VERSION,
@ -120,4 +128,7 @@ setuptools.setup(
"Framework :: Django",
"Typing :: Typed",
],
cmdclass={
"test": CustomTest,
},
)