Skip to content

Commit ce2a3a1

Browse files
authored
Rebrand to go.nhat.io/python/v3 (#3)
1 parent 753ce55 commit ce2a3a1

28 files changed

+77
-77
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
MODULE_NAME=python3
1+
MODULE_NAME=python
22

33
VENDOR_DIR = vendor
44

README.md

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Go high-level bindings for the CPython-3 C-API
22

3-
[![GitHub Releases](https://img.shields.io/github/v/release/nhatthm/go-python3)](https://github.com/nhatthm/go-python3/releases/latest)
4-
[![Build Status](https://github.com/nhatthm/go-python3/actions/workflows/test.yaml/badge.svg)](https://github.com/nhatthm/go-python3/actions/workflows/test.yaml)
5-
[![codecov](https://codecov.io/gh/nhatthm/go-python3/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/nhatthm/go-python3)
6-
[![Go Report Card](https://goreportcard.com/badge/go.nhat.io/python3)](https://goreportcard.com/report/go.nhat.io/python3)
7-
[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/go.nhat.io/python3)
3+
[![GitHub Releases](https://img.shields.io/github/v/release/nhatthm/go-python)](https://github.com/nhatthm/go-python/releases/latest)
4+
[![Build Status](https://github.com/nhatthm/go-python/actions/workflows/test.yaml/badge.svg)](https://github.com/nhatthm/go-python/actions/workflows/test.yaml)
5+
[![codecov](https://codecov.io/gh/nhatthm/go-python/branch/master/graph/badge.svg?token=eTdAgDE2vR)](https://codecov.io/gh/nhatthm/go-python)
6+
[![Go Report Card](https://goreportcard.com/badge/go.nhat.io/python)](https://goreportcard.com/report/go.nhat.io/python)
7+
[![GoDevDoc](https://img.shields.io/badge/dev-doc-00ADD8?logo=go)](https://pkg.go.dev/go.nhat.io/python)
88
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/donate/?hosted_button_id=PJZSGJN57TDJY)
99

1010
> [!IMPORTANT]
@@ -24,69 +24,69 @@ Main goals:
2424
## Install
2525

2626
```bash
27-
go get go.nhat.io/python3
27+
go get go.nhat.io/python/v3
2828
```
2929

3030
## Examples
3131

3232
```go
33-
package python3_test
33+
package main
3434

3535
import (
36-
"fmt"
36+
"fmt"
3737

38-
"go.nhat.io/python3"
38+
python3 "go.nhat.io/python/v3"
3939
)
4040

41-
func ExampleVersion() {
42-
sys := python3.MustImportModule("sys")
43-
version := sys.GetAttr("version_info")
41+
func main() {
42+
sys := python3.MustImportModule("sys")
43+
version := sys.GetAttr("version_info")
4444

45-
pyMajor := version.GetAttr("major")
46-
defer pyMajor.DecRef()
45+
pyMajor := version.GetAttr("major")
46+
defer pyMajor.DecRef()
4747

48-
pyMinor := version.GetAttr("minor")
49-
defer pyMinor.DecRef()
48+
pyMinor := version.GetAttr("minor")
49+
defer pyMinor.DecRef()
5050

51-
pyReleaseLevel := version.GetAttr("releaselevel")
52-
defer pyReleaseLevel.DecRef()
51+
pyReleaseLevel := version.GetAttr("releaselevel")
52+
defer pyReleaseLevel.DecRef()
5353

54-
major := python3.AsInt(pyMajor)
55-
minor := python3.AsInt(pyMinor)
56-
releaseLevel := python3.AsString(pyReleaseLevel)
54+
major := python3.AsInt(pyMajor)
55+
minor := python3.AsInt(pyMinor)
56+
releaseLevel := python3.AsString(pyReleaseLevel)
5757

58-
fmt.Println("major:", major)
59-
fmt.Println("minor:", minor)
60-
fmt.Println("release level:", releaseLevel)
58+
fmt.Println("major:", major)
59+
fmt.Println("minor:", minor)
60+
fmt.Println("release level:", releaseLevel)
6161

62-
// Output:
63-
// major: 3
64-
// minor: 11
65-
// release level: final
62+
// Output:
63+
// major: 3
64+
// minor: 11
65+
// release level: final
6666
}
6767
```
6868

6969
```go
70-
package python3_test
70+
package main
7171

7272
import (
73-
"fmt"
73+
"fmt"
7474

75-
"go.nhat.io/python3"
75+
python3 "go.nhat.io/python/v3"
7676
)
7777

78-
func ExampleMath() {
79-
math := python3.MustImportModule("math")
78+
func main() { //nolint: govet
79+
math := python3.MustImportModule("math")
8080

81-
pyResult := math.CallMethodArgs("sqrt", 4)
82-
defer pyResult.DecRef()
81+
pyResult := math.CallMethodArgs("sqrt", 4)
82+
defer pyResult.DecRef()
8383

84-
result := python3.AsFloat64(pyResult)
84+
result := python3.AsFloat64(pyResult)
8585

86-
fmt.Printf("sqrt(4) = %.2f\n", result)
86+
fmt.Printf("sqrt(4) = %.2f\n", result)
8787

88-
// Output:
89-
// sqrt(4) = 2.00
88+
// Output:
89+
// sqrt(4) = 2.00
9090
}
9191
```
9292

bool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package python3
1+
package python
22

33
import "go.nhat.io/cpy3"
44

bool_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package python3_test
1+
package python_test
22

33
import (
44
"testing"
55

66
"github.com/stretchr/testify/assert"
77

8-
"go.nhat.io/python3"
8+
python3 "go.nhat.io/python/v3"
99
)
1010

1111
func TestBool(t *testing.T) {

doc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// Package python3 provides a high-level interface to the Python C API.
2-
package python3
1+
// Package python provides a high-level interface to the Python C API.
2+
package python

error.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package python3
1+
package python
22

33
import (
44
"go.nhat.io/cpy3"

examples/import-modules/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"go.nhat.io/python3"
6+
python3 "go.nhat.io/python/v3"
77
)
88

99
func main() {

examples/math/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ package main
33
import (
44
"fmt"
55

6-
"go.nhat.io/python3"
6+
python3 "go.nhat.io/python/v3"
77
)
88

99
func main() { //nolint: govet

float.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package python3
1+
package python
22

33
import "go.nhat.io/cpy3"
44

float_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
package python3_test
1+
package python_test
22

33
import (
44
"testing"
55

66
"github.com/stretchr/testify/assert"
77

8-
"go.nhat.io/python3"
8+
python3 "go.nhat.io/python/v3"
99
)
1010

1111
func TestFloat64(t *testing.T) {

0 commit comments

Comments
 (0)