summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-12 04:37:38 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-12 04:37:38 +0000
commit44a7de1ec64c5a2f4122061db49c5776134d59c4 (patch)
tree99a4b0490d099b413faa0ad0c42b443254d9565d
parentcdd84a8970877f889a7716c0364ab0c21f7a2f37 (diff)
automatic import of python-cached-path
-rw-r--r--.gitignore1
-rw-r--r--python-cached-path.spec478
-rw-r--r--sources1
3 files changed, 480 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index e69de29..b7ea54e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/cached_path-1.3.4.tar.gz
diff --git a/python-cached-path.spec b/python-cached-path.spec
new file mode 100644
index 0000000..a3525ab
--- /dev/null
+++ b/python-cached-path.spec
@@ -0,0 +1,478 @@
+%global _empty_manifest_terminate_build 0
+Name: python-cached-path
+Version: 1.3.4
+Release: 1
+Summary: please add a summary manually as the author left a blank one
+License: Apache
+URL: https://github.com/allenai/cached_path
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/2f/fa/d068e59abde0bb132dc96521953f483b7d63323f2adab86e8021b996e4e4/cached_path-1.3.4.tar.gz
+BuildArch: noarch
+
+Requires: python3-requests
+Requires: python3-rich
+Requires: python3-filelock
+Requires: python3-boto3
+Requires: python3-google-cloud-storage
+Requires: python3-huggingface-hub
+Requires: python3-dataclasses
+Requires: python3-beaker-py
+Requires: python3-flake8
+Requires: python3-mypy
+Requires: python3-black
+Requires: python3-isort
+Requires: python3-pytest
+Requires: python3-flaky
+Requires: python3-pytest-cov
+Requires: python3-coverage
+Requires: python3-codecov
+Requires: python3-twine
+Requires: python3-setuptools
+Requires: python3-wheel
+Requires: python3-responses
+Requires: python3-Sphinx
+Requires: python3-furo
+Requires: python3-myst-parser
+Requires: python3-sphinx-copybutton
+Requires: python3-sphinx-autobuild
+Requires: python3-sphinx-autodoc-typehints
+Requires: python3-packaging
+
+%description
+# [cached-path](https://cached-path.readthedocs.io/)
+
+<!-- start tagline -->
+
+A file utility library that provides a unified, simple interface for accessing both local and remote files.
+This can be used behind other APIs that need to access files agnostic to where they are located.
+
+<!-- end tagline -->
+
+<p align="center">
+ <a href="https://github.com/allenai/cached_path/actions">
+ <img alt="CI" src="https://github.com/allenai/cached_path/workflows/CI/badge.svg?event=push&branch=main">
+ </a>
+ <a href="https://pypi.org/project/cached_path/">
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/cached_path">
+ </a>
+ <a href="https://cached-path.readthedocs.io/en/latest/?badge=latest">
+ <img src="https://readthedocs.org/projects/cached-path/badge/?version=latest" alt="Documentation Status" />
+ </a>
+ <a href="https://github.com/allenai/cached_path/blob/main/LICENSE">
+ <img alt="License" src="https://img.shields.io/github/license/allenai/cached_path.svg?color=blue&cachedrop">
+ </a>
+ <br/>
+</p>
+
+## Quick links
+
+- [Documentation](https://cached-path.readthedocs.io/)
+- [PyPI Package](https://pypi.org/project/cached-path/)
+- [Contributing](https://github.com/allenai/cached_path/blob/main/CONTRIBUTING.md)
+- [License](https://github.com/allenai/cached_path/blob/main/LICENSE)
+
+## Installation
+
+<!-- start py version -->
+
+**cached-path** requires Python 3.7 or later.
+
+<!-- end py version -->
+
+### Installing with `pip`
+
+<!-- start install pip -->
+
+**cached-path** is available [on PyPI](https://pypi.org/project/cached-path/). Just run
+
+```bash
+pip install cached-path
+```
+
+<!-- end install pip -->
+
+### Installing from source
+
+<!-- start install source -->
+
+To install **cached-path** from source, first clone [the repository](https://github.com/allenai/cached_path):
+
+```bash
+git clone https://github.com/allenai/cached_path.git
+cd cached_path
+```
+
+Then run
+
+```bash
+pip install -e .
+```
+
+<!-- end install source -->
+
+## Usage
+
+```python
+from cached_path import cached_path
+```
+
+Given something that might be a URL or local path, `cached_path()` determines which.
+If it's a remote resource, it downloads the file and caches it to the [cache directory](#cache-directory), and
+then returns the path to the cached file. If it's already a local path,
+it makes sure the file exists and returns the path.
+
+For URLs, `http://`, `https://`, `s3://` (AWS S3), `gs://` (Google Cloud Storage), and `hf://` (HuggingFace Hub) are all supported out-of-the-box.
+Optionally `beaker://` URLs in the form of `beaker://{user_name}/{dataset_name}/{file_path}` are supported, which requires [beaker-py](https://github.com/allenai/beaker-py) to be installed.
+
+For example, to download the PyTorch weights for the model `epwalsh/bert-xsmall-dummy`
+on HuggingFace, you could do:
+
+```python
+cached_path("hf://epwalsh/bert-xsmall-dummy/pytorch_model.bin")
+```
+
+For paths or URLs that point to a tarfile or zipfile, you can also add a path
+to a specific file to the `url_or_filename` preceeded by a "!", and the archive will
+be automatically extracted (provided you set `extract_archive` to `True`),
+returning the local path to the specific file. For example:
+
+```python
+cached_path("model.tar.gz!weights.th", extract_archive=True)
+```
+
+### Cache directory
+
+By default the cache directory is `~/.cache/cached_path/`, however there are several ways to override this setting:
+- set the environment variable `CACHED_PATH_CACHE_ROOT`,
+- call `set_cache_dir()`, or
+- set the `cache_dir` argument each time you call `cached_path()`.
+
+## Team
+
+<!-- start team -->
+
+**cached-path** is developed and maintained by the AllenNLP team, backed by [the Allen Institute for Artificial Intelligence (AI2)](https://allenai.org/).
+AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.
+To learn more about who specifically contributed to this codebase, see [our contributors](https://github.com/allenai/cached_path/graphs/contributors) page.
+
+<!-- end team -->
+
+## License
+
+<!-- start license -->
+
+**cached-path** is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
+A full copy of the license can be found [on GitHub](https://github.com/allenai/cached_path/blob/main/LICENSE).
+
+<!-- end license -->
+
+
+%package -n python3-cached-path
+Summary: please add a summary manually as the author left a blank one
+Provides: python-cached-path
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-cached-path
+# [cached-path](https://cached-path.readthedocs.io/)
+
+<!-- start tagline -->
+
+A file utility library that provides a unified, simple interface for accessing both local and remote files.
+This can be used behind other APIs that need to access files agnostic to where they are located.
+
+<!-- end tagline -->
+
+<p align="center">
+ <a href="https://github.com/allenai/cached_path/actions">
+ <img alt="CI" src="https://github.com/allenai/cached_path/workflows/CI/badge.svg?event=push&branch=main">
+ </a>
+ <a href="https://pypi.org/project/cached_path/">
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/cached_path">
+ </a>
+ <a href="https://cached-path.readthedocs.io/en/latest/?badge=latest">
+ <img src="https://readthedocs.org/projects/cached-path/badge/?version=latest" alt="Documentation Status" />
+ </a>
+ <a href="https://github.com/allenai/cached_path/blob/main/LICENSE">
+ <img alt="License" src="https://img.shields.io/github/license/allenai/cached_path.svg?color=blue&cachedrop">
+ </a>
+ <br/>
+</p>
+
+## Quick links
+
+- [Documentation](https://cached-path.readthedocs.io/)
+- [PyPI Package](https://pypi.org/project/cached-path/)
+- [Contributing](https://github.com/allenai/cached_path/blob/main/CONTRIBUTING.md)
+- [License](https://github.com/allenai/cached_path/blob/main/LICENSE)
+
+## Installation
+
+<!-- start py version -->
+
+**cached-path** requires Python 3.7 or later.
+
+<!-- end py version -->
+
+### Installing with `pip`
+
+<!-- start install pip -->
+
+**cached-path** is available [on PyPI](https://pypi.org/project/cached-path/). Just run
+
+```bash
+pip install cached-path
+```
+
+<!-- end install pip -->
+
+### Installing from source
+
+<!-- start install source -->
+
+To install **cached-path** from source, first clone [the repository](https://github.com/allenai/cached_path):
+
+```bash
+git clone https://github.com/allenai/cached_path.git
+cd cached_path
+```
+
+Then run
+
+```bash
+pip install -e .
+```
+
+<!-- end install source -->
+
+## Usage
+
+```python
+from cached_path import cached_path
+```
+
+Given something that might be a URL or local path, `cached_path()` determines which.
+If it's a remote resource, it downloads the file and caches it to the [cache directory](#cache-directory), and
+then returns the path to the cached file. If it's already a local path,
+it makes sure the file exists and returns the path.
+
+For URLs, `http://`, `https://`, `s3://` (AWS S3), `gs://` (Google Cloud Storage), and `hf://` (HuggingFace Hub) are all supported out-of-the-box.
+Optionally `beaker://` URLs in the form of `beaker://{user_name}/{dataset_name}/{file_path}` are supported, which requires [beaker-py](https://github.com/allenai/beaker-py) to be installed.
+
+For example, to download the PyTorch weights for the model `epwalsh/bert-xsmall-dummy`
+on HuggingFace, you could do:
+
+```python
+cached_path("hf://epwalsh/bert-xsmall-dummy/pytorch_model.bin")
+```
+
+For paths or URLs that point to a tarfile or zipfile, you can also add a path
+to a specific file to the `url_or_filename` preceeded by a "!", and the archive will
+be automatically extracted (provided you set `extract_archive` to `True`),
+returning the local path to the specific file. For example:
+
+```python
+cached_path("model.tar.gz!weights.th", extract_archive=True)
+```
+
+### Cache directory
+
+By default the cache directory is `~/.cache/cached_path/`, however there are several ways to override this setting:
+- set the environment variable `CACHED_PATH_CACHE_ROOT`,
+- call `set_cache_dir()`, or
+- set the `cache_dir` argument each time you call `cached_path()`.
+
+## Team
+
+<!-- start team -->
+
+**cached-path** is developed and maintained by the AllenNLP team, backed by [the Allen Institute for Artificial Intelligence (AI2)](https://allenai.org/).
+AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.
+To learn more about who specifically contributed to this codebase, see [our contributors](https://github.com/allenai/cached_path/graphs/contributors) page.
+
+<!-- end team -->
+
+## License
+
+<!-- start license -->
+
+**cached-path** is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
+A full copy of the license can be found [on GitHub](https://github.com/allenai/cached_path/blob/main/LICENSE).
+
+<!-- end license -->
+
+
+%package help
+Summary: Development documents and examples for cached-path
+Provides: python3-cached-path-doc
+%description help
+# [cached-path](https://cached-path.readthedocs.io/)
+
+<!-- start tagline -->
+
+A file utility library that provides a unified, simple interface for accessing both local and remote files.
+This can be used behind other APIs that need to access files agnostic to where they are located.
+
+<!-- end tagline -->
+
+<p align="center">
+ <a href="https://github.com/allenai/cached_path/actions">
+ <img alt="CI" src="https://github.com/allenai/cached_path/workflows/CI/badge.svg?event=push&branch=main">
+ </a>
+ <a href="https://pypi.org/project/cached_path/">
+ <img alt="PyPI" src="https://img.shields.io/pypi/v/cached_path">
+ </a>
+ <a href="https://cached-path.readthedocs.io/en/latest/?badge=latest">
+ <img src="https://readthedocs.org/projects/cached-path/badge/?version=latest" alt="Documentation Status" />
+ </a>
+ <a href="https://github.com/allenai/cached_path/blob/main/LICENSE">
+ <img alt="License" src="https://img.shields.io/github/license/allenai/cached_path.svg?color=blue&cachedrop">
+ </a>
+ <br/>
+</p>
+
+## Quick links
+
+- [Documentation](https://cached-path.readthedocs.io/)
+- [PyPI Package](https://pypi.org/project/cached-path/)
+- [Contributing](https://github.com/allenai/cached_path/blob/main/CONTRIBUTING.md)
+- [License](https://github.com/allenai/cached_path/blob/main/LICENSE)
+
+## Installation
+
+<!-- start py version -->
+
+**cached-path** requires Python 3.7 or later.
+
+<!-- end py version -->
+
+### Installing with `pip`
+
+<!-- start install pip -->
+
+**cached-path** is available [on PyPI](https://pypi.org/project/cached-path/). Just run
+
+```bash
+pip install cached-path
+```
+
+<!-- end install pip -->
+
+### Installing from source
+
+<!-- start install source -->
+
+To install **cached-path** from source, first clone [the repository](https://github.com/allenai/cached_path):
+
+```bash
+git clone https://github.com/allenai/cached_path.git
+cd cached_path
+```
+
+Then run
+
+```bash
+pip install -e .
+```
+
+<!-- end install source -->
+
+## Usage
+
+```python
+from cached_path import cached_path
+```
+
+Given something that might be a URL or local path, `cached_path()` determines which.
+If it's a remote resource, it downloads the file and caches it to the [cache directory](#cache-directory), and
+then returns the path to the cached file. If it's already a local path,
+it makes sure the file exists and returns the path.
+
+For URLs, `http://`, `https://`, `s3://` (AWS S3), `gs://` (Google Cloud Storage), and `hf://` (HuggingFace Hub) are all supported out-of-the-box.
+Optionally `beaker://` URLs in the form of `beaker://{user_name}/{dataset_name}/{file_path}` are supported, which requires [beaker-py](https://github.com/allenai/beaker-py) to be installed.
+
+For example, to download the PyTorch weights for the model `epwalsh/bert-xsmall-dummy`
+on HuggingFace, you could do:
+
+```python
+cached_path("hf://epwalsh/bert-xsmall-dummy/pytorch_model.bin")
+```
+
+For paths or URLs that point to a tarfile or zipfile, you can also add a path
+to a specific file to the `url_or_filename` preceeded by a "!", and the archive will
+be automatically extracted (provided you set `extract_archive` to `True`),
+returning the local path to the specific file. For example:
+
+```python
+cached_path("model.tar.gz!weights.th", extract_archive=True)
+```
+
+### Cache directory
+
+By default the cache directory is `~/.cache/cached_path/`, however there are several ways to override this setting:
+- set the environment variable `CACHED_PATH_CACHE_ROOT`,
+- call `set_cache_dir()`, or
+- set the `cache_dir` argument each time you call `cached_path()`.
+
+## Team
+
+<!-- start team -->
+
+**cached-path** is developed and maintained by the AllenNLP team, backed by [the Allen Institute for Artificial Intelligence (AI2)](https://allenai.org/).
+AI2 is a non-profit institute with the mission to contribute to humanity through high-impact AI research and engineering.
+To learn more about who specifically contributed to this codebase, see [our contributors](https://github.com/allenai/cached_path/graphs/contributors) page.
+
+<!-- end team -->
+
+## License
+
+<!-- start license -->
+
+**cached-path** is licensed under [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0).
+A full copy of the license can be found [on GitHub](https://github.com/allenai/cached_path/blob/main/LICENSE).
+
+<!-- end license -->
+
+
+%prep
+%autosetup -n cached-path-1.3.4
+
+%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-cached-path -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed Apr 12 2023 Python_Bot <Python_Bot@openeuler.org> - 1.3.4-1
+- Package Spec generated
diff --git a/sources b/sources
new file mode 100644
index 0000000..afc9b3e
--- /dev/null
+++ b/sources
@@ -0,0 +1 @@
+e15b632fd1a06f190d05e28d502bf2dd cached_path-1.3.4.tar.gz