Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/sbdchd/codeowners

:honeybee: A Python library for codeowners files
https://github.com/sbdchd/codeowners

codeowners python

Last synced: 2 days ago
JSON representation

:honeybee: A Python library for codeowners files

Awesome Lists containing this project

README

        

# 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 [email protected]
# misc
/build/logs/ @dmin
docs/* [email protected]
"""

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
```