Add IDE bindings for epidata development #1004
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Prerequisites:
dev
branchdev
Summary
Previously, most IDE features - autocompletion, linting, functioning imports - did not work in epidata due to the codebase's nonstandard structure (pulling code from multiple repos, then reordering them in the Docker container, so the compile-time structure does not match the imports at runtime).
This PR adds a solution that makes IDE development a lot less painful. The idea behind it is to use an "editable install", which is a minimalistic pip package that symlinks to a Python project such that any changes to the package's files are reflected in the dev environment and vice versa. To that end, it
adds
pyproject.toml
andsetup.cfg
files that define how our local package is laid outadds some code to the
install.sh
setup script that symlinks those files todriver/repos
adds instructions on using these to the
README
Caveats:
pip install -e . --config-settings editable_mode=strict
needs to be re-ran when any Python files are added or deleted locally. (But edits to existing files will be reflected in the editable install.)pyproject.toml
need to be updated whenever we add new packages and subfolders. This is due to the following limitation: