diff options
| author | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:21:31 +0000 |
|---|---|---|
| committer | CoprDistGit <infra@openeuler.org> | 2023-05-31 03:21:31 +0000 |
| commit | 4ef8887465aca21b249bf217d145efb56cc383f4 (patch) | |
| tree | e555271105e7ff3a83c7481784adea89858fc9c2 | |
| parent | 0d2cbc9d3798c90e078bf1e75f98b28d01df4371 (diff) | |
automatic import of python-django-ups-tnt
| -rw-r--r-- | .gitignore | 1 | ||||
| -rw-r--r-- | python-django-ups-tnt.spec | 285 | ||||
| -rw-r--r-- | sources | 1 |
3 files changed, 287 insertions, 0 deletions
@@ -0,0 +1 @@ +/django-ups-tnt-1.0.1.tar.gz diff --git a/python-django-ups-tnt.spec b/python-django-ups-tnt.spec new file mode 100644 index 0000000..04a444d --- /dev/null +++ b/python-django-ups-tnt.spec @@ -0,0 +1,285 @@ +%global _empty_manifest_terminate_build 0 +Name: python-django-ups-tnt +Version: 1.0.1 +Release: 1 +Summary: Django wrapper around UPS Time In Transit JSON API +License: ISC +URL: https://gitlab.com/thelabnyc/django-ups-tnt +Source0: https://mirrors.nju.edu.cn/pypi/web/packages/72/f0/fcf8a94c762487e0116ce35e463486e436f1d6ecc4033082b67d80bbc350/django-ups-tnt-1.0.1.tar.gz +BuildArch: noarch + + +%description +# Django UPS Time In Transit + +django-ups-tnt is a wrapper around UPS's Time In Transit (TNT) API. + +This wrapper is necessary because UPS's API is not public and requires Authentication details that cannot be shared +in javascript. + +It provides some defaults to make the api easier to work with. +It also provides some form validation before hitting the UPS API and cache + +# Installation + +Requires djangorestframework>=3.3.0. Tested on Django 1.8 and 1.9. + +1. Add `django-ups-tnt` to requirements.txt or pip install. +2. Add `url(r'^api/', include('ups_tnt.urls')),` to urls.py +3. Set required settings in settings.py + +## Settings + +### Required + +UPS_USERNAME + +UPS_PASSWORD + +UPS_ACCESS_LICENSE_NUMBER + +### Override defaults + +UPS_DEFAULT_SHIP_FROM +UPS_DEFAULT_SHIP_TO + +Default shipping addresses + +Example syntax: + +``` +{ + "Address": { + "CountryCode": "US", + } +} +``` + +UPS_BUFFER_DAYS - add buffer to when the item is shipped. Defaults to 0. Set to a int or callable. + +UPS_DEFAULT_SHIPMENT_WEIGHT - Set shipment weight. Example + +``` +UPS_DEFAULT_SHIPMENT_WEIGHT = { + "UnitOfMeasurement": { + "Code": "LBS", + "Description": "Pounds" + }, + "Weight": "90" +} +``` + +UPS_DEFAULT_INVOICE - Set value of shipment + +``` +UPS_DEFAULT_INVOICE = { + "CurrencyCode": "USD", + "MonetaryValue": "800" +} +``` + +UPS_TEST_LIVE - Set to `True` to make unit tests access actual API instead of mocks + +UPS_CACHE_NAME - Set to the name of the cache to use. Defaults to `default` + + +%package -n python3-django-ups-tnt +Summary: Django wrapper around UPS Time In Transit JSON API +Provides: python-django-ups-tnt +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-django-ups-tnt +# Django UPS Time In Transit + +django-ups-tnt is a wrapper around UPS's Time In Transit (TNT) API. + +This wrapper is necessary because UPS's API is not public and requires Authentication details that cannot be shared +in javascript. + +It provides some defaults to make the api easier to work with. +It also provides some form validation before hitting the UPS API and cache + +# Installation + +Requires djangorestframework>=3.3.0. Tested on Django 1.8 and 1.9. + +1. Add `django-ups-tnt` to requirements.txt or pip install. +2. Add `url(r'^api/', include('ups_tnt.urls')),` to urls.py +3. Set required settings in settings.py + +## Settings + +### Required + +UPS_USERNAME + +UPS_PASSWORD + +UPS_ACCESS_LICENSE_NUMBER + +### Override defaults + +UPS_DEFAULT_SHIP_FROM +UPS_DEFAULT_SHIP_TO + +Default shipping addresses + +Example syntax: + +``` +{ + "Address": { + "CountryCode": "US", + } +} +``` + +UPS_BUFFER_DAYS - add buffer to when the item is shipped. Defaults to 0. Set to a int or callable. + +UPS_DEFAULT_SHIPMENT_WEIGHT - Set shipment weight. Example + +``` +UPS_DEFAULT_SHIPMENT_WEIGHT = { + "UnitOfMeasurement": { + "Code": "LBS", + "Description": "Pounds" + }, + "Weight": "90" +} +``` + +UPS_DEFAULT_INVOICE - Set value of shipment + +``` +UPS_DEFAULT_INVOICE = { + "CurrencyCode": "USD", + "MonetaryValue": "800" +} +``` + +UPS_TEST_LIVE - Set to `True` to make unit tests access actual API instead of mocks + +UPS_CACHE_NAME - Set to the name of the cache to use. Defaults to `default` + + +%package help +Summary: Development documents and examples for django-ups-tnt +Provides: python3-django-ups-tnt-doc +%description help +# Django UPS Time In Transit + +django-ups-tnt is a wrapper around UPS's Time In Transit (TNT) API. + +This wrapper is necessary because UPS's API is not public and requires Authentication details that cannot be shared +in javascript. + +It provides some defaults to make the api easier to work with. +It also provides some form validation before hitting the UPS API and cache + +# Installation + +Requires djangorestframework>=3.3.0. Tested on Django 1.8 and 1.9. + +1. Add `django-ups-tnt` to requirements.txt or pip install. +2. Add `url(r'^api/', include('ups_tnt.urls')),` to urls.py +3. Set required settings in settings.py + +## Settings + +### Required + +UPS_USERNAME + +UPS_PASSWORD + +UPS_ACCESS_LICENSE_NUMBER + +### Override defaults + +UPS_DEFAULT_SHIP_FROM +UPS_DEFAULT_SHIP_TO + +Default shipping addresses + +Example syntax: + +``` +{ + "Address": { + "CountryCode": "US", + } +} +``` + +UPS_BUFFER_DAYS - add buffer to when the item is shipped. Defaults to 0. Set to a int or callable. + +UPS_DEFAULT_SHIPMENT_WEIGHT - Set shipment weight. Example + +``` +UPS_DEFAULT_SHIPMENT_WEIGHT = { + "UnitOfMeasurement": { + "Code": "LBS", + "Description": "Pounds" + }, + "Weight": "90" +} +``` + +UPS_DEFAULT_INVOICE - Set value of shipment + +``` +UPS_DEFAULT_INVOICE = { + "CurrencyCode": "USD", + "MonetaryValue": "800" +} +``` + +UPS_TEST_LIVE - Set to `True` to make unit tests access actual API instead of mocks + +UPS_CACHE_NAME - Set to the name of the cache to use. Defaults to `default` + + +%prep +%autosetup -n django-ups-tnt-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-django-ups-tnt -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.1-1 +- Package Spec generated @@ -0,0 +1 @@ +5a7dee212dc9c5c123bc8bdb76a755d9 django-ups-tnt-1.0.1.tar.gz |
