Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,29 @@ make develop
make unit
```

## Development

### Editable Mode

Install the CLI in editable mode with development dependencies

```bash
# Clone the repository
git clone https://github.com/outscale/osc-bsu-backup.git
cd osc-bsu-backup

# Create and activate a virtual environment
python -m venv venv
source venv/bin/activate

# CLI in editable mode
pip install -e ".[dev]"
or
python3 setup.py develop
```

Changes in the `osc_bsu_backup/` directory will be immediately reflected without reinstalling.

```bash
#you must have an account on the region eu-west-2 from Outscale
#~/.aws/credentials
Expand Down
14 changes: 13 additions & 1 deletion osc_bsu_backup/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ class Args:
profile: Optional[str]
client_cert: Optional[str]
debug: bool
version: bool


def backup(args: Args) -> None:
Expand Down Expand Up @@ -53,7 +54,6 @@ def backup(args: Args) -> None:


def main() -> None:
logger.info("osc_bsu_backup: %s", __version__)

parser = argparse.ArgumentParser(description=f"osc-bsu-backup: {__version__}")
parser.add_argument(
Expand Down Expand Up @@ -135,8 +135,20 @@ def main() -> None:
parser.add_argument(
"--debug", dest="debug", action="store_true", default=False, help="enable debug"
)
parser.add_argument(
"--version",
dest="version",
action="store_true",
default=False,
help="Show script version and exit"
)
args = Args(**vars(parser.parse_args()))

if args.version:
print(f"osc-bsu-backup version {__version__}")
exit(0)

logger.info("osc_bsu_backup: %s", __version__)
if args.instances_tags:
for tag in args.instances_tags:
if len(tag.split(":")) != 2:
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
'console_scripts': ['osc-bsu-backup = osc_bsu_backup.cli:main']
},
install_requires=[
'boto3'
'boto3',
'mypy_boto3_ec2'
]
)
Loading