Automatically convert python absolute imports to relative.
Project description
relativize-imports
Automatically convert python absolute imports to relative.
Inspired and adapted from MarcoGorelli/absolufy-imports.
Installation
$ pip install relativize-imports
Usage as a pre-commit hook
See pre-commit for instructions
Sample .pre-commit-config.yaml
:
- repo: https://github.com/reallyliri/relativize-imports
rev: v0.0.4
hooks:
- id: relativize-imports
Command-line example
$ relativize-imports
$ relativize-imports mypackage/myfile.py
- from mypackage import __version__
+ from . import __version__
Build and Publish
rm -rf dist
python setup.py bdist_wheel
twine upload dist/*
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
Close
Hashes for relativize_imports-0.0.4-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 60162def5d84cdc8a93990632c78b14b46bc6015d9aaa5bafcaad52c099378bf |
|
MD5 | 6b38dd0b65d71df047ec9fd7e7d0f157 |
|
BLAKE2b-256 | 65cd0eb78c3a9b5317b7d74a9d82cf7a91b1a2b4cd40f724f3492927b3cadccb |