Skip to main content

The SolveBio Dash components suite

Project description

solvebio-dash-components

This package provides the React component suite for SolveBio-specific Dash components

Development

Setup

# Install JavaScript dependencies
$ npm install

# Create Python 2 virtual environment and install Python dependencies
$ pipenv --two install --dev

# Enter virtual environment
$ pipenv shell

Add the following line to your Dash app

app.scripts.config.serve_locally = True

Components

To install the SolveBio Dash components locally, simply clone the repo to the root folder of your Dash app

$ git clone https://github.com/solvebio/solvebio-dash-components.git

Then cd into the directory and follow the above setup process.

In addition, add the following lines to your Dash app

sys.path.insert(0, 'solvebio-dash-components')
import solvebio_dash_components as sdc

DashS3Uploader

A working example of the DashS3Uploader component can be launched with the following:

$ python usage.py
$ open http://local.solvebio.com:8050

One thing to note about the DashS3Uploader is that when run locally, it must be run on local.solvebio.com for proper function. This is because the CORS configurations have been set on the server side so as to only allow S3 uploading specifically from the above address.

Code quality and tests

To run lint and unit tests:

$ npm test

To run unit tests and watch for changes:

$ npm run test-watch

To run a specific test

In your test, append .only to a describe or it statement:

describe.only('Foo component', () => {
    // ...
});

Testing your components in Dash

  1. Build development bundle to lib/ and watch for changes

     # Once this is started, you can just leave it running.
     $ npm start
    
  2. Install module locally (after every change)

     # Generate metadata, and build the JavaScript bundle
     $ npm run install-local
    
     # Now you're done. For subsequent changes, if you've got `npm start`
     # running in a separate process, it's enough to just do:
     $ python setup.py install
    
  3. Run Dash file containing your component

     $ python usage.py
    

Installing Python package locally

Before publishing to PyPi, you can test installing the module locally:

# Install in `site-packages` on your machine
$ npm run install-local

Uninstalling Python package locally

$ npm run uninstall-local

Publishing

Currently, separate steps must be taken to publish to NPM and PyPi as this project is based on the dash-components-archetype. There is ongoing work to simplify the publishing steps into one workflow here.

  1. Publish to NPM

     # Prepublish
     $ npm run prepublish
    
     # Bump the package version
     $ vim package.json
     
     # Create new tag
     $ git tag -a vx.x.x -m "tag message"
    
     # Push branch and tags to repo
     $ git push origin --tags
    
     # Publish to NPM
     $ npm publish
    
  2. Publish to PyPi

     # Bump the PyPi package to the same version
     $ vim solvebio_dash_components/version.py
    
     # Commit to github
     $ git add solvebio_dash_components/version.py
     $ git commit -m "Bump pypi package version to vx.x.x"
     
     # Create new dist
     $ python setup.py sdist
    
     # Publish to PyPi using
     $ twine upload dist/*
    

Builder / Archetype

We use Builder to centrally manage build configuration, dependencies, and scripts.

To see all builder scripts available:

$ builder help

See the dash-components-archetype repo for more information.

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

solvebio_dash_components-0.2.11.tar.gz (1.1 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

solvebio_dash_components-0.2.11-py2.7.egg (1.4 MB view details)

Uploaded Egg

File details

Details for the file solvebio_dash_components-0.2.11.tar.gz.

File metadata

File hashes

Hashes for solvebio_dash_components-0.2.11.tar.gz
Algorithm Hash digest
SHA256 7e74f5432795bb5bd72993955e9f28c92632f1d68e7a8e143c08f550b89fac06
MD5 67896491f0b7b62123929920ed929407
BLAKE2b-256 e242bd5dbb6d9aac150bd975deae8b4c46773061046d66106def00bbaed708da

See more details on using hashes here.

File details

Details for the file solvebio_dash_components-0.2.11-py2.7.egg.

File metadata

  • Download URL: solvebio_dash_components-0.2.11-py2.7.egg
  • Upload date:
  • Size: 1.4 MB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.2.0 requests-toolbelt/0.8.0 tqdm/4.19.6 CPython/2.7.10

File hashes

Hashes for solvebio_dash_components-0.2.11-py2.7.egg
Algorithm Hash digest
SHA256 85099a2a667389946d141193b8f6ba99ef9812787bc9cefd189123fc7b6c0c79
MD5 2595184db45954b8b3786fc0c77dc408
BLAKE2b-256 48ed700a3136423dc93e2979ea839a31a8ad35bd387d2fdc9ff18d1eb58a1efe

See more details on using hashes here.

Supported by

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