-
Notifications
You must be signed in to change notification settings - Fork 262
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #189 from gopherdata/go1.11module
Go 1.11 module support
- Loading branch information
Showing
965 changed files
with
146 additions
and
332,961 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,23 +40,41 @@ | |
|
||
### Prerequisites | ||
|
||
- [Go 1.9+](https://golang.org/doc/install) - including GOPATH/bin added to your PATH (i.e., you can run Go binaries that you `go install`). | ||
- [Go 1.11+](https://golang.org/doc/install) - including GOPATH/bin added to your PATH (i.e., you can run Go binaries that you `go install`). | ||
- [Jupyter Notebook](http://jupyter.readthedocs.io/en/latest/install.html) or [nteract](https://nteract.io/desktop) | ||
- [ZeroMQ 4.X.X](http://zeromq.org/intro:get-the-software) - for convenience, pre-built Windows binaries (v4.2.1) are included in the zmq-win directory. | ||
- [pkg-config](https://en.wikipedia.org/wiki/Pkg-config) | ||
- [git](https://git-scm.com/download) - usually already present on Linux and Mac OS X. If not present, follow the instructions at [https://git-scm.com/download](https://git-scm.com/download) | ||
On Windows, it can also be installed as part of MinGW as described below. | ||
|
||
### Linux | ||
|
||
Quick installation as module, requires Go 1.12+ | ||
```sh | ||
$ go get -u github.com/gopherdata/gophernotes | ||
$ env GO111MODULE=on go get github.com/gopherdata/gophernotes | ||
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes | ||
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/.local/share/jupyter/kernels/gophernotes | ||
$ cd ~/.local/share/jupyter/kernels/gophernotes | ||
$ cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/[email protected]/kernel/* "." | ||
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json | ||
``` | ||
|
||
To confirm that the `gophernotes` binary is installed and in your PATH, you should see the following when running `gophernotes` directly: | ||
Manual installation from GOPATH, also works with Go 1.11 | ||
```sh | ||
$ env GO111MODULE=off go get -d -u github.com/gopherdata/gophernotes | ||
$ cd "$(go env GOPATH)"/src/github.com/gopherdata/gophernotes | ||
$ env GO111MODULE=on go install | ||
$ mkdir -p ~/.local/share/jupyter/kernels/gophernotes | ||
$ cp kernel/* ~/.local/share/jupyter/kernels/gophernotes | ||
$ cd ~/.local/share/jupyter/kernels/gophernotes | ||
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json | ||
``` | ||
|
||
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly: | ||
```sh | ||
$ "$(go env GOPATH)"/bin/gophernotes | ||
``` | ||
and you shoud see the following: | ||
```sh | ||
$ gophernotes | ||
2017/09/20 10:33:12 Need a command line argument specifying the connection file. | ||
``` | ||
|
||
|
@@ -68,19 +86,34 @@ $ jupyter --data-dir | |
|
||
### Mac | ||
|
||
**Important Note** - gomacro relies on the `plugin` package when importing third party libraries. This package works reliably on Mac OS X only with Go 1.10.2+ as long as you **never** execute the command `strip gophernotes`. | ||
If you can only compile gophernotes with Go <= 1.10.1 on Mac, consider using the [Docker](#docker) install and run gophernotes/Jupyter in Docker. | ||
**Important Note** - gomacro relies on the `plugin` package when importing third party libraries. This package works reliably on Mac OS X with Go 1.10.2+ as long as you **never** execute the command `strip gophernotes`. | ||
|
||
Quick installation as module, requires Go 1.12+ | ||
```sh | ||
$ go get -u github.com/gopherdata/gophernotes | ||
$ env GO111MODULE=on go get github.com/gopherdata/gophernotes | ||
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes | ||
$ cp $GOPATH/src/github.com/gopherdata/gophernotes/kernel/* ~/Library/Jupyter/kernels/gophernotes | ||
$ cd ~/Library/Jupyter/kernels/gophernotes | ||
$ cp "$(go env GOPATH)"/pkg/mod/github.com/gopherdata/[email protected]/kernel/* "." | ||
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json | ||
``` | ||
|
||
To confirm that the `gophernotes` binary is installed and in your PATH, you should see the following when running `gophernotes` directly: | ||
Manual installation from GOPATH, also works with Go 1.11 | ||
```sh | ||
$ env GO111MODULE=off go get -d -u github.com/gopherdata/gophernotes | ||
$ cd "$(go env GOPATH)"/src/github.com/gopherdata/gophernotes | ||
$ env GO111MODULE=on go install | ||
$ mkdir -p ~/Library/Jupyter/kernels/gophernotes | ||
$ cp kernel/* ~/Library/Jupyter/kernels/gophernotes | ||
$ cd ~/Library/Jupyter/kernels/gophernotes | ||
$ sed "s|gophernotes|$(go env GOPATH)/bin/gophernotes|" < kernel.json.in > kernel.json | ||
``` | ||
|
||
To confirm that the `gophernotes` binary is installed in GOPATH, execute it directly: | ||
```sh | ||
$ "$(go env GOPATH)"/bin/gophernotes | ||
``` | ||
and you shoud see the following: | ||
```sh | ||
$ gophernotes | ||
2017/09/20 10:33:12 Need a command line argument specifying the connection file. | ||
``` | ||
|
||
|
@@ -105,6 +138,7 @@ Then: | |
|
||
``` | ||
REM Download w/o building. | ||
set GO111MODULE=off | ||
go get -d -u github.com/gopherdata/gophernotes | ||
cd %GOPATH%\src\github.com\gopherdata\gophernotes\zmq-win | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
// +build !go1.11 | ||
|
||
// cause a compile error if Go compiler version < 1.11 | ||
|
||
package main | ||
|
||
var _ int = "error: Go >= 1.11 required to compile Gophernotes" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The command `import` will write here import files for third-party | ||
packages if they are to be imported and statically linked into gophernotes. | ||
|
||
This is currently needed on Windows, *BSD, Android etc. (to be exact, | ||
as of Go 1.13 it's needed on all operating system except Linux and Mac OS X). | ||
|
||
It is safe to remove files in this directory, | ||
as long as you **keep at least** README.md and a_package.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package imports | ||
|
||
import ( | ||
"github.com/cosmos72/gomacro/base/paths" | ||
"github.com/cosmos72/gomacro/imports" | ||
) | ||
|
||
type PackageUnderlying = imports.PackageUnderlying | ||
|
||
type Package = imports.Package | ||
|
||
type PackageMap = imports.PackageMap | ||
|
||
// imports.Packages is a map, copying it only makes a reference | ||
// => Packages and imports.Packages are kept in sync automatically | ||
var Packages = imports.Packages | ||
|
||
// used to locate this package path via reflection | ||
type findMe struct{} | ||
|
||
func init() { | ||
// tell gomacro where to write import files | ||
paths.SymbolFromImportsPackage = findMe{} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"argv": [ | ||
"gophernotes", | ||
"{connection_file}" | ||
], | ||
"display_name": "Go", | ||
"language": "go", | ||
"name": "go" | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.