-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: peefy <[email protected]>
- Loading branch information
Showing
17 changed files
with
484 additions
and
504 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
# This file is autogenerated by maturin v1.5.1 | ||
# To update, run | ||
# | ||
# maturin generate-ci github | ||
# | ||
name: python-test | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- master | ||
tags: | ||
- '*' | ||
pull_request: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
sdist: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
working-directory: "python" | ||
command: sdist | ||
args: -o dist | ||
- name: Upload sdist | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: python/dist | ||
|
||
linux: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
target: [ x86_64, aarch64 ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
target: ${{ matrix.target }} | ||
manylinux: auto | ||
working-directory: "python" | ||
command: build | ||
args: --release -o dist --find-interpreter | ||
env: | ||
# Workaround ring 0.17 build issue | ||
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8" | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: python/dist | ||
|
||
windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
working-directory: "python" | ||
command: build | ||
args: --release -o dist --find-interpreter | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: python/dist | ||
|
||
macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: PyO3/maturin-action@v1 | ||
with: | ||
working-directory: "python" | ||
command: build | ||
target: universal2-apple-darwin | ||
args: --release -o dist --find-interpreter | ||
- name: Upload wheels | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: wheels | ||
path: python/dist | ||
|
||
release: | ||
name: Release | ||
runs-on: ubuntu-latest | ||
if: "startsWith(github.ref, 'refs/tags/')" | ||
permissions: | ||
contents: read | ||
id-token: write | ||
needs: [ macos, linux, windows ] | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: wheels | ||
path: python/dist | ||
- name: Publish to TestPyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: "contains(github.ref, '-')" | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
skip-existing: true | ||
packages-dir: python/dist | ||
- name: Publish to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
if: "!contains(github.ref, '-')" | ||
with: | ||
skip-existing: true | ||
packages-dir: python/dist |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -22,7 +22,6 @@ zz_* | |
*.so | ||
*.dll | ||
*.d | ||
*.lock | ||
*.ll | ||
*.ll.lock | ||
_a.out.* | ||
|
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 |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
.vs/ | ||
.vscode/ | ||
.idea/ | ||
venv | ||
|
||
# kcl files | ||
.pytest_cache | ||
|
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,12 @@ | ||
[package] | ||
name = "kcl-python-lib" | ||
version = "0.8.4" | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
[lib] | ||
crate-type = ["cdylib"] | ||
|
||
[dependencies] | ||
pyo3 = "0.20.1" | ||
kcl-lang = {path = "../"} |
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 |
---|---|---|
@@ -1 +1,33 @@ | ||
# KCL Artifact Library for Python | ||
|
||
## Developing | ||
|
||
Setup virtualenv: | ||
|
||
```shell | ||
python3 -m venv venv | ||
``` | ||
|
||
Activate venv: | ||
|
||
```shell | ||
source venv/bin/activate | ||
``` | ||
|
||
Install maturin: | ||
|
||
```shell | ||
cargo install maturin | ||
``` | ||
|
||
Build bindings: | ||
|
||
```shell | ||
maturin develop | ||
``` | ||
|
||
Test | ||
|
||
```shell | ||
python3 -m pytest | ||
``` |
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 @@ | ||
from ._kcl_lib import * |
Oops, something went wrong.