From 3777ada97f399b53da2b946cd40d9575803770e9 Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 11 Apr 2023 12:00:57 +0000 Subject: automatic import of python-awscliv2 --- .gitignore | 1 + python-awscliv2.spec | 546 +++++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 548 insertions(+) create mode 100644 python-awscliv2.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..a892aba 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/awscliv2-2.2.0.tar.gz diff --git a/python-awscliv2.spec b/python-awscliv2.spec new file mode 100644 index 0000000..a56cbd4 --- /dev/null +++ b/python-awscliv2.spec @@ -0,0 +1,546 @@ +%global _empty_manifest_terminate_build 0 +Name: python-awscliv2 +Version: 2.2.0 +Release: 1 +Summary: Wrapper for AWS CLI v2 +License: MIT +URL: https://youtype.github.io/awscliv2/ +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a4/52/3a846215b4969c20b8e60f25a8cd373c367b5ebec12da5975f55e6e965c7/awscliv2-2.2.0.tar.gz +BuildArch: noarch + +Requires: python3-executor +Requires: python3-importlib-resources +Requires: python3-pip + +%description +# AWS CLI v2 for Python + +[![PyPI - awscliv2](https://img.shields.io/pypi/v/awscliv2.svg?color=blue&label=awscliv2)](https://pypi.org/project/awscliv2) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/awscliv2.svg?color=blue)](https://pypi.org/project/awscliv2) +[![PyPI - Downloads](https://img.shields.io/pypi/dm/awscliv2?color=blue)](https://pypistats.org/packages/awscliv2) + +Wrapper for [AWS CLI v2](https://awscli.amazonaws.com/v2/documentation/api/latest/index.html). + +- No dependency hell, like with original [awscli](https://pypi.org/project/awscli/) +- Can install and update `awscliv2` binaries +- Provides access to all services +- Has Python interface + +- [AWS CLI v2 for Python](#aws-cli-v2-for-python) + - [Before you start](#before-you-start) + - [Installation](#installation) + - [Usage](#usage) + - [From command line](#from-command-line) + - [Docker fallback](#docker-fallback) + - [Extra commands](#extra-commands) + - [As a Python module](#as-a-python-module) + - [Development](#development) + - [How to help](#how-to-help) + - [Versioning](#versioning) + - [Latest changes](#latest-changes) + +## Before you start + +- This is not an official AWS CLI v2 application, [rant there](https://github.com/aws/aws-cli/issues/4947) +- Check the source code of this app, as you are working with sensitive data +- By default this app uses [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image +- To use [binaries for your OS](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html), run `awsv2 --install` +- Cross-check the source code again, probably I want to steal your credentials + +## Installation + +```bash +python -m pip install awscliv2 +``` + +You can add an alias to your `~/.bashrc` or `~/.zshrc` to use it as a regular `AWS CLI v2` + +```bash +alias aws='awsv2' +``` + +## Usage + +### From command line + +Install `AWS CLI v2`: + +```bash +# do not worry if this fails, you can still use awsv2 if you have docker installed +awsv2 --install +``` + +Configure default profile if needed: + +```bash +AWS_ACCESS_KEY_ID='my-access-key' +AWS_SECRET_ACCESS_KEY='my-secret-key' + +# --configure [] +awsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} +awsv2 configure set region us-west-1 +``` + +Use `AWS CLI` as usual: + +```bash +# alias for +# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@ +awsv2 s3 ls + +# or as a python module +python -m awscliv2 s3 ls +``` + +Also, you can check [scripts/example.sh](https://github.com/youtype/awscliv2/blob/main/scripts/example.sh) + +### Docker fallback + +Unless you run `awsv2 --install` once, application will use [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image. The image is not ideal, and it uses `root` user, so fix downloaded file permissions manually. Or just run `awsv2 --install` + +Update it with `docker pull amazon/aws-cli`. + +Container uses two volumes: + +- `$HOME/.aws` -> `/root/.aws` - credentials and config store +- `$(cwd)` -> `/aws` - Docker image workdir + +### Extra commands + +`awscliv2` contains a few commands to make your life easier, especially in CI or any non-TTY environment. + +- `awsv2 -U/--update/--install` - Install `AWS CLI v2` +- `awsv2 --configure [] []` - set profile in `~/.aws/credentials` +- `awsv2 --assume-role ` - create a new profile with assume role credentials +- `awsv2 -V/--version` - Output `awscliv2` and `AWS CLI v2` versions + +### As a Python module + +Basic usage + +```python +from awscliv2.api import AWSAPI +from awscliv2.exceptions import AWSCLIError + +aws_api = AWSAPI() + +try: + output = aws_api.execute(["s3", "ls"]) +except AWSCLIError as e: + print(f"Something went wrong: {e}") +else: + print(output) +``` + +Install binaries for your OS from Python + +```python +from awscliv2.installers import install_multiplatform + +install_multiplatform() +``` + +You can also set credentials or assume roles + +```python +from awscliv2.api import AWSAPI + +aws_api = AWSAPI() + +aws_api.set_credentials("profile_name", "access_key", "secret_key", "", "region") +aws_api.assume_role("name", "source_profile", "role_arn") +``` + +## Development + +- Install [poetry](https://python-poetry.org/) +- Run `poetry install` +- Use `black` formatter in your IDE + +## How to help + +- Ping AWS team to release an official PyPI package +- Share your experience in issues + +## Versioning + +`awscliv2` version follows [PEP 440](https://www.python.org/dev/peps/pep-0440/). + +## Latest changes + +Full changelog can be found in [Releases](https://github.com/youtype/awscliv2/releases). + + + +%package -n python3-awscliv2 +Summary: Wrapper for AWS CLI v2 +Provides: python-awscliv2 +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-awscliv2 +# AWS CLI v2 for Python + +[![PyPI - awscliv2](https://img.shields.io/pypi/v/awscliv2.svg?color=blue&label=awscliv2)](https://pypi.org/project/awscliv2) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/awscliv2.svg?color=blue)](https://pypi.org/project/awscliv2) +[![PyPI - Downloads](https://img.shields.io/pypi/dm/awscliv2?color=blue)](https://pypistats.org/packages/awscliv2) + +Wrapper for [AWS CLI v2](https://awscli.amazonaws.com/v2/documentation/api/latest/index.html). + +- No dependency hell, like with original [awscli](https://pypi.org/project/awscli/) +- Can install and update `awscliv2` binaries +- Provides access to all services +- Has Python interface + +- [AWS CLI v2 for Python](#aws-cli-v2-for-python) + - [Before you start](#before-you-start) + - [Installation](#installation) + - [Usage](#usage) + - [From command line](#from-command-line) + - [Docker fallback](#docker-fallback) + - [Extra commands](#extra-commands) + - [As a Python module](#as-a-python-module) + - [Development](#development) + - [How to help](#how-to-help) + - [Versioning](#versioning) + - [Latest changes](#latest-changes) + +## Before you start + +- This is not an official AWS CLI v2 application, [rant there](https://github.com/aws/aws-cli/issues/4947) +- Check the source code of this app, as you are working with sensitive data +- By default this app uses [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image +- To use [binaries for your OS](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html), run `awsv2 --install` +- Cross-check the source code again, probably I want to steal your credentials + +## Installation + +```bash +python -m pip install awscliv2 +``` + +You can add an alias to your `~/.bashrc` or `~/.zshrc` to use it as a regular `AWS CLI v2` + +```bash +alias aws='awsv2' +``` + +## Usage + +### From command line + +Install `AWS CLI v2`: + +```bash +# do not worry if this fails, you can still use awsv2 if you have docker installed +awsv2 --install +``` + +Configure default profile if needed: + +```bash +AWS_ACCESS_KEY_ID='my-access-key' +AWS_SECRET_ACCESS_KEY='my-secret-key' + +# --configure [] +awsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} +awsv2 configure set region us-west-1 +``` + +Use `AWS CLI` as usual: + +```bash +# alias for +# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@ +awsv2 s3 ls + +# or as a python module +python -m awscliv2 s3 ls +``` + +Also, you can check [scripts/example.sh](https://github.com/youtype/awscliv2/blob/main/scripts/example.sh) + +### Docker fallback + +Unless you run `awsv2 --install` once, application will use [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image. The image is not ideal, and it uses `root` user, so fix downloaded file permissions manually. Or just run `awsv2 --install` + +Update it with `docker pull amazon/aws-cli`. + +Container uses two volumes: + +- `$HOME/.aws` -> `/root/.aws` - credentials and config store +- `$(cwd)` -> `/aws` - Docker image workdir + +### Extra commands + +`awscliv2` contains a few commands to make your life easier, especially in CI or any non-TTY environment. + +- `awsv2 -U/--update/--install` - Install `AWS CLI v2` +- `awsv2 --configure [] []` - set profile in `~/.aws/credentials` +- `awsv2 --assume-role ` - create a new profile with assume role credentials +- `awsv2 -V/--version` - Output `awscliv2` and `AWS CLI v2` versions + +### As a Python module + +Basic usage + +```python +from awscliv2.api import AWSAPI +from awscliv2.exceptions import AWSCLIError + +aws_api = AWSAPI() + +try: + output = aws_api.execute(["s3", "ls"]) +except AWSCLIError as e: + print(f"Something went wrong: {e}") +else: + print(output) +``` + +Install binaries for your OS from Python + +```python +from awscliv2.installers import install_multiplatform + +install_multiplatform() +``` + +You can also set credentials or assume roles + +```python +from awscliv2.api import AWSAPI + +aws_api = AWSAPI() + +aws_api.set_credentials("profile_name", "access_key", "secret_key", "", "region") +aws_api.assume_role("name", "source_profile", "role_arn") +``` + +## Development + +- Install [poetry](https://python-poetry.org/) +- Run `poetry install` +- Use `black` formatter in your IDE + +## How to help + +- Ping AWS team to release an official PyPI package +- Share your experience in issues + +## Versioning + +`awscliv2` version follows [PEP 440](https://www.python.org/dev/peps/pep-0440/). + +## Latest changes + +Full changelog can be found in [Releases](https://github.com/youtype/awscliv2/releases). + + + +%package help +Summary: Development documents and examples for awscliv2 +Provides: python3-awscliv2-doc +%description help +# AWS CLI v2 for Python + +[![PyPI - awscliv2](https://img.shields.io/pypi/v/awscliv2.svg?color=blue&label=awscliv2)](https://pypi.org/project/awscliv2) +[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/awscliv2.svg?color=blue)](https://pypi.org/project/awscliv2) +[![PyPI - Downloads](https://img.shields.io/pypi/dm/awscliv2?color=blue)](https://pypistats.org/packages/awscliv2) + +Wrapper for [AWS CLI v2](https://awscli.amazonaws.com/v2/documentation/api/latest/index.html). + +- No dependency hell, like with original [awscli](https://pypi.org/project/awscli/) +- Can install and update `awscliv2` binaries +- Provides access to all services +- Has Python interface + +- [AWS CLI v2 for Python](#aws-cli-v2-for-python) + - [Before you start](#before-you-start) + - [Installation](#installation) + - [Usage](#usage) + - [From command line](#from-command-line) + - [Docker fallback](#docker-fallback) + - [Extra commands](#extra-commands) + - [As a Python module](#as-a-python-module) + - [Development](#development) + - [How to help](#how-to-help) + - [Versioning](#versioning) + - [Latest changes](#latest-changes) + +## Before you start + +- This is not an official AWS CLI v2 application, [rant there](https://github.com/aws/aws-cli/issues/4947) +- Check the source code of this app, as you are working with sensitive data +- By default this app uses [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image +- To use [binaries for your OS](https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html), run `awsv2 --install` +- Cross-check the source code again, probably I want to steal your credentials + +## Installation + +```bash +python -m pip install awscliv2 +``` + +You can add an alias to your `~/.bashrc` or `~/.zshrc` to use it as a regular `AWS CLI v2` + +```bash +alias aws='awsv2' +``` + +## Usage + +### From command line + +Install `AWS CLI v2`: + +```bash +# do not worry if this fails, you can still use awsv2 if you have docker installed +awsv2 --install +``` + +Configure default profile if needed: + +```bash +AWS_ACCESS_KEY_ID='my-access-key' +AWS_SECRET_ACCESS_KEY='my-secret-key' + +# --configure [] +awsv2 --configure default ${AWS_ACCESS_KEY_ID} ${AWS_SECRET_ACCESS_KEY} +awsv2 configure set region us-west-1 +``` + +Use `AWS CLI` as usual: + +```bash +# alias for +# docker run --rm -i -v ~/.aws:/root/.aws -v $(pwd):/aws amazon/aws-cli $@ +awsv2 s3 ls + +# or as a python module +python -m awscliv2 s3 ls +``` + +Also, you can check [scripts/example.sh](https://github.com/youtype/awscliv2/blob/main/scripts/example.sh) + +### Docker fallback + +Unless you run `awsv2 --install` once, application will use [amazon/aws-cli](https://hub.docker.com/r/amazon/aws-cli) Docker image. The image is not ideal, and it uses `root` user, so fix downloaded file permissions manually. Or just run `awsv2 --install` + +Update it with `docker pull amazon/aws-cli`. + +Container uses two volumes: + +- `$HOME/.aws` -> `/root/.aws` - credentials and config store +- `$(cwd)` -> `/aws` - Docker image workdir + +### Extra commands + +`awscliv2` contains a few commands to make your life easier, especially in CI or any non-TTY environment. + +- `awsv2 -U/--update/--install` - Install `AWS CLI v2` +- `awsv2 --configure [] []` - set profile in `~/.aws/credentials` +- `awsv2 --assume-role ` - create a new profile with assume role credentials +- `awsv2 -V/--version` - Output `awscliv2` and `AWS CLI v2` versions + +### As a Python module + +Basic usage + +```python +from awscliv2.api import AWSAPI +from awscliv2.exceptions import AWSCLIError + +aws_api = AWSAPI() + +try: + output = aws_api.execute(["s3", "ls"]) +except AWSCLIError as e: + print(f"Something went wrong: {e}") +else: + print(output) +``` + +Install binaries for your OS from Python + +```python +from awscliv2.installers import install_multiplatform + +install_multiplatform() +``` + +You can also set credentials or assume roles + +```python +from awscliv2.api import AWSAPI + +aws_api = AWSAPI() + +aws_api.set_credentials("profile_name", "access_key", "secret_key", "", "region") +aws_api.assume_role("name", "source_profile", "role_arn") +``` + +## Development + +- Install [poetry](https://python-poetry.org/) +- Run `poetry install` +- Use `black` formatter in your IDE + +## How to help + +- Ping AWS team to release an official PyPI package +- Share your experience in issues + +## Versioning + +`awscliv2` version follows [PEP 440](https://www.python.org/dev/peps/pep-0440/). + +## Latest changes + +Full changelog can be found in [Releases](https://github.com/youtype/awscliv2/releases). + + + +%prep +%autosetup -n awscliv2-2.2.0 + +%build +%py3_build + +%install +%py3_install +install -d -m755 %{buildroot}/%{_pkgdocdir} +if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi +if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi +if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi +if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi +pushd %{buildroot} +if [ -d usr/lib ]; then + find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/lib64 ]; then + find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/bin ]; then + find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst +fi +if [ -d usr/sbin ]; then + find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst +fi +touch doclist.lst +if [ -d usr/share/man ]; then + find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst +fi +popd +mv %{buildroot}/filelist.lst . +mv %{buildroot}/doclist.lst . + +%files -n python3-awscliv2 -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot - 2.2.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..12aa608 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +b4c4b960ff095e0dea76699b4b273eb2 awscliv2-2.2.0.tar.gz -- cgit v1.2.3