Skip to content
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
36 changes: 36 additions & 0 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check

on:
push:
branches: [ "*" ]
pull_request:
branches: [ "*" ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'

- name: Install embedme
run: npm install -g embedme

- name: Verify README.md embedded code
run: npx embedme --verify README.md

- name: Check formatting
run: |
if [ -n "$(go fmt ./...)" ]; then
echo "Some files are not properly formatted. Please run 'go fmt ./...'"
exit 1
fi
67 changes: 10 additions & 57 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,57 +10,20 @@ on:
branches: [ "main" ]

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'

- name: Install embedme
run: npm install -g embedme

- name: Verify README.md embedded code
run: npx embedme --verify README.md

- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.23'

- name: Check formatting
run: |
if [ -n "$(go fmt ./...)" ]; then
echo "Some files are not properly formatted. Please run 'go fmt ./...'"
exit 1
fi

build:
continue-on-error: true
strategy:
fail-fast: false
matrix:
sys:
- {os: macos-latest, shell: bash}
- {os: ubuntu-24.04, shell: bash}
- {os: windows-latest, shell: bash}
os:
- macos-latest
- ubuntu-latest
- windows-latest
defaults:
run:
shell: ${{ matrix.sys.shell }}
runs-on: ${{matrix.sys.os}}
shell: bash
runs-on: ${{matrix.os}}
steps:
# - uses: msys2/setup-msys2@v2
# if: matrix.sys.os == 'windows-latest'
# with:
# update: true
# install: >-
# curl
# git
# pkg-config

- uses: actions/checkout@v4

- name: Set up Go
Expand All @@ -72,15 +35,15 @@ jobs:
with:
python-version: '3.13'
update-environment: true

- name: Generate Python pkg-config for windows (patch)
if: matrix.sys.os == 'windows-latest'
if: matrix.os == 'windows-latest'
run: |
mkdir -p $PKG_CONFIG_PATH
cp .github/assets/python3-embed.pc $PKG_CONFIG_PATH/

- name: Install tiny-pkg-config for windows (patch)
if: matrix.sys.os == 'windows-latest'
if: matrix.os == 'windows-latest'
run: |
set -x
curl -L https://github.com/cpunion/tiny-pkg-config/releases/download/v0.2.0/tiny-pkg-config_Windows_x86_64.zip -o /tmp/tiny-pkg-config.zip
Expand All @@ -96,16 +59,6 @@ jobs:

- name: Test with coverage
run: go test -coverprofile=coverage.txt -covermode=atomic ./...

- name: Test gopy
run: |
set -x
gopy init $HOME/foo
cd $HOME/foo
gopy build -v .
export GP_INJECT_DEBUG=1
gopy run -v .
gopy install -v .

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
Expand Down
22 changes: 11 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# go-python: Write Python in Go - The most intuitive Python wrapper for Golang

[![Build Status](https://github.com/cpunion/go-python/actions/workflows/go.yml/badge.svg)](https://github.com/cpunion/go-python/actions/workflows/go.yml)
[![Coverage Status](https://codecov.io/github/cpunion/go-python/graph/badge.svg?token=DLVMvjAOFM)](https://codecov.io/github/cpunion/go-python)
[![Build Status](https://github.com/gotray/go-python/actions/workflows/go.yml/badge.svg)](https://github.com/gotray/go-python/actions/workflows/go.yml)
[![codecov](https://codecov.io/github/gotray/go-python/graph/badge.svg?token=TnaFHV1E3y)](https://codecov.io/github/gotray/go-python)
![GitHub go.mod Go version](https://img.shields.io/github/go-mod/go-version/cpunion/go-python)
[![GitHub commits](https://badgen.net/github/commits/cpunion/go-python)](https://GitHub.com/Naereen/cpunion/go-python/commit/)
[![GitHub release](https://img.shields.io/github/v/tag/cpunion/go-python.svg?label=release)](https://github.com/cpunion/go-python/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/cpunion/go-python)](https://goreportcard.com/report/github.com/cpunion/go-python)
[![Go Reference](https://pkg.go.dev/badge/github.com/cpunion/go-python.svg)](https://pkg.go.dev/github.com/cpunion/go-python)
[![GitHub release](https://img.shields.io/github/v/tag/cpunion/go-python.svg?label=release)](https://github.com/gotray/go-python/releases)
[![Go Report Card](https://goreportcard.com/badge/github.com/gotray/go-python)](https://goreportcard.com/report/github.com/gotray/go-python)
[![Go Reference](https://pkg.go.dev/badge/github.com/gotray/go-python.svg)](https://pkg.go.dev/github.com/gotray/go-python)

## Goal

Expand Down Expand Up @@ -57,7 +57,7 @@ See the [examples](demo).
```go
package main

import . "github.com/cpunion/go-python"
import . "github.com/gotray/go-python"

func main() {
Initialize()
Expand All @@ -75,7 +75,7 @@ func main() {
```go
package main

import . "github.com/cpunion/go-python"
import . "github.com/gotray/go-python"

type plt struct {
Module
Expand Down Expand Up @@ -113,7 +113,7 @@ package foo
import (
"fmt"

. "github.com/cpunion/go-python"
. "github.com/gotray/go-python"
)

type Point struct {
Expand Down Expand Up @@ -165,8 +165,8 @@ package main
import (
"fmt"

. "github.com/cpunion/go-python"
"github.com/cpunion/go-python/demo/module/foo"
. "github.com/gotray/go-python"
"github.com/gotray/go-python/demo/module/foo"
)

func main() {
Expand Down Expand Up @@ -235,7 +235,7 @@ import (
"fmt"
"os"

. "github.com/cpunion/go-python"
. "github.com/gotray/go-python"
)

/*
Expand Down
39 changes: 0 additions & 39 deletions cmd/add.go

This file was deleted.

37 changes: 0 additions & 37 deletions cmd/build.go

This file was deleted.

10 changes: 0 additions & 10 deletions cmd/gopy/gopy.go

This file was deleted.

Loading
Loading