The SolveBio Dash components suite
Project description
# solvebio-dash-components
This package provides the React component suite for SolveBio-specific Dash components
## Development
### Setup
```sh
# 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
```sh
$ 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:
```sh
$ 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:
```sh
$ npm test
```
#### To run unit tests and watch for changes:
```sh
$ npm run test-watch
```
#### To run a specific test
In your test, append `.only` to a `describe` or `it` statement:
```javascript
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:
```sh
# Install in `site-packages` on your machine
$ npm run install-local
```
## Uninstalling Python package locally
```sh
$ npm run uninstall-local
```
## Publishing
Currently, multiple 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](https://github.com/plotly/dash-components-archetype/issues/5).
1. Preparing to publish to NPM
# Bump the package version
$ npm version major|minor|patch
# Push branch and tags to repo
$ git push --follow-tags
2. Preparing to publish to PyPi
# Bump the PyPi package to the same version
$ vi 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"
3. Publish to npm and PyPi
$ npm run publish-all
## Builder / Archetype
We use [Builder][] to centrally manage build configuration, dependencies, and
scripts.
To see all `builder` scripts available:
```sh
$ builder help
```
See the [dash-components-archetype][] repo for more information.
[Builder]: https://github.com/FormidableLabs/builder
[Dash]: https://plot.ly/dash
[NPM package authors]: https://www.npmjs.com/package/dash-core-components/access
[PyPi]: https://pypi.python.org/pypi
[dash-components-archetype]: https://github.com/plotly/dash-components-archetype
This package provides the React component suite for SolveBio-specific Dash components
## Development
### Setup
```sh
# 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
```sh
$ 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:
```sh
$ 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:
```sh
$ npm test
```
#### To run unit tests and watch for changes:
```sh
$ npm run test-watch
```
#### To run a specific test
In your test, append `.only` to a `describe` or `it` statement:
```javascript
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:
```sh
# Install in `site-packages` on your machine
$ npm run install-local
```
## Uninstalling Python package locally
```sh
$ npm run uninstall-local
```
## Publishing
Currently, multiple 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](https://github.com/plotly/dash-components-archetype/issues/5).
1. Preparing to publish to NPM
# Bump the package version
$ npm version major|minor|patch
# Push branch and tags to repo
$ git push --follow-tags
2. Preparing to publish to PyPi
# Bump the PyPi package to the same version
$ vi 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"
3. Publish to npm and PyPi
$ npm run publish-all
## Builder / Archetype
We use [Builder][] to centrally manage build configuration, dependencies, and
scripts.
To see all `builder` scripts available:
```sh
$ builder help
```
See the [dash-components-archetype][] repo for more information.
[Builder]: https://github.com/FormidableLabs/builder
[Dash]: https://plot.ly/dash
[NPM package authors]: https://www.npmjs.com/package/dash-core-components/access
[PyPi]: https://pypi.python.org/pypi
[dash-components-archetype]: https://github.com/plotly/dash-components-archetype
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
Close
Hashes for solvebio_dash_components-0.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9b828fd90ead91ab7ad3214e40fee12f04b93c3797a6cf0d44128469372d6bf0 |
|
MD5 | 7e932e9706633fe2102e3108b862ed52 |
|
BLAKE2b-256 | 920f4bc40521ddfb0a7742d8bc2c4e4ecda96cce6f26c96b8ce5e48d1ae39734 |
Close
Hashes for solvebio_dash_components-0.0.1-py2.7.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | f21fd87920840c1ddb6c7e93acf3d833571a5a7dd1b7c022e628c2cd346a6e1a |
|
MD5 | 03c03c819eaaff9b11dd3bc825403f02 |
|
BLAKE2b-256 | a02c4bd05087b504457387b40487c946dee905c0d106200342e024e62e387f5b |