summaryrefslogtreecommitdiff
path: root/python-codeowners.spec
diff options
context:
space:
mode:
authorCoprDistGit <infra@openeuler.org>2023-04-11 08:35:14 +0000
committerCoprDistGit <infra@openeuler.org>2023-04-11 08:35:14 +0000
commitd9542050b52713be4aaebc91add38caf4efbedcd (patch)
tree4d651e7d4619c3ca78ffcfd8244edf5454b1b7d0 /python-codeowners.spec
parenta9243dc467b4ea95805ac3fed0eb10bd3428958a (diff)
automatic import of python-codeowners
Diffstat (limited to 'python-codeowners.spec')
-rw-r--r--python-codeowners.spec256
1 files changed, 256 insertions, 0 deletions
diff --git a/python-codeowners.spec b/python-codeowners.spec
new file mode 100644
index 0000000..8ad16b7
--- /dev/null
+++ b/python-codeowners.spec
@@ -0,0 +1,256 @@
+%global _empty_manifest_terminate_build 0
+Name: python-codeowners
+Version: 0.6.0
+Release: 1
+Summary: Codeowners parser for Python
+License: MIT
+URL: https://github.com/sbdchd/codeowners
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/61/34/ac42704f4895c7760e7b77afe787e2df48d7caa02c5eed50ac10fe2c68e8/codeowners-0.6.0.tar.gz
+BuildArch: noarch
+
+Requires: python3-typing_extensions
+
+%description
+# codeowners [![CircleCI](https://circleci.com/gh/sbdchd/codeowners.svg?style=svg)](https://circleci.com/gh/sbdchd/codeowners) [![pypi](https://img.shields.io/pypi/v/codeowners.svg)](https://pypi.org/project/codeowners/)
+
+> Python codeowners parser based on [softprops's Rust
+> library](https://crates.io/crates/codeowners) and [hmarr's Go
+> library](https://github.com/hmarr/codeowners/).
+
+## Why?
+
+To allow Python users to parse [codeowners
+files](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax)
+in Python.
+
+## Install
+
+```shell
+pip install codeowners
+```
+
+## Usage
+
+```python
+from codeowners import CodeOwners
+
+example_file = """\
+# owners for js files
+*.js @ghost
+# python
+*.py user@example.com
+# misc
+/build/logs/ @dmin
+docs/* docs@example.com
+"""
+
+owners = CodeOwners(example_file)
+assert owners.of("test.js") == [('USERNAME', '@ghost')]
+```
+
+## Dev
+
+```shell
+poetry install
+
+s/test
+
+s/lint
+```
+
+## Releasing a New Version
+
+```shell
+# bump version in pyproject.toml
+
+# update CHANGELOG.md
+
+# commit release commit to GitHub
+
+# build and publish
+poetry publish --build
+
+# create a release in the GitHub UI
+```
+
+
+%package -n python3-codeowners
+Summary: Codeowners parser for Python
+Provides: python-codeowners
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-codeowners
+# codeowners [![CircleCI](https://circleci.com/gh/sbdchd/codeowners.svg?style=svg)](https://circleci.com/gh/sbdchd/codeowners) [![pypi](https://img.shields.io/pypi/v/codeowners.svg)](https://pypi.org/project/codeowners/)
+
+> Python codeowners parser based on [softprops's Rust
+> library](https://crates.io/crates/codeowners) and [hmarr's Go
+> library](https://github.com/hmarr/codeowners/).
+
+## Why?
+
+To allow Python users to parse [codeowners
+files](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax)
+in Python.
+
+## Install
+
+```shell
+pip install codeowners
+```
+
+## Usage
+
+```python
+from codeowners import CodeOwners
+
+example_file = """\
+# owners for js files
+*.js @ghost
+# python
+*.py user@example.com
+# misc
+/build/logs/ @dmin
+docs/* docs@example.com
+"""
+
+owners = CodeOwners(example_file)
+assert owners.of("test.js") == [('USERNAME', '@ghost')]
+```
+
+## Dev
+
+```shell
+poetry install
+
+s/test
+
+s/lint
+```
+
+## Releasing a New Version
+
+```shell
+# bump version in pyproject.toml
+
+# update CHANGELOG.md
+
+# commit release commit to GitHub
+
+# build and publish
+poetry publish --build
+
+# create a release in the GitHub UI
+```
+
+
+%package help
+Summary: Development documents and examples for codeowners
+Provides: python3-codeowners-doc
+%description help
+# codeowners [![CircleCI](https://circleci.com/gh/sbdchd/codeowners.svg?style=svg)](https://circleci.com/gh/sbdchd/codeowners) [![pypi](https://img.shields.io/pypi/v/codeowners.svg)](https://pypi.org/project/codeowners/)
+
+> Python codeowners parser based on [softprops's Rust
+> library](https://crates.io/crates/codeowners) and [hmarr's Go
+> library](https://github.com/hmarr/codeowners/).
+
+## Why?
+
+To allow Python users to parse [codeowners
+files](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/about-code-owners#codeowners-syntax)
+in Python.
+
+## Install
+
+```shell
+pip install codeowners
+```
+
+## Usage
+
+```python
+from codeowners import CodeOwners
+
+example_file = """\
+# owners for js files
+*.js @ghost
+# python
+*.py user@example.com
+# misc
+/build/logs/ @dmin
+docs/* docs@example.com
+"""
+
+owners = CodeOwners(example_file)
+assert owners.of("test.js") == [('USERNAME', '@ghost')]
+```
+
+## Dev
+
+```shell
+poetry install
+
+s/test
+
+s/lint
+```
+
+## Releasing a New Version
+
+```shell
+# bump version in pyproject.toml
+
+# update CHANGELOG.md
+
+# commit release commit to GitHub
+
+# build and publish
+poetry publish --build
+
+# create a release in the GitHub UI
+```
+
+
+%prep
+%autosetup -n codeowners-0.6.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-codeowners -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Tue Apr 11 2023 Python_Bot <Python_Bot@openeuler.org> - 0.6.0-1
+- Package Spec generated