Metadata-Version: 2.1
Name: abs-imports
Version: 0.1.2
Summary: A tool to automatically replace string literals in type annotations.
Home-page: https://github.com/MarcoGorelli/abs-imports
Author: Marco Gorelli
License: MIT
Platform: UNKNOWN
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Requires-Python: >=3.6.1
Description-Content-Type: text/markdown

[![Build Status](https://github.com/MarcoGorelli/abs-imports/workflows/tox/badge.svg)](https://github.com/MarcoGorelli/abs-imports/actions?workflow=tox)
[![Coverage](https://codecov.io/gh/MarcoGorelli/abs-imports/branch/main/graph/badge.svg)](https://codecov.io/gh/MarcoGorelli/abs-imports)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/MarcoGorelli/abs-imports/main.svg)](https://results.pre-commit.ci/latest/github/MarcoGorelli/abs-imports/main)

abs-imports
===========

A pre-commit hook to automatically convert relative imports to absolute.

## Installation

```
pip install abs-imports
```

## Usage as a pre-commit hook

See [pre-commit](https://github.com/pre-commit/pre-commit) for instructions

Sample `.pre-commit-config.yaml`:

```yaml
-   repo: https://github.com/MarcoGorelli/abs-imports
    rev: v0.1.2
    hooks:
    -   id: abs-imports
```

## Command-line example

```console
$ cat mypackage/myfile.py
from . import __version__
$ abs_imports mypackage/myfile.py
$ cat mypackage/myfile.py
from mypackage import __version__
```

## See also

Check out [pyupgrade](https://github.com/asottile/pyupgrade), which I learned a lot from when writing this.


