diff options
author | CoprDistGit <infra@openeuler.org> | 2023-06-20 08:50:25 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-06-20 08:50:25 +0000 |
commit | e7e60710e8fd9468a94340b04d72e53b5ed54bef (patch) | |
tree | 485d95862bcee721e091573480715fe281ae299e | |
parent | f5be7783e0cc1fedda33a0b7f5591cac2af9242a (diff) |
automatic import of python-libvcsopeneuler20.03
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | python-libvcs.spec | 610 | ||||
-rw-r--r-- | sources | 1 |
3 files changed, 612 insertions, 0 deletions
@@ -0,0 +1 @@ +/libvcs-0.22.1.tar.gz diff --git a/python-libvcs.spec b/python-libvcs.spec new file mode 100644 index 0000000..d27a53f --- /dev/null +++ b/python-libvcs.spec @@ -0,0 +1,610 @@ +%global _empty_manifest_terminate_build 0 +Name: python-libvcs +Version: 0.22.1 +Release: 1 +Summary: Lite, typed, python utilities for Git, SVN, Mercurial, etc. +License: MIT +URL: http://github.com/vcs-python/libvcs/ +Source0: https://mirrors.aliyun.com/pypi/web/packages/ca/15/f7da442b27181727d5221fb7920d4c3d8c5a90768c75619680cd2feb249d/libvcs-0.22.1.tar.gz +BuildArch: noarch + +Requires: python3-typing-extensions + +%description +# `libvcs` · [](https://pypi.org/project/libvcs/) [](https://github.com/vcs-python/libvcs/blob/master/LICENSE) [](https://codecov.io/gh/vcs-python/libvcs) + +libvcs is a lite, [typed](https://docs.python.org/3/library/typing.html), pythonic tool box for +detection and parsing of URLs, commanding, and syncing with `git`, `hg`, and `svn`. Powers +[vcspull](https://www.github.com/vcs-python/vcspull/). + +## Overview + +_Supports Python 3.9 and above_ + +Features for Git, Subversion, and Mercurial: + +- **Detect and parse** VCS URLs +- **Command** VCS via python API +- **Sync** repos locally +- **Test fixtures** for temporary local repos and working copies + +To **get started**, see the [quickstart](https://libvcs.git-pull.com/quickstart.html) for more. + +```console +$ pip install --user libvcs +``` + +## URL Parser + +You can validate and parse Git, Mercurial, and Subversion URLs through +[`libvcs.url`](https://libvcs.git-pull.com/url/index.html): + +Validate: + +```python +>>> from libvcs.url.git import GitURL + +>>> GitURL.is_valid(url='https://github.com/vcs-python/libvcs.git') +True +``` + +Parse and adjust a Git URL: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location +GitURL(url=git@github.com:vcs-python/libvcs.git, + user=git, + hostname=github.com, + path=vcs-python/libvcs, + suffix=.git, + rule=core-git-scp) +``` + +Switch repo libvcs -> vcspull: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location.path = 'vcs-python/vcspull' + +>>> git_location.to_url() +'git@github.com:vcs-python/vcspull.git' + +# Switch them to gitlab: +>>> git_location.hostname = 'gitlab.com' + +# Export to a `git clone` compatible URL. +>>> git_location.to_url() +'git@gitlab.com:vcs-python/vcspull.git' +``` + +See more in the [parser document](https://libvcs.git-pull.com/parse/index.html). + +## Commands + +Simple [`subprocess`](https://docs.python.org/3/library/subprocess.html) wrappers around `git(1)`, +`hg(1)`, `svn(1)`. Here is [`Git`](https://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git) w/ +[`Git.clone`](http://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git.clone): + +```python +import pathlib +from libvcs.cmd.git import Git + +git = Git(dir=pathlib.Path.cwd() / 'my_git_repo') +git.clone(url='https://github.com/vcs-python/libvcs.git') +``` + +## Sync + +Create a [`GitSync`](https://libvcs.git-pull.com/projects/git.html#libvcs.sync.git.GitProject) +object of the project to inspect / checkout / update: + +```python +import pathlib +from libvcs.sync.git import GitSync + +repo = GitSync( + url="https://github.com/vcs-python/libvcs", + dir=pathlib.Path().cwd() / "my_repo", + remotes={ + 'gitlab': 'https://gitlab.com/vcs-python/libvcs' + } +) + +# Update / clone repo: +>>> repo.update_repo() + +# Get revision: +>>> repo.get_revision() +u'5c227e6ab4aab44bf097da2e088b0ff947370ab8' +``` + +## Pytest plugin + +libvcs also provides a test rig for local repositories. It automatically can provide clean local +repositories and working copies for git, svn, and mercurial. They are automatically cleaned up after +each test. + +It works by bootstrapping a temporary `$HOME` environment in a +[`TmpPathFactory`](https://docs.pytest.org/en/7.1.x/reference/reference.html#tmp-path-factory-factory-api) +for automatic cleanup. + +```python +import pathlib + +from libvcs.pytest_plugin import CreateProjectCallbackFixtureProtocol +from libvcs.sync.git import GitSync + + +def test_repo_git_remote_checkout( + create_git_remote_repo: CreateProjectCallbackFixtureProtocol, + tmp_path: pathlib.Path, + projects_path: pathlib.Path, +) -> None: + git_server = create_git_remote_repo() + git_repo_checkout_dir = projects_path / "my_git_checkout" + git_repo = GitSync(dir=str(git_repo_checkout_dir), url=f"file://{git_server!s}") + + git_repo.obtain() + git_repo.update_repo() + + assert git_repo.get_revision() == "initial" + + assert git_repo_checkout_dir.exists() + assert pathlib.Path(git_repo_checkout_dir / ".git").exists() +``` + +Learn more on the docs at https://libvcs.git-pull.com/pytest-plugin.html + +## Donations + +Your donations fund development of new features, testing and support. Your money will go directly to +maintenance and development of the project. If you are an individual, feel free to give whatever +feels right for the value you get out of the project. + +See donation options at <https://www.git-pull.com/support.html>. + +## More information + +- Python support: 3.9+, pypy +- VCS supported: git(1), svn(1), hg(1) +- Source: <https://github.com/vcs-python/libvcs> +- Docs: <https://libvcs.git-pull.com> +- Changelog: <https://libvcs.git-pull.com/history.html> +- APIs for git, hg, and svn: + - [`libvcs.url`](https://libvcs.git-pull.com/url/): URL Parser + - [`libvcs.cmd`](https://libvcs.git-pull.com/cmd/): Commands + - [`libvcs.sync`](https://libvcs.git-pull.com/sync/): Clone and update +- Issues: <https://github.com/vcs-python/libvcs/issues> +- Test Coverage: <https://codecov.io/gh/vcs-python/libvcs> +- pypi: <https://pypi.python.org/pypi/libvcs> +- Open Hub: <https://www.openhub.net/p/libvcs> +- License: [MIT](https://opensource.org/licenses/MIT). + +[](https://libvcs.git-pull.com/) +[](https://github.com/vcs-python/libvcs/actions?query=workflow%3A%22tests%22) + + + +%package -n python3-libvcs +Summary: Lite, typed, python utilities for Git, SVN, Mercurial, etc. +Provides: python-libvcs +BuildRequires: python3-devel +BuildRequires: python3-setuptools +BuildRequires: python3-pip +%description -n python3-libvcs +# `libvcs` · [](https://pypi.org/project/libvcs/) [](https://github.com/vcs-python/libvcs/blob/master/LICENSE) [](https://codecov.io/gh/vcs-python/libvcs) + +libvcs is a lite, [typed](https://docs.python.org/3/library/typing.html), pythonic tool box for +detection and parsing of URLs, commanding, and syncing with `git`, `hg`, and `svn`. Powers +[vcspull](https://www.github.com/vcs-python/vcspull/). + +## Overview + +_Supports Python 3.9 and above_ + +Features for Git, Subversion, and Mercurial: + +- **Detect and parse** VCS URLs +- **Command** VCS via python API +- **Sync** repos locally +- **Test fixtures** for temporary local repos and working copies + +To **get started**, see the [quickstart](https://libvcs.git-pull.com/quickstart.html) for more. + +```console +$ pip install --user libvcs +``` + +## URL Parser + +You can validate and parse Git, Mercurial, and Subversion URLs through +[`libvcs.url`](https://libvcs.git-pull.com/url/index.html): + +Validate: + +```python +>>> from libvcs.url.git import GitURL + +>>> GitURL.is_valid(url='https://github.com/vcs-python/libvcs.git') +True +``` + +Parse and adjust a Git URL: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location +GitURL(url=git@github.com:vcs-python/libvcs.git, + user=git, + hostname=github.com, + path=vcs-python/libvcs, + suffix=.git, + rule=core-git-scp) +``` + +Switch repo libvcs -> vcspull: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location.path = 'vcs-python/vcspull' + +>>> git_location.to_url() +'git@github.com:vcs-python/vcspull.git' + +# Switch them to gitlab: +>>> git_location.hostname = 'gitlab.com' + +# Export to a `git clone` compatible URL. +>>> git_location.to_url() +'git@gitlab.com:vcs-python/vcspull.git' +``` + +See more in the [parser document](https://libvcs.git-pull.com/parse/index.html). + +## Commands + +Simple [`subprocess`](https://docs.python.org/3/library/subprocess.html) wrappers around `git(1)`, +`hg(1)`, `svn(1)`. Here is [`Git`](https://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git) w/ +[`Git.clone`](http://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git.clone): + +```python +import pathlib +from libvcs.cmd.git import Git + +git = Git(dir=pathlib.Path.cwd() / 'my_git_repo') +git.clone(url='https://github.com/vcs-python/libvcs.git') +``` + +## Sync + +Create a [`GitSync`](https://libvcs.git-pull.com/projects/git.html#libvcs.sync.git.GitProject) +object of the project to inspect / checkout / update: + +```python +import pathlib +from libvcs.sync.git import GitSync + +repo = GitSync( + url="https://github.com/vcs-python/libvcs", + dir=pathlib.Path().cwd() / "my_repo", + remotes={ + 'gitlab': 'https://gitlab.com/vcs-python/libvcs' + } +) + +# Update / clone repo: +>>> repo.update_repo() + +# Get revision: +>>> repo.get_revision() +u'5c227e6ab4aab44bf097da2e088b0ff947370ab8' +``` + +## Pytest plugin + +libvcs also provides a test rig for local repositories. It automatically can provide clean local +repositories and working copies for git, svn, and mercurial. They are automatically cleaned up after +each test. + +It works by bootstrapping a temporary `$HOME` environment in a +[`TmpPathFactory`](https://docs.pytest.org/en/7.1.x/reference/reference.html#tmp-path-factory-factory-api) +for automatic cleanup. + +```python +import pathlib + +from libvcs.pytest_plugin import CreateProjectCallbackFixtureProtocol +from libvcs.sync.git import GitSync + + +def test_repo_git_remote_checkout( + create_git_remote_repo: CreateProjectCallbackFixtureProtocol, + tmp_path: pathlib.Path, + projects_path: pathlib.Path, +) -> None: + git_server = create_git_remote_repo() + git_repo_checkout_dir = projects_path / "my_git_checkout" + git_repo = GitSync(dir=str(git_repo_checkout_dir), url=f"file://{git_server!s}") + + git_repo.obtain() + git_repo.update_repo() + + assert git_repo.get_revision() == "initial" + + assert git_repo_checkout_dir.exists() + assert pathlib.Path(git_repo_checkout_dir / ".git").exists() +``` + +Learn more on the docs at https://libvcs.git-pull.com/pytest-plugin.html + +## Donations + +Your donations fund development of new features, testing and support. Your money will go directly to +maintenance and development of the project. If you are an individual, feel free to give whatever +feels right for the value you get out of the project. + +See donation options at <https://www.git-pull.com/support.html>. + +## More information + +- Python support: 3.9+, pypy +- VCS supported: git(1), svn(1), hg(1) +- Source: <https://github.com/vcs-python/libvcs> +- Docs: <https://libvcs.git-pull.com> +- Changelog: <https://libvcs.git-pull.com/history.html> +- APIs for git, hg, and svn: + - [`libvcs.url`](https://libvcs.git-pull.com/url/): URL Parser + - [`libvcs.cmd`](https://libvcs.git-pull.com/cmd/): Commands + - [`libvcs.sync`](https://libvcs.git-pull.com/sync/): Clone and update +- Issues: <https://github.com/vcs-python/libvcs/issues> +- Test Coverage: <https://codecov.io/gh/vcs-python/libvcs> +- pypi: <https://pypi.python.org/pypi/libvcs> +- Open Hub: <https://www.openhub.net/p/libvcs> +- License: [MIT](https://opensource.org/licenses/MIT). + +[](https://libvcs.git-pull.com/) +[](https://github.com/vcs-python/libvcs/actions?query=workflow%3A%22tests%22) + + + +%package help +Summary: Development documents and examples for libvcs +Provides: python3-libvcs-doc +%description help +# `libvcs` · [](https://pypi.org/project/libvcs/) [](https://github.com/vcs-python/libvcs/blob/master/LICENSE) [](https://codecov.io/gh/vcs-python/libvcs) + +libvcs is a lite, [typed](https://docs.python.org/3/library/typing.html), pythonic tool box for +detection and parsing of URLs, commanding, and syncing with `git`, `hg`, and `svn`. Powers +[vcspull](https://www.github.com/vcs-python/vcspull/). + +## Overview + +_Supports Python 3.9 and above_ + +Features for Git, Subversion, and Mercurial: + +- **Detect and parse** VCS URLs +- **Command** VCS via python API +- **Sync** repos locally +- **Test fixtures** for temporary local repos and working copies + +To **get started**, see the [quickstart](https://libvcs.git-pull.com/quickstart.html) for more. + +```console +$ pip install --user libvcs +``` + +## URL Parser + +You can validate and parse Git, Mercurial, and Subversion URLs through +[`libvcs.url`](https://libvcs.git-pull.com/url/index.html): + +Validate: + +```python +>>> from libvcs.url.git import GitURL + +>>> GitURL.is_valid(url='https://github.com/vcs-python/libvcs.git') +True +``` + +Parse and adjust a Git URL: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location +GitURL(url=git@github.com:vcs-python/libvcs.git, + user=git, + hostname=github.com, + path=vcs-python/libvcs, + suffix=.git, + rule=core-git-scp) +``` + +Switch repo libvcs -> vcspull: + +```python +>>> from libvcs.url.git import GitURL + +>>> git_location = GitURL(url='git@github.com:vcs-python/libvcs.git') + +>>> git_location.path = 'vcs-python/vcspull' + +>>> git_location.to_url() +'git@github.com:vcs-python/vcspull.git' + +# Switch them to gitlab: +>>> git_location.hostname = 'gitlab.com' + +# Export to a `git clone` compatible URL. +>>> git_location.to_url() +'git@gitlab.com:vcs-python/vcspull.git' +``` + +See more in the [parser document](https://libvcs.git-pull.com/parse/index.html). + +## Commands + +Simple [`subprocess`](https://docs.python.org/3/library/subprocess.html) wrappers around `git(1)`, +`hg(1)`, `svn(1)`. Here is [`Git`](https://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git) w/ +[`Git.clone`](http://libvcs.git-pull.com/cmd/git.html#libvcs.cmd.git.Git.clone): + +```python +import pathlib +from libvcs.cmd.git import Git + +git = Git(dir=pathlib.Path.cwd() / 'my_git_repo') +git.clone(url='https://github.com/vcs-python/libvcs.git') +``` + +## Sync + +Create a [`GitSync`](https://libvcs.git-pull.com/projects/git.html#libvcs.sync.git.GitProject) +object of the project to inspect / checkout / update: + +```python +import pathlib +from libvcs.sync.git import GitSync + +repo = GitSync( + url="https://github.com/vcs-python/libvcs", + dir=pathlib.Path().cwd() / "my_repo", + remotes={ + 'gitlab': 'https://gitlab.com/vcs-python/libvcs' + } +) + +# Update / clone repo: +>>> repo.update_repo() + +# Get revision: +>>> repo.get_revision() +u'5c227e6ab4aab44bf097da2e088b0ff947370ab8' +``` + +## Pytest plugin + +libvcs also provides a test rig for local repositories. It automatically can provide clean local +repositories and working copies for git, svn, and mercurial. They are automatically cleaned up after +each test. + +It works by bootstrapping a temporary `$HOME` environment in a +[`TmpPathFactory`](https://docs.pytest.org/en/7.1.x/reference/reference.html#tmp-path-factory-factory-api) +for automatic cleanup. + +```python +import pathlib + +from libvcs.pytest_plugin import CreateProjectCallbackFixtureProtocol +from libvcs.sync.git import GitSync + + +def test_repo_git_remote_checkout( + create_git_remote_repo: CreateProjectCallbackFixtureProtocol, + tmp_path: pathlib.Path, + projects_path: pathlib.Path, +) -> None: + git_server = create_git_remote_repo() + git_repo_checkout_dir = projects_path / "my_git_checkout" + git_repo = GitSync(dir=str(git_repo_checkout_dir), url=f"file://{git_server!s}") + + git_repo.obtain() + git_repo.update_repo() + + assert git_repo.get_revision() == "initial" + + assert git_repo_checkout_dir.exists() + assert pathlib.Path(git_repo_checkout_dir / ".git").exists() +``` + +Learn more on the docs at https://libvcs.git-pull.com/pytest-plugin.html + +## Donations + +Your donations fund development of new features, testing and support. Your money will go directly to +maintenance and development of the project. If you are an individual, feel free to give whatever +feels right for the value you get out of the project. + +See donation options at <https://www.git-pull.com/support.html>. + +## More information + +- Python support: 3.9+, pypy +- VCS supported: git(1), svn(1), hg(1) +- Source: <https://github.com/vcs-python/libvcs> +- Docs: <https://libvcs.git-pull.com> +- Changelog: <https://libvcs.git-pull.com/history.html> +- APIs for git, hg, and svn: + - [`libvcs.url`](https://libvcs.git-pull.com/url/): URL Parser + - [`libvcs.cmd`](https://libvcs.git-pull.com/cmd/): Commands + - [`libvcs.sync`](https://libvcs.git-pull.com/sync/): Clone and update +- Issues: <https://github.com/vcs-python/libvcs/issues> +- Test Coverage: <https://codecov.io/gh/vcs-python/libvcs> +- pypi: <https://pypi.python.org/pypi/libvcs> +- Open Hub: <https://www.openhub.net/p/libvcs> +- License: [MIT](https://opensource.org/licenses/MIT). + +[](https://libvcs.git-pull.com/) +[](https://github.com/vcs-python/libvcs/actions?query=workflow%3A%22tests%22) + + + +%prep +%autosetup -n libvcs-0.22.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-libvcs -f filelist.lst +%dir %{python3_sitelib}/* + +%files help -f doclist.lst +%{_docdir}/* + +%changelog +* Tue Jun 20 2023 Python_Bot <Python_Bot@openeuler.org> - 0.22.1-1 +- Package Spec generated @@ -0,0 +1 @@ +ba9c7f78323410cbbd84a584db944dc9 libvcs-0.22.1.tar.gz |