diff options
author | CoprDistGit <infra@openeuler.org> | 2023-04-12 02:22:20 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-04-12 02:22:20 +0000 |
commit | 5c53ac240aac461bc6188bdb87e42de552747f08 (patch) | |
tree | 2fb13a110a18cc0542256be879b8ef2b2846700e /python-homebase.spec | |
parent | b1e01913904330b9eed2c085eb44e85b07e1e65f (diff) |
automatic import of python-homebase
Diffstat (limited to 'python-homebase.spec')
-rw-r--r-- | python-homebase.spec | 331 |
1 files changed, 331 insertions, 0 deletions
diff --git a/python-homebase.spec b/python-homebase.spec new file mode 100644 index 0000000..bc82fb0 --- /dev/null +++ b/python-homebase.spec @@ -0,0 +1,331 @@ +%global _empty_manifest_terminate_build 0 +Name: python-homebase +Version: 1.0.1 +Release: 1 +Summary: A platform independent API for paths in which applications can write data. +License: Apache 2.0 +URL: https://github.com/dwavesystems/homebase +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/a5/fa/55afcae0026285dc51792e5959b3667a246fd5cb82e97211f2267d52b3ac/homebase-1.0.1.tar.gz +BuildArch: noarch + +Requires: python3-enum34 + +%description +[](https://coveralls.io/github/dwavesystems/homebase?branch=master) +[](https://travis-ci.org/dwavesystems/homebase) +[](http://homebase.readthedocs.io/en/latest/?badge=latest) +# homebase + + +A place for your app to call home. + +*homebase* provides a platform independent API for querying paths in which applications can write caches, data, configs, and +other information. + + +## rationale + +Since each operating system expects applications to write their data to OS dependant paths, managing cache writing +on portable applications can become difficult. + +For example, on macOS: + + ~/Library/Application Support/app_name + +while on Linux it may be: + + ~/.local/share/app_name + +and on Windows: + + c:\users\<user_name>\AppData\Local/app_name + +and the problem gets worse if you are running inside of a [virtualenv](https://virtualenv.pypa.io/en/stable/) + +A similar issue happens for other forms of data, like caches, logs, configuration files, or application state. + +## Installation + +```bash +python setup.py install +``` + + +## Usage + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +user_cache_dir = homebase.user_cache_dir(app_name=app_name, app_author=app_author) +user_logs_dir = homebase.user_logs_dir(app_name=app_name, app_author=app_author) +user_config_dir = homebase.user_config_dir(app_name=app_name, app_author=app_author) +user_state_dir = homebase.user_state_dir(app_name=app_name, app_author=app_author) + +# site specific directories, e.g. /usr/share +site_data_dir = homebase.site_data_dir(app_name=app_name, app_author=app_author) +site_config_dir = homebase.site_config_dir(app_name=app_name, app_author=app_author) +``` + +If you are running inside of a virtualenv, *homebase* will return paths that are relative to that environment. +If you still want the user path, pass `use_virtualenv=False` in the call. + +For example, suppose you have set up a virtual environment in `/home/username/env` on linux + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +# /home/username/env/data/my_app +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author, use_virtualenv=False) +# /home/username/.local/share/my_app. +``` + +See the [documentation](# TODO) for more details and examples. + +## License + +See [LICENSE.txt](LICENSE.txt) + + +## Acknowledgement + +This project is inspired by and is derived from [appdirs](https://github.com/ActiveState/appdirs) + + + + +%package -n python3-homebase +Summary: A platform independent API for paths in which applications can write data. +Provides: python-homebase +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-homebase +[](https://coveralls.io/github/dwavesystems/homebase?branch=master) +[](https://travis-ci.org/dwavesystems/homebase) +[](http://homebase.readthedocs.io/en/latest/?badge=latest) +# homebase + + +A place for your app to call home. + +*homebase* provides a platform independent API for querying paths in which applications can write caches, data, configs, and +other information. + + +## rationale + +Since each operating system expects applications to write their data to OS dependant paths, managing cache writing +on portable applications can become difficult. + +For example, on macOS: + + ~/Library/Application Support/app_name + +while on Linux it may be: + + ~/.local/share/app_name + +and on Windows: + + c:\users\<user_name>\AppData\Local/app_name + +and the problem gets worse if you are running inside of a [virtualenv](https://virtualenv.pypa.io/en/stable/) + +A similar issue happens for other forms of data, like caches, logs, configuration files, or application state. + +## Installation + +```bash +python setup.py install +``` + + +## Usage + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +user_cache_dir = homebase.user_cache_dir(app_name=app_name, app_author=app_author) +user_logs_dir = homebase.user_logs_dir(app_name=app_name, app_author=app_author) +user_config_dir = homebase.user_config_dir(app_name=app_name, app_author=app_author) +user_state_dir = homebase.user_state_dir(app_name=app_name, app_author=app_author) + +# site specific directories, e.g. /usr/share +site_data_dir = homebase.site_data_dir(app_name=app_name, app_author=app_author) +site_config_dir = homebase.site_config_dir(app_name=app_name, app_author=app_author) +``` + +If you are running inside of a virtualenv, *homebase* will return paths that are relative to that environment. +If you still want the user path, pass `use_virtualenv=False` in the call. + +For example, suppose you have set up a virtual environment in `/home/username/env` on linux + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +# /home/username/env/data/my_app +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author, use_virtualenv=False) +# /home/username/.local/share/my_app. +``` + +See the [documentation](# TODO) for more details and examples. + +## License + +See [LICENSE.txt](LICENSE.txt) + + +## Acknowledgement + +This project is inspired by and is derived from [appdirs](https://github.com/ActiveState/appdirs) + + + + +%package help +Summary: Development documents and examples for homebase +Provides: python3-homebase-doc +%description help +[](https://coveralls.io/github/dwavesystems/homebase?branch=master) +[](https://travis-ci.org/dwavesystems/homebase) +[](http://homebase.readthedocs.io/en/latest/?badge=latest) +# homebase + + +A place for your app to call home. + +*homebase* provides a platform independent API for querying paths in which applications can write caches, data, configs, and +other information. + + +## rationale + +Since each operating system expects applications to write their data to OS dependant paths, managing cache writing +on portable applications can become difficult. + +For example, on macOS: + + ~/Library/Application Support/app_name + +while on Linux it may be: + + ~/.local/share/app_name + +and on Windows: + + c:\users\<user_name>\AppData\Local/app_name + +and the problem gets worse if you are running inside of a [virtualenv](https://virtualenv.pypa.io/en/stable/) + +A similar issue happens for other forms of data, like caches, logs, configuration files, or application state. + +## Installation + +```bash +python setup.py install +``` + + +## Usage + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +user_cache_dir = homebase.user_cache_dir(app_name=app_name, app_author=app_author) +user_logs_dir = homebase.user_logs_dir(app_name=app_name, app_author=app_author) +user_config_dir = homebase.user_config_dir(app_name=app_name, app_author=app_author) +user_state_dir = homebase.user_state_dir(app_name=app_name, app_author=app_author) + +# site specific directories, e.g. /usr/share +site_data_dir = homebase.site_data_dir(app_name=app_name, app_author=app_author) +site_config_dir = homebase.site_config_dir(app_name=app_name, app_author=app_author) +``` + +If you are running inside of a virtualenv, *homebase* will return paths that are relative to that environment. +If you still want the user path, pass `use_virtualenv=False` in the call. + +For example, suppose you have set up a virtual environment in `/home/username/env` on linux + +```python +import homebase + +app_name = "my_app" +app_author = "nakatomi-corp" +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author) +# /home/username/env/data/my_app +user_data_dir = homebase.user_data_dir(app_name=app_name, app_author=app_author, use_virtualenv=False) +# /home/username/.local/share/my_app. +``` + +See the [documentation](# TODO) for more details and examples. + +## License + +See [LICENSE.txt](LICENSE.txt) + + +## Acknowledgement + +This project is inspired by and is derived from [appdirs](https://github.com/ActiveState/appdirs) + + + + +%prep +%autosetup -n homebase-1.0.1 + +%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-homebase -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.1-1 +- Package Spec generated |