Setuptools Gopy extension plugin
Project description
Setuptools plugin for Gopy extensions
setuptools-gopy is a plugin for setuptools to build Go Python extensions using gopy.
Usage
You can configure setuptools-gopy either through pyproject.toml or setup.py:
[build-system]
requires = ["setuptools", "setuptools-gopy"]
build-backend = "setuptools.build_meta"
[project]
name = "simple"
version = "0.0.1"
[tool.setuptools.packages]
find = { where = ["python"] }
[[tool.setuptools-gopy.ext-packages]]
target = "github.com/LouisBrunner/setuptools-gopy/examples/simple"
from setuptools import find_packages, setup
from setuptools_gopy import GopyExtension
setup(
name="simple",
version="0.0.1",
packages=find_packages(where="python"),
package_dir={"": "python"},
gopy_extensions=[
GopyExtension(
"github.com/LouisBrunner/setuptools-gopy/examples/simple",
)
],
)
In either case, you need to provide a target: this is the name of the Go package which should be built.
Once built, you can import Go symbols like so:
from .simple import Hello
Note that the name of the file will match the Go package that you imported.
Examples
examples/simpleshows a simple example of calling a Go function from Python- Check
gopy-ha-proton-drivefor a real-life example
Acknowledgements
- This repository is heavily inspired by
setuptools-rust, thanks to them!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file setuptools_gopy-0.0.2.tar.gz.
File metadata
- Download URL: setuptools_gopy-0.0.2.tar.gz
- Upload date:
- Size: 11.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
63153de9dc2033f3b16100ffd7e4d8970f1e72e8252dc545f08b1cefe72a3ae0
|
|
| MD5 |
2fc02057760dd1b0ddd5a0717ba84064
|
|
| BLAKE2b-256 |
cf8bcbb5728bc55ad9f0e10acc61a7b75bf0304fc1bf4060ae69b0c041731f16
|
Provenance
The following attestation bundles were made for setuptools_gopy-0.0.2.tar.gz:
Publisher:
pypi.yaml on LouisBrunner/setuptools-gopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_gopy-0.0.2.tar.gz -
Subject digest:
63153de9dc2033f3b16100ffd7e4d8970f1e72e8252dc545f08b1cefe72a3ae0 - Sigstore transparency entry: 198725014
- Sigstore integration time:
-
Permalink:
LouisBrunner/setuptools-gopy@1672e8e05b135dfc09e4a93e06e5f58b316d6149 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/LouisBrunner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@1672e8e05b135dfc09e4a93e06e5f58b316d6149 -
Trigger Event:
release
-
Statement type:
File details
Details for the file setuptools_gopy-0.0.2-py3-none-any.whl.
File metadata
- Download URL: setuptools_gopy-0.0.2-py3-none-any.whl
- Upload date:
- Size: 8.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
aef085d83f2a83860ba8fb80e4493ac8cd6ec569b2d5943b128c6a420f7e17b0
|
|
| MD5 |
7bc9a1dd9c45218b9665845880d8eaae
|
|
| BLAKE2b-256 |
7b4aac426cb928bf3fb2c99f5a09b55dd779558a8dfa897ef40514ada8fb1de7
|
Provenance
The following attestation bundles were made for setuptools_gopy-0.0.2-py3-none-any.whl:
Publisher:
pypi.yaml on LouisBrunner/setuptools-gopy
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
setuptools_gopy-0.0.2-py3-none-any.whl -
Subject digest:
aef085d83f2a83860ba8fb80e4493ac8cd6ec569b2d5943b128c6a420f7e17b0 - Sigstore transparency entry: 198725020
- Sigstore integration time:
-
Permalink:
LouisBrunner/setuptools-gopy@1672e8e05b135dfc09e4a93e06e5f58b316d6149 -
Branch / Tag:
refs/tags/v0.0.2 - Owner: https://github.com/LouisBrunner
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
pypi.yaml@1672e8e05b135dfc09e4a93e06e5f58b316d6149 -
Trigger Event:
release
-
Statement type: