Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up build scripts and imports #563

Merged
merged 8 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ jobs:
password: $DASH_PAT_DOCKERHUB
steps:
- checkout
- run: echo $PYTHON_VERSION > ver.txt
- restore_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements.txt" }}
- run:
name: 🐍 pip dev requirements
command: |
sudo pip install virtualenv --upgrade
python -m venv venv || virtualenv venv && . venv/bin/activate
pip install --progress-bar off --no-cache-dir -r requirements.txt
- save_cache:
key: dep-{{ checksum ".circleci/config.yml" }}-{{ checksum "ver.txt" }}-{{ checksum "requirements.txt" }}
paths:
- venv
- run:
name: Check current version of node
command: node -v
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
### Fixed
* [#561](https://github.com/plotly/dash-bio/pull/561) Repeated re-rendering of the Molecule3dViewer component caused the viewer zoom to decrease multiplicatively.
This fix also exposes the `zoom` and `zoomTo` props for this component.
### Changed
- [#562](https://github.com/plotly/dash-bio/pull/562) Changed package scripts to 3 main build scripts: `build:js`, `build:backends`, and `build` to combined them. This brings the dash-bio build process in-line with the process for other Dash component libraries. As part of this change, `__init__.py` now also uses relative imports to load components (for more info, see [#534](https://github.com/plotly/dash-bio/issues/534)).

### Added
* [#563](https://github.com/plotly/dash-bio/pull/563) Added component generation support for Dash Julia.
Expand Down
17 changes: 4 additions & 13 deletions dash_bio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,8 @@
package_name = package['name'].replace(' ', '_').replace('-', '_')
__version__ = package['version']

_current_path = _os.path.dirname(_os.path.abspath(__file__))
_components = _dash.development.component_loader.load_components(
_os.path.join(_current_path, 'metadata.json'),
package_name
)

_this_module = _sys.modules[__name__]
from ._imports_ import * # noqa: F401, F403, E402
from ._imports_ import __all__ # noqa: E402

async_resources = [
'alignment',
Expand Down Expand Up @@ -112,10 +107,6 @@
]
)

_css_dist = []


for _component in _components:
setattr(_this_module, _component.__name__, _component)
setattr(_component, '_js_dist', _js_dist)
setattr(_component, '_css_dist', _css_dist)
for _component in __all__:
setattr(locals()[_component], "_js_dist", _js_dist)
2 changes: 1 addition & 1 deletion dash_bio/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dash_bio/bundle.js.map

Large diffs are not rendered by default.

12 changes: 4 additions & 8 deletions dash_bio/package-info.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
"lint": "eslint src --fix",
"test": "npm run lint:test && npm run format:test && npm run test-unit",
"test-unit": "jest",
"build:js-dev": "webpack --mode development",
"build:js": "npm run lint && npm run format && webpack --mode production",
"build:py": "node ./extract-meta src/lib/components > dash_bio/metadata.json && python get_version_info.py && python -c \"import dash; dash.development.component_loader.generate_classes('dash_bio', 'dash_bio/metadata.json')\"",
"build:r": "dash-generate-components ./src/lib/components dash_bio -p package-info.json --r-prefix='dashbio' --r-imports='dash' --r-depends='manhattanly'",
"build": "npm run build:js && npm run build:py",
"build:all": "npm run build && npm run build:r",
"postbuild": "es-check es5 dash_bio/*.js",
"build:dev": "npm run build:js-dev && npm run build:py"
"build:backends": "dash-generate-components ./src/lib/components dash_bio -p package-info.json --r-prefix='dashbio' --r-imports='dash' --r-depends='manhattanly'",
"build": "npm run build:js && npm run build:backends",
"postbuild": "es-check es5 dash_bio/*.js"
},
"author": "The Plotly Team <dashbio@plotly.com>",
"maintainer": "Ryan Patrick Kyle <ryan@plotly.com>",
"maintainer": "Hammad Khan <hammadkhan@plot.ly>",
"license": "MIT",
"dependencies": {
"circos": "git+https://github.com/plotly/circosJS.git#matthewchan15-zoom-pan-svg",
Expand Down
2 changes: 1 addition & 1 deletion inst/deps/bundle.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion inst/deps/bundle.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion man/dashBio-package.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
A suite of components that makes it simpler to analyze and visualize bioinformatics data and interact with them in a Dash application.
}
\author{
\strong{Maintainer}: Ryan Patrick Kyle <ryan@plotly.com>
\strong{Maintainer}: Hammad Khan <hammadkhan@plot.ly>
}
12 changes: 4 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,13 @@
"lint": "eslint src --fix",
"test": "npm run lint:test && npm run format:test && npm run test-unit",
"test-unit": "jest",
"build:js-dev": "webpack --mode development",
"build:js": "npm run lint && npm run format && webpack --mode production",
"build:py": "node ./extract-meta src/lib/components > dash_bio/metadata.json && python get_version_info.py && python -c \"import dash; dash.development.component_loader.generate_classes('dash_bio', 'dash_bio/metadata.json')\"",
"build:r": "dash-generate-components ./src/lib/components dash_bio -p package-info.json --r-prefix='dashbio' --r-imports='dash' --r-depends='manhattanly'",
"build": "npm run build:js && npm run build:py",
"build:all": "npm run build && npm run build:r",
"postbuild": "es-check es5 dash_bio/*.js",
"build:dev": "npm run build:js-dev && npm run build:py"
"build:backends": "dash-generate-components ./src/lib/components dash_bio -p package-info.json --r-prefix='dashbio' --r-imports='dash' --r-depends='manhattanly'",
"build": "npm run build:js && npm run build:backends",
"postbuild": "es-check es5 dash_bio/*.js"
},
"author": "The Plotly Team <dashbio@plotly.com>",
"maintainer": "Ryan Patrick Kyle <ryan@plotly.com>",
"maintainer": "Hammad Khan <hammadkhan@plot.ly>",
"license": "MIT",
"dependencies": {
"circos": "git+https://github.com/plotly/circosJS.git#matthewchan15-zoom-pan-svg",
Expand Down
5 changes: 3 additions & 2 deletions tests/integration/test_pileup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import os
import re

from common_features import simple_app_layout
from common_features import simple_app_layout, generate_identifier

_COMPONENT_ID = 'mypileup'

Expand Down Expand Up @@ -92,7 +92,8 @@ def test_dbpu001_reference(dash_duo):
assert _GEAR_ICON in tracks[0].text

# Take a Percy snapshot to check that tracks are rendered correctly
dash_duo.percy_snapshot('test-pileup_reference', convert_canvases=True)
dash_duo.percy_snapshot('test-pileup_reference' + generate_identifier(),
convert_canvases=True)

# Check that feature track loaded
tracks = dash_duo.find_elements('.features')
Expand Down