From d9542050b52713be4aaebc91add38caf4efbedcd Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Tue, 11 Apr 2023 08:35:14 +0000 Subject: automatic import of python-codeowners --- .gitignore | 1 + python-codeowners.spec | 256 +++++++++++++++++++++++++++++++++++++++++++++++++ sources | 1 + 3 files changed, 258 insertions(+) create mode 100644 python-codeowners.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..4a7716f 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/codeowners-0.6.0.tar.gz 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 - 0.6.0-1 +- Package Spec generated diff --git a/sources b/sources new file mode 100644 index 0000000..6963092 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +0fe112eb5cfd0fc5ca02c573f26379ed codeowners-0.6.0.tar.gz -- cgit v1.2.3