diff options
Diffstat (limited to 'python-spring-config-client.spec')
| -rw-r--r-- | python-spring-config-client.spec | 328 |
1 files changed, 328 insertions, 0 deletions
diff --git a/python-spring-config-client.spec b/python-spring-config-client.spec new file mode 100644 index 0000000..c289209 --- /dev/null +++ b/python-spring-config-client.spec @@ -0,0 +1,328 @@ +%global _empty_manifest_terminate_build 0 +Name: python-spring-config-client +Version: 0.2 +Release: 1 +Summary: A client for Spring Config Server +License: MIT +URL: https://realbucksavage.github.io/spring-config-client +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/05/5d/424c72107948fef2f44d30e0336bea150caad96d4b569cf36485846fcf15/spring-config-client-0.2.tar.gz +BuildArch: noarch + +Requires: python3-requests + +%description +# spring-config-client + +A Python client for [Spring Config Server](https://spring.io/projects/spring-cloud-config). + +This library is inspired by [amenezes/config-client](https://github.com/amenezes/config-client) and is essentially a toned-down fork that I customized to fit my own needs. + +## Project goals + +- [x] Provide a basic client +- [x] Provide basic authentication +- [ ] Add support for CloudFoundry + +## Installation + +Install using `pip` + +```shell +$ pip install spring-config-client +``` + +## Usage + +The very basic usage of this library looks like this: + +```python +from spring_config import ClientConfigurationBuilder +from spring_config.client import SpringConfigClient + +config = ClientConfigurationBuilder().app_name("test-application").build() + +c = SpringConfigClient(config) +c.get_config() +``` + +By default, `ClientConfigurationBuilder` builds a `ClientConfiguration` object with server address and application profile set to `http://localhost:8888` and `development`. These can be changed like this: + +Here are some examples: + +```python +# Fetch from http://someserver.com using profile "development" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .build() +) + +# Fetch from http://someserver.com using profile "production" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .profile("production") + .build() +) +``` + +### Authentication + +If your configuration server requires to use basic authentication, you can create the client configuration like this: + +```python +from spring_config import ClientConfigurationBuilder + +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .authentication(("username", "password")) + .build() +) +``` + +### Configuration options + +The `ClientConfigurationBuilder` allow controlling these parameters. + +- Application Name : `app_name("some-app")` - Default `None`, required. +- Server Address : `address("http://some-server")` - Default `http://localhost:8888`, optional. +- Profile : `profile("production")` - Default `development`, optional. +- Branch : `branch("devel/0.1")` - Default `master`, optional. + +## Requesting features + +Please use the [issues section](https://github.com/realbucksavage/spring-config-client/issues) to request new features and I will try to take out my time to work on them. Contributions in any sorts are always welcome :) + + + +%package -n python3-spring-config-client +Summary: A client for Spring Config Server +Provides: python-spring-config-client +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-spring-config-client +# spring-config-client + +A Python client for [Spring Config Server](https://spring.io/projects/spring-cloud-config). + +This library is inspired by [amenezes/config-client](https://github.com/amenezes/config-client) and is essentially a toned-down fork that I customized to fit my own needs. + +## Project goals + +- [x] Provide a basic client +- [x] Provide basic authentication +- [ ] Add support for CloudFoundry + +## Installation + +Install using `pip` + +```shell +$ pip install spring-config-client +``` + +## Usage + +The very basic usage of this library looks like this: + +```python +from spring_config import ClientConfigurationBuilder +from spring_config.client import SpringConfigClient + +config = ClientConfigurationBuilder().app_name("test-application").build() + +c = SpringConfigClient(config) +c.get_config() +``` + +By default, `ClientConfigurationBuilder` builds a `ClientConfiguration` object with server address and application profile set to `http://localhost:8888` and `development`. These can be changed like this: + +Here are some examples: + +```python +# Fetch from http://someserver.com using profile "development" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .build() +) + +# Fetch from http://someserver.com using profile "production" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .profile("production") + .build() +) +``` + +### Authentication + +If your configuration server requires to use basic authentication, you can create the client configuration like this: + +```python +from spring_config import ClientConfigurationBuilder + +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .authentication(("username", "password")) + .build() +) +``` + +### Configuration options + +The `ClientConfigurationBuilder` allow controlling these parameters. + +- Application Name : `app_name("some-app")` - Default `None`, required. +- Server Address : `address("http://some-server")` - Default `http://localhost:8888`, optional. +- Profile : `profile("production")` - Default `development`, optional. +- Branch : `branch("devel/0.1")` - Default `master`, optional. + +## Requesting features + +Please use the [issues section](https://github.com/realbucksavage/spring-config-client/issues) to request new features and I will try to take out my time to work on them. Contributions in any sorts are always welcome :) + + + +%package help +Summary: Development documents and examples for spring-config-client +Provides: python3-spring-config-client-doc +%description help +# spring-config-client + +A Python client for [Spring Config Server](https://spring.io/projects/spring-cloud-config). + +This library is inspired by [amenezes/config-client](https://github.com/amenezes/config-client) and is essentially a toned-down fork that I customized to fit my own needs. + +## Project goals + +- [x] Provide a basic client +- [x] Provide basic authentication +- [ ] Add support for CloudFoundry + +## Installation + +Install using `pip` + +```shell +$ pip install spring-config-client +``` + +## Usage + +The very basic usage of this library looks like this: + +```python +from spring_config import ClientConfigurationBuilder +from spring_config.client import SpringConfigClient + +config = ClientConfigurationBuilder().app_name("test-application").build() + +c = SpringConfigClient(config) +c.get_config() +``` + +By default, `ClientConfigurationBuilder` builds a `ClientConfiguration` object with server address and application profile set to `http://localhost:8888` and `development`. These can be changed like this: + +Here are some examples: + +```python +# Fetch from http://someserver.com using profile "development" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .build() +) + +# Fetch from http://someserver.com using profile "production" +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .address("http://someserver.com") + .profile("production") + .build() +) +``` + +### Authentication + +If your configuration server requires to use basic authentication, you can create the client configuration like this: + +```python +from spring_config import ClientConfigurationBuilder + +config = ( + ClientConfigurationBuilder() + .app_name("test-application") + .authentication(("username", "password")) + .build() +) +``` + +### Configuration options + +The `ClientConfigurationBuilder` allow controlling these parameters. + +- Application Name : `app_name("some-app")` - Default `None`, required. +- Server Address : `address("http://some-server")` - Default `http://localhost:8888`, optional. +- Profile : `profile("production")` - Default `development`, optional. +- Branch : `branch("devel/0.1")` - Default `master`, optional. + +## Requesting features + +Please use the [issues section](https://github.com/realbucksavage/spring-config-client/issues) to request new features and I will try to take out my time to work on them. Contributions in any sorts are always welcome :) + + + +%prep +%autosetup -n spring-config-client-0.2 + +%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-spring-config-client -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 0.2-1 +- Package Spec generated |
