Coder Social home page Coder Social logo

borgapi's People

Contributors

ozzieisaacs avatar spslater avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mistertwo

borgapi's Issues

borgapi stucks on borgbackup questions

If you start a borgbackup commands which leads to a question, e.g. you have moved the repository. Borgapi stucks, as the questions gets never answered.
Borgbackup supports environment variable to answer the questions "programmatically". https://borgbackup.readthedocs.io/en/stable/usage/general.html#environment-variables -> "Some automatic “answerers” (if set, they automatically answer confirmation questions):"

Borgapi supports setting the environment variables, but I didn't find any hint in documentation to set the environment variables to avoid this situation.
I can imagine 2 possible solutions:

  1. add a hint to set the environment variables to avoid the situation
  2. preferred solution: Set the variables to a "safe" default, answering no and additionally add a hint in the readme to change the answers

Environment Variable to Skip the Benchmark Tests

Add a "skip if" check to the test_benchmark_crud in the borgapi test module to help with rapid testing. This test increases the runtime from ~22 seconds to ~134 seconds. Setting an environment variable (BORGAPI_TEST_BENCHMARK_SKIP) will cause this test to skip making rapid checks much easier.

Requirements

Hi

Requirements are listed as:

borgbackup: 1.1.17
python-dotenv: 0.17.1

But when I try to install it asks for fuse. Is that correct?

$ pip install borgapi Collecting borgapi Using cached borgapi-0.5.1-py3-none-any.whl (30 kB) Requirement already satisfied: borgbackup[fuse]==1.1.17 in ./.venv/lib/python3.9/site-packages (from borgapi->-r requirements.txt (line 1)) (1.1.17) Collecting python-dotenv>=0.17.1 Using cached python_dotenv-0.19.0-py2.py3-none-any.whl (17 kB) Requirement already satisfied: packaging in ./.venv/lib/python3.9/site-packages (from borgbackup[fuse]==1.1.17->borgapi->-r requirements.txt (line 1)) (21.0) Collecting llfuse>=1.3.4 Using cached llfuse-1.4.1.tar.gz (774 kB) ERROR: Command errored out with exit status 2: command: /home/larsfp/Downloads/git/borgfrag/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/setup.py'"'"'; __file__='"'"'/tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-5e05cjl4 cwd: /tmp/pip-install-g4us2xwu/llfuse_0d618ef5987a4ac5bba3b0724494d954/ Complete output (4 lines): Package fuse was not found in the pkg-config search path. Perhaps you should add the directory containing fuse.pc'
to the PKG_CONFIG_PATH environment variable
No package 'fuse' found
----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/b1/d4/44443fbaac6d5b878da99e7c0948ee93c7934fa3b00e48c5363823b583d0/llfuse-1.4.1.tar.gz#sha256=c29c79d96a5aeab51608cae12594a1bf83576d86232f97341c7f779d413a4ec9 (from https://pypi.org/simple/llfuse/) (requires-python:>=3.5). Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output.
Using cached llfuse-1.4.0.tar.gz (478 kB)
ERROR: Command errored out with exit status 2:
command: /home/larsfp/Downloads/git/borgfrag/.venv/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/setup.py'"'"'; file='"'"'/tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-0cyjmwr_
cwd: /tmp/pip-install-g4us2xwu/llfuse_7834839a4b014859a3a9b268e02c1236/
Complete output (4 lines):
Package fuse was not found in the pkg-config search path.
Perhaps you should add the directory containing fuse.pc' to the PKG_CONFIG_PATH environment variable No package 'fuse' found ---------------------------------------- WARNING: Discarding https://files.pythonhosted.org/packages/5d/3d/970c3fb9fbccfb7338f4b4d9fc1f769f7c886a8821ccc76f4d9c8d437606/llfuse-1.4.0.tar.gz#sha256=cb5dc6052bdd9c19dd15d44cd2876520007029a7733e7b9f0c2022c768e3ca52 (from https://pypi.org/simple/llfuse/) (requires-python:>=3.5). Command errored out with exit status 2: python setup.py egg_info Check the logs for full command output. Using cached llfuse-1.3.8.tar.gz (481 kB) ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-d_5c2use

Ubuntu 21.04

Progress flag useless?

The borgbackup option "--progress" can be applied to the command, but currently the output of the command is only parsed after the borgbackup command exists.

So the progress output is useless?

I don't know if it would make sense to have an asynchronous interface to borgbackup and you could parse the real time output. (Maybe not feasible as this would change a lot of the interface).

So maybe a hint in the readme would improve the situation

Update borg version

Meanwhile borg version 1.2.1 is out and is supporting a new command "compact"

It would be great if borgapi would support it

Export Tar to Stdout Fails

When trying to export a tar to stdout, it tries to write bytes to a StringIO object. raw_bytes needs to be set to True when the filename is - (aka, stdout).

Arg list generator does not splitting lists correctly

When passing multiple values for flags that can be repeated, the parser will treat the list as one argument instead of multiple values.

Example:

ExclusionOptions(exclude=["foo", "bar"], pattern="baz", patterns_from="spam/milk",).parse()

Expected: ['--exclude', 'foo', '--exclude', 'bar', '--pattern', 'baz', '--patterns-from', 'spam/milk']
Actual: ['--exclude', ['foo', 'bar'], '--pattern', ['baz'], '--patterns-from', 'spam/milk']

Extract to Stdout

When running the extract command with the stdout = True the _run command errors because it is trying to write to the "buffer" method of a StringIO, which doesn't have one.

Options for fix:

  1. Find way of capturing stdout and stderr that are in memory / can replace sys.stdout and sys.stderr and have a buffer method
  2. Write a wrapper around StringIO that has a dummy buffer method that just calls the write method.
    a) Use ByteIO or something else in the io package.

Cleanup Test Cases

  • Split the borgapi cases into multiple classes
  • Add skipIf check to the mount tests (mount needs extra install)
  • Add more tests for different flags

Return captured output as one value

Stop returning captured output as stdout and stderr. If json output is expected, return it as one struct with relevant key names (eg stats or files).

Command Options Class

Move the command specific option data classes out from the method calls and into a master class that houses all of these options. This new master class should live in the options module and have a way to pass in the command and options to generate the args list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.