cleanup repository tree. use entry_points in setuptools instead of symlink
This commit is contained in:
4
.github/workflows/regression.yml
vendored
4
.github/workflows/regression.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
- name: Regression test
|
- name: Regression test
|
||||||
run: sudo -E ./run_tests
|
run: sudo -E ./tests/run_tests
|
||||||
|
|
||||||
|
|
||||||
- name: Coveralls
|
- name: Coveralls
|
||||||
@ -43,7 +43,7 @@ jobs:
|
|||||||
|
|
||||||
|
|
||||||
- name: Regression test
|
- name: Regression test
|
||||||
run: sudo -E ./run_tests
|
run: sudo -E ./tests/run_tests
|
||||||
|
|
||||||
|
|
||||||
- name: Coveralls
|
- name: Coveralls
|
||||||
|
|||||||
3
.gitignore
vendored
3
.gitignore
vendored
@ -9,3 +9,6 @@ __pycache__
|
|||||||
.coverage
|
.coverage
|
||||||
*.pyc
|
*.pyc
|
||||||
python2.env
|
python2.env
|
||||||
|
venv
|
||||||
|
.idea
|
||||||
|
OQ
|
||||||
32
.travis.yml
32
.travis.yml
@ -1,32 +0,0 @@
|
|||||||
#MOVING TO GITHUB ACTIONS
|
|
||||||
|
|
||||||
# jobs:
|
|
||||||
# include:
|
|
||||||
# - os: linux
|
|
||||||
# dist: xenial
|
|
||||||
# language: python
|
|
||||||
# python: 2.7
|
|
||||||
# - os: linux
|
|
||||||
# dist: xenial
|
|
||||||
# language: python
|
|
||||||
# python: 3.6
|
|
||||||
# - os: linux
|
|
||||||
# dist: bionic
|
|
||||||
# language: python
|
|
||||||
# python: 2.7
|
|
||||||
# - os: linux
|
|
||||||
# dist: bionic
|
|
||||||
# language: python
|
|
||||||
# python: 3.6
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# before_install:
|
|
||||||
# - sudo apt-get update
|
|
||||||
# - sudo apt-get install zfsutils-linux
|
|
||||||
|
|
||||||
# script:
|
|
||||||
# # - sudo -E ./ngrok.sh
|
|
||||||
# - sudo -E ./run_tests
|
|
||||||
# # - sudo -E pip --version
|
|
||||||
@ -1 +0,0 @@
|
|||||||
zfs-autobackup
|
|
||||||
17
ngrok.sh
17
ngrok.sh
@ -1,17 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
if ! [ -e ngrok ]; then
|
|
||||||
wget -O ngrok.zip https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
|
|
||||||
unzip ngrok.zip
|
|
||||||
fi
|
|
||||||
{
|
|
||||||
mkfifo pipe
|
|
||||||
echo "Executing nc"
|
|
||||||
nc -k -l -v 8888 <pipe | ( while true; do bash >pipe 2>&1; echo "restarting" ;sleep 1; done )
|
|
||||||
killall -SIGINT ngrok && echo "ngrok terminated"
|
|
||||||
} &
|
|
||||||
{
|
|
||||||
echo "Executing ngrok"
|
|
||||||
./ngrok authtoken $NGROK_TOKEN
|
|
||||||
./ngrok tcp 8888 --log=stdout
|
|
||||||
} &
|
|
||||||
wait
|
|
||||||
13
setup.py
13
setup.py
@ -1,14 +1,13 @@
|
|||||||
import setuptools
|
import setuptools
|
||||||
import bin.zfs_autobackup
|
import zfs_autobackup
|
||||||
import os
|
import os
|
||||||
|
|
||||||
|
|
||||||
with open("README.md", "r") as fh:
|
with open("README.md", "r") as fh:
|
||||||
long_description = fh.read()
|
long_description = fh.read()
|
||||||
|
|
||||||
setuptools.setup(
|
setuptools.setup(
|
||||||
name="zfs_autobackup",
|
name="zfs_autobackup",
|
||||||
version=bin.zfs_autobackup.VERSION,
|
version=zfs_autobackup.VERSION,
|
||||||
author="Edwin Eefting",
|
author="Edwin Eefting",
|
||||||
author_email="edwin@datux.nl",
|
author_email="edwin@datux.nl",
|
||||||
description="ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. It tries to be the most friendly to use and easy to debug ZFS backup tool.",
|
description="ZFS autobackup is used to periodicly backup ZFS filesystems to other locations. It tries to be the most friendly to use and easy to debug ZFS backup tool.",
|
||||||
@ -16,8 +15,14 @@ setuptools.setup(
|
|||||||
long_description_content_type="text/markdown",
|
long_description_content_type="text/markdown",
|
||||||
|
|
||||||
url="https://github.com/psy0rz/zfs_autobackup",
|
url="https://github.com/psy0rz/zfs_autobackup",
|
||||||
scripts=["bin/zfs-autobackup"],
|
entry_points={
|
||||||
|
'console_scripts':
|
||||||
|
[
|
||||||
|
'zfs-autobackup = zfs_autobackup:cli',
|
||||||
|
]
|
||||||
|
},
|
||||||
packages=setuptools.find_packages(),
|
packages=setuptools.find_packages(),
|
||||||
|
|
||||||
classifiers=[
|
classifiers=[
|
||||||
"Programming Language :: Python :: 2",
|
"Programming Language :: Python :: 2",
|
||||||
"Programming Language :: Python :: 3",
|
"Programming Language :: Python :: 3",
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import unittest2
|
|||||||
import subprocess
|
import subprocess
|
||||||
import time
|
import time
|
||||||
from pprint import *
|
from pprint import *
|
||||||
from bin.zfs_autobackup import *
|
from zfs_autobackup import *
|
||||||
from mock import *
|
from mock import *
|
||||||
import contextlib
|
import contextlib
|
||||||
import sys
|
import sys
|
||||||
@ -1,4 +1,8 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
SCRIPTDIR=`dirname $0`
|
||||||
|
|
||||||
|
#cd $SCRIPTDIR || exit 1
|
||||||
|
|
||||||
|
|
||||||
if [ "$USER" != "root" ]; then
|
if [ "$USER" != "root" ]; then
|
||||||
@ -6,8 +10,6 @@ if [ "$USER" != "root" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#reactivate python environment, if any (usefull in Travis)
|
|
||||||
[ "$VIRTUAL_ENV" ] && source $VIRTUAL_ENV/bin/activate
|
|
||||||
|
|
||||||
# test needs ssh access to localhost for testing
|
# test needs ssh access to localhost for testing
|
||||||
if ! [ -e /root/.ssh/id_rsa ]; then
|
if ! [ -e /root/.ssh/id_rsa ]; then
|
||||||
@ -16,16 +18,11 @@ if ! [ -e /root/.ssh/id_rsa ]; then
|
|||||||
ssh -oStrictHostKeyChecking=no localhost true || exit 1
|
ssh -oStrictHostKeyChecking=no localhost true || exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
coverage run --source bin.zfs_autobackup -m unittest discover -vvvvf $@ 2>&1
|
|
||||||
|
coverage run --source zfs_autobackup -m unittest discover -vvvvf $SCRIPTDIR $@ 2>&1
|
||||||
EXIT=$?
|
EXIT=$?
|
||||||
|
|
||||||
echo
|
echo
|
||||||
coverage report
|
coverage report
|
||||||
|
|
||||||
#this does automatic travis CI/https://coveralls.io/ intergration:
|
|
||||||
# if which coveralls > /dev/null; then
|
|
||||||
# echo "Submitting to coveralls.io:"
|
|
||||||
# coveralls
|
|
||||||
# fi
|
|
||||||
|
|
||||||
exit $EXIT
|
exit $EXIT
|
||||||
@ -1,6 +1,5 @@
|
|||||||
from basetest import *
|
from basetest import *
|
||||||
import time
|
import time
|
||||||
from bin.zfs_autobackup import *
|
|
||||||
|
|
||||||
run_orig=ExecuteNode.run
|
run_orig=ExecuteNode.run
|
||||||
run_counter=0
|
run_counter=0
|
||||||
@ -1915,6 +1915,6 @@ class ZfsAutobackup:
|
|||||||
return 255
|
return 255
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
def cli():
|
||||||
zfs_autobackup = ZfsAutobackup(sys.argv[1:], False)
|
zfs_autobackup = ZfsAutobackup(sys.argv[1:], False)
|
||||||
sys.exit(zfs_autobackup.run())
|
sys.exit(zfs_autobackup.run())
|
||||||
4
zfs_autobackup/__main__.py
Executable file
4
zfs_autobackup/__main__.py
Executable file
@ -0,0 +1,4 @@
|
|||||||
|
if __name__ == "__main__":
|
||||||
|
from . import cli
|
||||||
|
cli()
|
||||||
|
|
||||||
Reference in New Issue
Block a user