FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

all: move modules to stdlib by sbinet · Pull Request #174 · go-python/gpython · GitHub

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .go  (13) .py  (7) dotfile  (1) All 3 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
4 changes: 2 additions & 2 deletions .gitignore
This file contains hidden or 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
Expand Up @@ -10,5 +10,5 @@ cover.out
/dist

# tests
builtin/testfile
examples/embedding/embedding
stdlib/builtin/testfile
examples/embedding/embedding
6 changes: 3 additions & 3 deletions examples/embedding/main.go
This file contains hidden or 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
Expand Up @@ -10,7 +10,7 @@ import (

// This initializes gpython for runtime execution and is essential.
// It defines forward-declared symbols and registers native built-in modules, such as sys and time.
_ "github.com/go-python/gpython/modules"
_ "github.com/go-python/gpython/stdlib"

// Commonly consumed gpython
"github.com/go-python/gpython/py"
Expand All @@ -27,8 +27,8 @@ func runWithFile(pyFile string) error {

// See type Context interface and related docs
ctx := py.NewContext(py.DefaultContextOpts())
// This drives modules being able to perform cleanup and release resources

// This drives modules being able to perform cleanup and release resources
defer ctx.Close()

var err error
Expand Down
4 changes: 2 additions & 2 deletions examples/multi-context/main.go
This file contains hidden or 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
Expand Up @@ -14,7 +14,7 @@ import (

// This initializes gpython for runtime execution and is critical.
// It defines forward-declared symbols and registers native built-in modules, such as sys and time.
_ "github.com/go-python/gpython/modules"
_ "github.com/go-python/gpython/stdlib"

// This is the primary import for gpython.
// It contains all symbols needed to fully compile and run python.
Expand Down Expand Up @@ -129,7 +129,7 @@ func RunMultiPi(numWorkers, numTimes int) time.Duration {
}
workersRunning.Done()

// This drives modules being able to perform cleanup and release resources
// This drives modules being able to perform cleanup and release resources
w.ctx.Close()
}()
}
Expand Down
3 changes: 2 additions & 1 deletion main.go
This file contains hidden or 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
Expand Up @@ -14,10 +14,11 @@ import (
"runtime"
"runtime/pprof"

_ "github.com/go-python/gpython/modules"
"github.com/go-python/gpython/py"
"github.com/go-python/gpython/repl"
"github.com/go-python/gpython/repl/cli"

_ "github.com/go-python/gpython/stdlib"
)

// Globals
Expand Down
4 changes: 2 additions & 2 deletions pytest/pytest.go
This file contains hidden or 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
Expand Up @@ -11,10 +11,10 @@ import (
"strings"
"testing"

_ "github.com/go-python/gpython/modules"

"github.com/go-python/gpython/compile"
"github.com/go-python/gpython/py"

_ "github.com/go-python/gpython/stdlib"
)

var gContext = py.NewContext(py.DefaultContextOpts())
Expand Down
2 changes: 1 addition & 1 deletion repl/repl_test.go
This file contains hidden or 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
Expand Up @@ -6,7 +6,7 @@ import (
"testing"

// import required modules
_ "github.com/go-python/gpython/modules"
_ "github.com/go-python/gpython/stdlib"
)

type replTest struct {
Expand Down
5 changes: 2 additions & 3 deletions repl/web/main.go
This file contains hidden or 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
Expand Up @@ -13,12 +13,11 @@ import (
"log"
"runtime"

"github.com/go-python/gpython/repl"
"github.com/gopherjs/gopherwasm/js" // gopherjs to wasm converter shim

// import required modules
_ "github.com/go-python/gpython/modules"

"github.com/go-python/gpython/repl"
_ "github.com/go-python/gpython/stdlib"
)

// Implement the replUI interface
Expand Down
File renamed without changes.
12 changes: 7 additions & 5 deletions modules/runtime.go → stdlib/stdlib.go
This file contains hidden or 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
Expand Up @@ -2,7 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

package modules
// Package stdlib provides the bootstrap code to wire in all the stdlib
// (python) modules into a gpython context and VM.
package stdlib

import (
"bytes"
Expand All @@ -16,10 +18,10 @@ import (
"github.com/go-python/gpython/py"
"github.com/go-python/gpython/vm"

_ "github.com/go-python/gpython/builtin"
_ "github.com/go-python/gpython/math"
_ "github.com/go-python/gpython/sys"
_ "github.com/go-python/gpython/time"
_ "github.com/go-python/gpython/stdlib/builtin"
_ "github.com/go-python/gpython/stdlib/math"
_ "github.com/go-python/gpython/stdlib/sys"
_ "github.com/go-python/gpython/stdlib/time"
)

func init() {
Expand Down
File renamed without changes.
File renamed without changes.

Back | FazBrowse Home | New Git URL