Skip to content

Commit

Permalink
Merge pull request #589 from Opentrons/js_switch-to-yarn
Browse files Browse the repository at this point in the history
build(js): Switch to yarn
  • Loading branch information
mcous authored Jan 9, 2018
2 parents 409120d + b0dd5fb commit d85f924
Show file tree
Hide file tree
Showing 26 changed files with 11,822 additions and 49,462 deletions.
4 changes: 3 additions & 1 deletion protocol-designer/.flowconfig → .flowconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[ignore]
.*/test/.*
.*/dist/.*
.*/test/.*

[include]

Expand All @@ -8,6 +9,7 @@
[lints]

[options]
module.name_mapper='^default\-containers\.json$' -> '@opentrons/components/interfaces/default-containers.json.js'
module.name_mapper.extension='css' -> '@opentrons/components/interfaces/CSSModule.js'

[strict]
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,10 @@ matrix:
# More: https://docs.travis-ci.com/user/caching/
cache:
pip: true
yarn: true
directories:
- $HOME/.pyenv
- $HOME/.cache/brew
# location of npm cache - preferable to cache this rather than node_modules
# because we have one cache for all npm projects plus caching node_modules
# can cause issues with native deps
- $HOME/.npm

before_install:
- > # load keys needed to publish to pypa only when building from public repo
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ This Contributing Guide was influenced by a lot of work done on existing Contrib
* [Kibana Contributing Guide][kibana-contributing]

[repo]: https://github.com/Opentrons/opentrons
[easyfix]: https://github.com/OpenTrons/opentrons/issues?q=is%3Aopen+is%3Aissue+label%3Aeasyfix
[easyfix]: https://github.com/Opentrons/opentrons/issues?q=is%3Aopen+is%3Aissue+label%3Aeasyfix
[support]: https://support.opentrons.com/
[fork-and-pull]: https://blog.scottlowe.org/2015/01/27/using-fork-branch-git-workflow/
[how-to-write-pr]: https://github.com/blog/1943-how-to-write-the-perfect-pull-request
Expand Down
13 changes: 8 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,19 @@ APP_DIR := app
APP_SHELL_DIR := app-shell
PROTOCOL_DESIGNER_DIR := protocol-designer

.PHONY: install test coverage

# install project dependencies for both api and app
# front-end dependecies handled by yarn
# TODO(mc, 2018-01-06): remove separate install for app-shell when
# electron-builder can resolve yarn workspace deps
# https://github.com/electron-userland/electron-builder/issues/2222
.PHONY: install
install:
$(MAKE) -C $(API_DIR) install
$(MAKE) -C $(COMPONENTS_DIR) install
yarn
$(MAKE) -C $(APP_SHELL_DIR) install
$(MAKE) -C $(APP_DIR) install
$(MAKE) -C $(PROTOCOL_DESIGNER_DIR) install

# run api and app tests
.PHONY: test
test:
$(MAKE) -C $(API_DIR) test
$(MAKE) -C $(COMPONENTS_DIR) test
Expand All @@ -30,5 +32,6 @@ test:
# uses codecov's bash upload script
# TODO(mc, 2018-08-28): add test as a task dependency once travis is setup to
# use this Makefile for tests
.PHONY: coverage
coverage:
$(SHELL) <(curl -s https://codecov.io/bash) -X coveragepy
104 changes: 59 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@
[![AppVeyor][appveyor-badge]][appveyor]
[![Codecov][codecov-badge]][codecov]

* [Overview](#overview)
* [Opentrons API](#opentrons-api)
* [Opentrons App](#opentrons-app)
* [Contributing/Building](#contributing)
* [Overview](#overview)
* [Opentrons API](#opentrons-api)
* [Opentrons App](#opentrons-app)
* [Contributing/Building](#contributing)

## Overview

Opentrons makes robots for biologists.
Opentrons makes robots for biologists.

Our mission is to provide the scientific community with a common platform to easily share protocols and reproduce each other's work. Our robots automate experiments that would otherwise be done by hand, allowing our users to spend more time pursuing answers to the 21st century’s most important questions, and less time pipetting.

This repository contains the source code for the Opentrons API and OT App. We'd love for you to to explore, hack, and build upon them!
This repository contains the source code for the Opentrons API and OT App. We'd love for you to to explore, hack, and build upon them!

## Opentrons API

Expand All @@ -29,87 +29,97 @@ pipette.aspirate(tube_1).dispense(tube_2)

That is how you tell the Opentrons robot to pipette its max volume from one tube to another. Learn more here:

* [Documentation](http://docs.opentrons.com)
* [Source code](https://github.com/OpenTrons/opentrons/tree/develop/api)
* [Documentation](http://docs.opentrons.com)
* [Source code](https://github.com/Opentrons/opentrons/tree/v3a/api)

## Opentrons App

Easily upload a protocol, calibrate positions, and run your experiment from your computer.

* [Documentation](https://support.opentrons.com/)
* [Source code](https://github.com/OpenTrons/opentrons/tree/develop/app)
* [Documentation](https://support.opentrons.com/)
* [Source code](https://github.com/Opentrons/opentrons/tree/v3a/app)

![ot-app](https://lh3.googleusercontent.com/hz80NB3yiMB6r50aKg9DgSuqmwNAEKFz7aC3qQS56YregCGygg1oc3ldn9FAanqTt7REUXikkSuHDX69JODaLWgegDwO_JnDf30j3NuZ05mWOq16nMTxQBAFW6cZqqEsLaDU-uRW)

## Contributing

We love contributors! Here is the best way to work with us:

1. Filing a [bug report](https://github.com/OpenTrons/opentrons/issues). We will fix these as quickly as we can, and appreciate your help uncovering bugs in our code.
1. Filing a [bug report](https://github.com/Opentrons/opentrons/issues). We will fix these as quickly as we can, and appreciate your help uncovering bugs in our code.

2. Submit a pull request with any new features you've added to a branch of the API or App. We will reach out to talk with you about integration testing and launcing it into our product!
2. Submit a pull request with any new features you've added to a branch of the API or App. We will reach out to talk with you about integration testing and launching it into our product!

For more information, please read [the contributing guide][contributing].

### Using BETA versions

If you want to build the platform and play with the latest development version we are working on before it is launched, here are the steps:

### Set up your development environment

* macOS 10.11+, Linux, or Windows 10 with Cygwin
* Python 3.5.3 ([pyenv](https://github.com/pyenv/pyenv) is optional, but recommended)

``` shell
# pyenv on macOS: install with shared framework option
$ env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.5.3
Your computer will need the following tools installed to be able to develop with the Opentrons platform:

# pyenv on Linux: install with shared library option
$ env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.3
```
* macOS 10.11+, Linux, or Windows 10 with Cygwin
* Python 3.5.3 - [pyenv](https://github.com/pyenv/pyenv) is optional, but recommended

* Node v8 LTS (Carbon) ([nvm](https://github.com/creationix/nvm) is optional, but recommended)
``` shell
# pyenv on macOS: install with shared framework option
env PYTHON_CONFIGURE_OPTS="--enable-framework" pyenv install 3.5.3

```shell
# nvm on macOS and Linux
# installs version from .nvmrc ("8")
$ nvm install && nvm use
```
# pyenv on Linux: install with shared library option
env PYTHON_CONFIGURE_OPTS="--enable-shared" pyenv install 3.5.3
```

* GNU Make: both the API and app manage their builds with [Makefiles](https://en.wikipedia.org/wiki/Makefile)
* Node v8 LTS (Carbon) - [nvm][] is optional, but recommended

### Start the Opentrons API
```shell
# nvm on macOS and Linux
# installs version from .nvmrc ("8")
nvm install && nvm use
```

* [yarn][yarn-install] - JavaScript package manager

* GNU Make - we use [Makefiles][] to manage our builds

Once you're set up, clone the repository, install all project dependencies, and run the tests to get started:
Clone the repository to get started.
```shell
$ git clone https://github.com/OpenTrons/opentrons.git
git clone https://github.com/Opentrons/opentrons.git
cd opentrons
make install
make test
```
### Start the Opentrons API
To run the Opentrons API in development mode:
Install the dependencies and API itself.
```shell
# change into the API directory
$ cd api
# install dependencies
$ make install
# verify API is working by printing the version
python -c 'import opentrons; print(opentrons.__version__)'
# verify
$ python -c 'import opentrons; print(opentrons.__version__)' # > prints version
# run API with virtual robot
ENABLE_VIRTUAL_SMOOTHIE=true make dev
# run API with robot's motor driver connected via USB to UART cable
make dev
```

# push API to a USB connected robot
$ make push
You may also test and lint the API code:

# run with a virtual robot
$ ENABLE_VIRTUAL_SMOOTHIE=true make dev
```shell
make test
```

You may also test, lint, and build the API exectutable:
If you'd like to test your code on a real robot, you can push and run your current API code to that robot with:

```shell
# test and lint the code
$ make test

# build the API executable
$ make exe
make push
```

### Start the Opentrons App
Expand All @@ -124,4 +134,8 @@ Enjoy!
[appveyor-badge]: https://img.shields.io/appveyor/ci/Opentrons/opentrons/v3a.svg?style=flat-square&maxAge=3600&label=windows%20build
[codecov]: https://codecov.io/gh/Opentrons/opentrons/branches
[codecov-badge]: https://img.shields.io/codecov/c/github/Opentrons/opentrons/v3a.svg?style=flat-square&maxAge=3600
[contributing]: ./CONTRIBUTING.md
[app-readme]: ./app/README.md
[makefiles]: https://en.wikipedia.org/wiki/Makefile
[nvm]: https://github.com/creationix/nvm
[yarn-install]: https://yarnpkg.com/en/docs/install
13 changes: 9 additions & 4 deletions api/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,31 @@

SHELL := /bin/bash

.PHONY: test docs publish clean install exe dev push

.PHONY: install
install:
pip install -r requirements.txt && pip install -e .

.PHONY: test
test:
python -m pytest \
--cov=opentrons \
--cov-report term-missing:skip-covered \
--cov-report xml:coverage.xml \
tests

.PHONY: lint
lint:
python -m pylama opentrons tests

.PHONY: docs
docs:
cd docs && make html && make doctest

.PHONY: publish
publish:
cd scripts && publish.sh && doc-deploy.sh

.PHONY: dev
dev:
python opentrons/server/main.py -P 31950

Expand All @@ -34,13 +38,14 @@ dist/update.base64: clean
base64 -i /tmp/update | sed -e "s/.\{50\}/&\n/g" >> dist/update.base64 && \
echo -e "\n---OT UPDATE END---" >> dist/update.base64

.PHONY: push
push: dist/update.base64
curl -F 'data=@dist/update.base64' http://\[fd00:0:cafe:fefe::1\]/upload

.PHONY: term
term:
ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@fd00:0:cafe:fefe::1


########## [START] RESIN DEVICE ##########

.PHONY: info_device
Expand All @@ -65,7 +70,7 @@ ssh_device:

########## [END] RESIN DEVICE ##########


.PHONY: clean
clean:
rm -rf \
__pycache__ \
Expand Down
2 changes: 1 addition & 1 deletion api/docs/updating_firmware.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To summarize, there are two files on your Smoothie that must be replaced; `FIRMW
##Step 1
###Download Files

[Download the zipped files from here](https://github.com/OpenTrons/smoothie-config/archive/1.2.0.zip). After downloading, unpack the zip file to view its contents.
[Download the zipped files from here](https://github.com/Opentrons/smoothie-config/archive/1.2.0.zip). After downloading, unpack the zip file to view its contents.

##Step 2
###Open the Smoothie's Drive
Expand Down
2 changes: 1 addition & 1 deletion app-shell/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ all: clean package

.PHONY: install
install:
npm install
yarn

.PHONY: uninstall
uninstall:
Expand Down
Loading

0 comments on commit d85f924

Please sign in to comment.