Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

entrydir_pypath-0.1.0.dev3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

entrydir_pypath-0.1.0.dev3-py2.py3-none-any.whl (7.4 kB view details)

Uploaded Python 2Python 3

File details

Details for the file entrydir_pypath-0.1.0.dev3.tar.gz.

File metadata

File hashes

Hashes for entrydir_pypath-0.1.0.dev3.tar.gz
Algorithm Hash digest
SHA256 c4108a270f08805f56961c87a622c5ea34d3997c109727edcb1bf4d74bcc5300
MD5 32a581245f4bff3a653d070940a7e488
BLAKE2b-256 17a27f34cc993c4363821814671b5918b36f0ed699803fc65fcbd5c5491c4e3c

See more details on using hashes here.

File details

Details for the file entrydir_pypath-0.1.0.dev3-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for entrydir_pypath-0.1.0.dev3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 b52cb7e5e00371cb82b7d242a58018acf6361acd048b148be4ed06d5340db081
MD5 601037d51e7194dc900beafe55556f07
BLAKE2b-256 cb49c507e98996895c5026fe6dbd0d513b7bf5426a920efd40f49fd64b5b1863

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page