%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 * Sun Apr 23 2023 Python_Bot - 0.6.0-1 - Package Spec generated