Utility to set up sys.path for source-tree imports
Project description
Module for configuration of sys.path for local imports relative to the directory of the current script entry file.
Import of entrydir_pypath appends directories to the end of sys.path in accordance with files named ‘.pythonpath’. Such files are referred to as pythonpath files below. First, the directory of the script entry file (obtained by sys.argv[0]) and its parents are searched for pythonpath files. For interactive scripts and similar special cases, the current working directory is used as fallback. The pythonpath file in the closest parent directory is used to initiate the processing. If no such file is found, sys.path is left unaltered.
Each line in a pythonpath file is a directory path that may be absolute or relative. Directories that do not exist are ignored. Existing directories are added to sys.path if there is no pythonpath file in the directory. Otherwise, the entries in the found pythonpath file are processed in the same way as above, and recursion continues until no additional pythonpath files are found. To add a directory that contains a pythonpath file, the pythonpath file of that directory must list its own directory.
Setup
To install the package for the current user:
$ pip install --user entrydir_pypath
To import the package automatically from usercustomize during initialization:
$ entrydir-pypath-config -install
For deactivation of automatical import:
$ entrydir-pypath-config -remove
To uninstall the package:
$ pip uninstall entrydir_pypath
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for entrydir_pypath-0.1.0.dev3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4108a270f08805f56961c87a622c5ea34d3997c109727edcb1bf4d74bcc5300 |
|
MD5 | 32a581245f4bff3a653d070940a7e488 |
|
BLAKE2b-256 | 17a27f34cc993c4363821814671b5918b36f0ed699803fc65fcbd5c5491c4e3c |
Hashes for entrydir_pypath-0.1.0.dev3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b52cb7e5e00371cb82b7d242a58018acf6361acd048b148be4ed06d5340db081 |
|
MD5 | 601037d51e7194dc900beafe55556f07 |
|
BLAKE2b-256 | cb49c507e98996895c5026fe6dbd0d513b7bf5426a920efd40f49fd64b5b1863 |