diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 07:22:24 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 07:22:24 +0000 |
commit | 6dbc716b80d11aa4cf7aef171edd3c3e1a147d0e (patch) | |
tree | b4ce293a57d1594cf4cf9392ff1953d51b0c52a1 | |
parent | 6b088b87981507f31e66fcaf1ec8eabd0b3d1661 (diff) |
automatic import of python-random-object-idopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-random-object-id.spec | 243 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 245 insertions, 0 deletions
@@ -0,0 +1 @@ +/random_object_id-2.0.0.tar.gz diff --git a/python-random-object-id.spec b/python-random-object-id.spec new file mode 100644 index 0000000..b9f66f7 --- /dev/null +++ b/python-random-object-id.spec @@ -0,0 +1,243 @@ +%global _empty_manifest_terminate_build 0 +Name: python-random-object-id +Version: 2.0.0 +Release: 1 +Summary: Generate a random MongoDB ObjectId. +License: MIT +URL: https://github.com/mxr/random-object-id +Source0: https://mirrors.aliyun.com/pypi/web/packages/f9/0a/a82b6822abd80e0bef2972cf81077993e311af238f1ad3cf144316eb9a4b/random_object_id-2.0.0.tar.gz +BuildArch: noarch + + +%description +# Random ObjectId + +[](https://pypi.python.org/pypi/random-object-id/) + +## Motivation + +This is a toy project without any outlandish goals. Occasionally I +needed a MongoDB ObjectID for a unit test. This saves a DB query, +starting `mongo` locally, writing more than a line of Python, or +visiting a website. I also wanted to learn more about writing & +deploying Python packages. + +## Dependencies + +None + +## Supports + +py36+. See GitHub workflow [here][GitHub workflow]. + +## Installation + +```console +$ pip install random-object-id +``` + +## Usage + +```console +$ random_object_id -h +usage: random_object_id [-h] [-l] + +Generate a random MongoDB ObjectId + +optional arguments: + -h, --help show this help message and exit + -l, --longform prints the ID surrounded by ObjectId("...") +``` + +```python +from random_object_id import generate + +generate() # => '5ecd3bbf875e60b4166f6699' +``` + +## Examples + +```console +$ random_object_id +55348611a56c10449ab80a4f +$ random_object_id -l +ObjectId("553486125ed592a10c4e8e6b") +``` + +[GitHub workflow]: https://github.com/mxr/random-object-id/blob/master/.github/workflows/main.yml + + + + +%package -n python3-random-object-id +Summary: Generate a random MongoDB ObjectId. +Provides: python-random-object-id +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-random-object-id +# Random ObjectId + +[](https://pypi.python.org/pypi/random-object-id/) + +## Motivation + +This is a toy project without any outlandish goals. Occasionally I +needed a MongoDB ObjectID for a unit test. This saves a DB query, +starting `mongo` locally, writing more than a line of Python, or +visiting a website. I also wanted to learn more about writing & +deploying Python packages. + +## Dependencies + +None + +## Supports + +py36+. See GitHub workflow [here][GitHub workflow]. + +## Installation + +```console +$ pip install random-object-id +``` + +## Usage + +```console +$ random_object_id -h +usage: random_object_id [-h] [-l] + +Generate a random MongoDB ObjectId + +optional arguments: + -h, --help show this help message and exit + -l, --longform prints the ID surrounded by ObjectId("...") +``` + +```python +from random_object_id import generate + +generate() # => '5ecd3bbf875e60b4166f6699' +``` + +## Examples + +```console +$ random_object_id +55348611a56c10449ab80a4f +$ random_object_id -l +ObjectId("553486125ed592a10c4e8e6b") +``` + +[GitHub workflow]: https://github.com/mxr/random-object-id/blob/master/.github/workflows/main.yml + + + + +%package help +Summary: Development documents and examples for random-object-id +Provides: python3-random-object-id-doc +%description help +# Random ObjectId + +[](https://pypi.python.org/pypi/random-object-id/) + +## Motivation + +This is a toy project without any outlandish goals. Occasionally I +needed a MongoDB ObjectID for a unit test. This saves a DB query, +starting `mongo` locally, writing more than a line of Python, or +visiting a website. I also wanted to learn more about writing & +deploying Python packages. + +## Dependencies + +None + +## Supports + +py36+. See GitHub workflow [here][GitHub workflow]. + +## Installation + +```console +$ pip install random-object-id +``` + +## Usage + +```console +$ random_object_id -h +usage: random_object_id [-h] [-l] + +Generate a random MongoDB ObjectId + +optional arguments: + -h, --help show this help message and exit + -l, --longform prints the ID surrounded by ObjectId("...") +``` + +```python +from random_object_id import generate + +generate() # => '5ecd3bbf875e60b4166f6699' +``` + +## Examples + +```console +$ random_object_id +55348611a56c10449ab80a4f +$ random_object_id -l +ObjectId("553486125ed592a10c4e8e6b") +``` + +[GitHub workflow]: https://github.com/mxr/random-object-id/blob/master/.github/workflows/main.yml + + + + +%prep +%autosetup -n random_object_id-2.0.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-random-object-id -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.0-1 +- Package Spec generated @@ -0,0 +1 @@ +46725facdbc5b0c14470717e8f29b053 random_object_id-2.0.0.tar.gz |