Skip to content

broadinstitute/python-standard-bits

python-standard-bits

This is a collection of standard files that are typically needed for most Python-related repositories. Not all files in this repository may be needed for every Python project, but it's a good collection of common tools and configurations to which you can refer.

Files

This is a just brief overview of the files.

.gitignore

This is a sample .gitignore that just ignores all files. This is primarily here as a protection for this repository so that files need to be added to the repository forcefully using -f. A normal repository will have a far less restrictive .gitignore.

.pre-commit-config.yaml

This is a config for pre-commit, which is a library to control pre-commit hooks for Git. These are just the standard ones BITS uses in Python repositories.

.pylintrc

This is the BITS standard configuration file for the pylint Python linting application.

.travis.yml

This is a sample TravisCI configuration file that can be used to run TravisCI jobs for commits to your repository for unit tests, linting, etc. It currently supports:

  • Python versions 2.7, 3.4, 3.5, and 3.6
  • Pip package installation using pipenv
  • Unit tests using green
  • A pre-flight stage that runs yamllint and pylama on the whole codebase

.yamllint

This is the BITS standard configuration file for the yamllint YAML linting application.

Dockerfile

This is a sample Dockerfile that can be used to create a Python container for use as a development environment for whatever Python]1 configuration you wish to use. By default, it uses Python 3.6 and pipenv to install packages.

LICENSE.txt

The default license approved for use at the Broad Institute (BSD 3-Clause "New" or "Revised" License).

Pipfile

The file used by pipenv to install PyPi packages. This is a default list and is meant as a base configuration for your project. Obviously, more packages will probably be needed depending on the project.

dev.sh

This is a simple script that starts up or builds a development environment in Docker. The way it works is it looks for an image by the name specified at the top of the script. If that image doesn't exist, it uses the Dockerfile in the local directory to build the image. You are then dropped into a bash shell inside that container under the /usr/src path. The present working directory outside the container is volume mapped to /usr/src inside the container as well.

pylama.ini

This is the BITS standard configuration file for the pylama Python linting application.

VS Code

If you use workspaces in VS Code, you can clone this repository in the base directory of your workspace. You can then use pipenv to install the packages listed in the Pipfile. You will need to make sure pipenv installs into a .venv directory under the workspace directory. To do this, you can run pipenv as follows:

PIPENV_VENV_IN_PROJECT=1 pipenv lock
PIPENV_VENV_IN_PROJECT=1 pipenv install --dev

The PIPENV_VENV_IN_PROJECT=1 environment variable setting makes sure that the virtual environment is stored in the local project directory instead of a different temporary directory pipenv typically uses.

About

The standard Python setup for BITS

Resources

License

BSD-3-Clause, BSD-3-Clause licenses found

Licenses found

BSD-3-Clause
LICENSE
BSD-3-Clause
LICENSE.txt

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •