kcl-lib 0.8.5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of kcl-lib might be problematic. Click here for more details.
- kcl_lib-0.8.5/.github/workflows/cla.yml +38 -0
- kcl_lib-0.8.5/.github/workflows/go-test.yaml +30 -0
- kcl_lib-0.8.5/.github/workflows/java-test.yaml +97 -0
- kcl_lib-0.8.5/.github/workflows/nodejs-test.yaml +284 -0
- kcl_lib-0.8.5/.github/workflows/python-test.yaml +108 -0
- kcl_lib-0.8.5/.github/workflows/rust-test.yaml +32 -0
- kcl_lib-0.8.5/.gitignore +40 -0
- kcl_lib-0.8.5/Cargo.toml +14 -0
- kcl_lib-0.8.5/PKG-INFO +55 -0
- kcl_lib-0.8.5/README.md +87 -0
- kcl_lib-0.8.5/go.mod +3 -0
- kcl_lib-0.8.5/install.go +112 -0
- kcl_lib-0.8.5/install_lib_unix.go +19 -0
- kcl_lib-0.8.5/install_lib_windows.go +11 -0
- kcl_lib-0.8.5/kcl_lib/__init__.py +1 -0
- kcl_lib-0.8.5/kcl_lib/api/__init__.py +4 -0
- kcl_lib-0.8.5/kcl_lib/api/service.py +194 -0
- kcl_lib-0.8.5/kcl_lib/api/spec_pb2.py +215 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_darwin_amd64.go +11 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_darwin_arm64.go +11 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_linux_amd64.go +11 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_linux_arm64.go +11 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_windows_amd64.go +14 -0
- kcl_lib-0.8.5/kclvm_cli_shared_lib_windows_arm64.go +14 -0
- kcl_lib-0.8.5/lib/darwin-amd64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/darwin-amd64/kclvm_cli +0 -0
- kcl_lib-0.8.5/lib/darwin-amd64/libkclvm_cli_cdylib.dylib +0 -0
- kcl_lib-0.8.5/lib/darwin-arm64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/darwin-arm64/kclvm_cli +0 -0
- kcl_lib-0.8.5/lib/darwin-arm64/libkclvm_cli_cdylib.dylib +0 -0
- kcl_lib-0.8.5/lib/dummy.go +10 -0
- kcl_lib-0.8.5/lib/linux-amd64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/linux-amd64/kclvm_cli +0 -0
- kcl_lib-0.8.5/lib/linux-arm64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/linux-arm64/kclvm_cli +0 -0
- kcl_lib-0.8.5/lib/windows-amd64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/windows-amd64/kclvm_cli.exe +0 -0
- kcl_lib-0.8.5/lib/windows-amd64/kclvm_cli_cdylib.dll +0 -0
- kcl_lib-0.8.5/lib/windows-amd64/kclvm_cli_cdylib.lib +0 -0
- kcl_lib-0.8.5/lib/windows-arm64/dummy.go +1 -0
- kcl_lib-0.8.5/lib/windows-arm64/kclvm_cli.exe +0 -0
- kcl_lib-0.8.5/lib/windows-arm64/kclvm_cli_cdylib.dll +0 -0
- kcl_lib-0.8.5/lib/windows-arm64/kclvm_cli_cdylib.lib +0 -0
- kcl_lib-0.8.5/pyproject.toml +38 -0
- kcl_lib-0.8.5/python/.gitignore +15 -0
- kcl_lib-0.8.5/python/Cargo.lock +4059 -0
- kcl_lib-0.8.5/python/Cargo.toml +12 -0
- kcl_lib-0.8.5/python/Makefile +13 -0
- kcl_lib-0.8.5/python/README.md +33 -0
- kcl_lib-0.8.5/python/kcl_lib/__init__.py +1 -0
- kcl_lib-0.8.5/python/kcl_lib/api/__init__.py +4 -0
- kcl_lib-0.8.5/python/kcl_lib/api/service.py +194 -0
- kcl_lib-0.8.5/python/kcl_lib/api/spec_pb2.py +215 -0
- kcl_lib-0.8.5/python/src/lib.rs +15 -0
- kcl_lib-0.8.5/python/tests/exec_test.py +35 -0
- kcl_lib-0.8.5/python/tests/test_data/schema.k +6 -0
- kcl_lib-0.8.5/spec/gpyrpc/Makefile +3 -0
- kcl_lib-0.8.5/spec/gpyrpc/spec.proto +496 -0
- kcl_lib-0.8.5/src/README.md +28 -0
- kcl_lib-0.8.5/src/lib.rs +48 -0
- kcl_lib-0.8.5/testdata/compile_recursive/kcl1/main.k +1 -0
- kcl_lib-0.8.5/testdata/compile_recursive/kcl2/main.k +1 -0
- kcl_lib-0.8.5/testdata/compile_recursive/main.k +1 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/aaa/kcl.mod +5 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/aaa/main.k +10 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/bbb/kcl.mod +5 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/bbb/main.k +2 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/ccc/kcl.mod +5 -0
- kcl_lib-0.8.5/testdata/get_schema_ty/ccc/main.k +2 -0
- kcl_lib-0.8.5/testdata/hello.k +1 -0
- kcl_lib-0.8.5/testdata/hello_import.k +5 -0
- kcl_lib-0.8.5/testdata/hello_with_print.k +2 -0
- kcl_lib-0.8.5/testdata/rename/main.bak +2 -0
- kcl_lib-0.8.5/testdata/rename_doc/main.bak +2 -0
- kcl_lib-0.8.5/testdata/settings/kcl.yaml +5 -0
- kcl_lib-0.8.5/testdata/test-lint-import.k +4 -0
- kcl_lib-0.8.5/testdata/test-lint.k +1 -0
- kcl_lib-0.8.5/testdata/test.k +5 -0
- kcl_lib-0.8.5/testdata/testing/module/kcl.mod +3 -0
- kcl_lib-0.8.5/testdata/testing/module/pkg/func.k +3 -0
- kcl_lib-0.8.5/testdata/testing/module/pkg/func_test.k +7 -0
- kcl_lib-0.8.5/util.go +29 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
name: "CLA Assistant"
|
|
2
|
+
on:
|
|
3
|
+
issue_comment:
|
|
4
|
+
types: [created]
|
|
5
|
+
pull_request_target:
|
|
6
|
+
types: [opened,closed,synchronize]
|
|
7
|
+
jobs:
|
|
8
|
+
CLAssistant:
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
steps:
|
|
11
|
+
- name: "CLA Assistant"
|
|
12
|
+
if: (github.event.comment.body == 'recheck' || github.event.comment.body == 'I have read the CLA Document and I hereby sign the CLA') || github.event_name == 'pull_request_target'
|
|
13
|
+
uses: contributor-assistant/github-action@v2.3.0
|
|
14
|
+
env:
|
|
15
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
16
|
+
# the below token should have repo scope and must be manually added by you in the repository's secret
|
|
17
|
+
PERSONAL_ACCESS_TOKEN : ${{ secrets.DEPLOY_ACCESS_TOKEN }}
|
|
18
|
+
with:
|
|
19
|
+
path-to-document: 'https://github.com/kcl-lang/.github/blob/main/CLA.md' # e.g. a CLA or a DCO document
|
|
20
|
+
|
|
21
|
+
# branch should not be protected
|
|
22
|
+
lock-pullrequest-aftermerge: True
|
|
23
|
+
path-to-signatures: 'signatures/version1/cla.json'
|
|
24
|
+
remote-organization-name: kcl-lang
|
|
25
|
+
remote-repository-name: cla.db
|
|
26
|
+
branch: 'main'
|
|
27
|
+
allowlist: bot*
|
|
28
|
+
|
|
29
|
+
#below are the optional inputs - If the optional inputs are not given, then default values will be taken
|
|
30
|
+
#remote-organization-name: enter the remote organization name where the signatures should be stored (Default is storing the signatures in the same repository)
|
|
31
|
+
#remote-repository-name: enter the remote repository name where the signatures should be stored (Default is storing the signatures in the same repository)
|
|
32
|
+
#create-file-commit-message: 'For example: Creating file for storing CLA Signatures'
|
|
33
|
+
#signed-commit-message: 'For example: $contributorName has signed the CLA in #$pullRequestNo'
|
|
34
|
+
#custom-notsigned-prcomment: 'pull request comment with Introductory message to ask new contributors to sign'
|
|
35
|
+
#custom-pr-sign-comment: 'The signature to be committed in order to sign the CLA'
|
|
36
|
+
#custom-allsigned-prcomment: 'pull request comment when all contributors has signed, defaults to **CLA Assistant Lite bot** All Contributors have signed the CLA.'
|
|
37
|
+
#lock-pullrequest-aftermerge: false - if you don't want this bot to automatically lock the pull request after merging (default - true)
|
|
38
|
+
#use-dco-flag: true - If you are using DCO instead of CLA
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
name: go-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
tags:
|
|
9
|
+
- '*'
|
|
10
|
+
pull_request:
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
22
|
+
steps:
|
|
23
|
+
- name: Git checkout
|
|
24
|
+
uses: actions/checkout@v2
|
|
25
|
+
- name: Set up Go
|
|
26
|
+
uses: actions/setup-go@v2
|
|
27
|
+
with:
|
|
28
|
+
go-version: 1.21
|
|
29
|
+
- name: Go code test
|
|
30
|
+
run: go test ./...
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
name: java-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
tags:
|
|
9
|
+
- '*'
|
|
10
|
+
pull_request:
|
|
11
|
+
branches:
|
|
12
|
+
- main
|
|
13
|
+
paths:
|
|
14
|
+
- "java/**"
|
|
15
|
+
workflow_dispatch:
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: read
|
|
19
|
+
|
|
20
|
+
jobs:
|
|
21
|
+
test:
|
|
22
|
+
permissions:
|
|
23
|
+
actions: write # for styfle/cancel-workflow-action to cancel/stop running workflows
|
|
24
|
+
contents: read # for actions/checkout to fetch code
|
|
25
|
+
name: "${{ matrix.root-pom }} on JDK ${{ matrix.java }} for the classifier ${{ matrix.classifier }}"
|
|
26
|
+
strategy:
|
|
27
|
+
matrix:
|
|
28
|
+
include:
|
|
29
|
+
- os: ubuntu-latest
|
|
30
|
+
classifier: linux-x86_64
|
|
31
|
+
java: 8
|
|
32
|
+
root-pom: 'pom.xml'
|
|
33
|
+
- os: ubuntu-latest
|
|
34
|
+
classifier: linux-aarch_64
|
|
35
|
+
java: 8
|
|
36
|
+
root-pom: 'pom.xml'
|
|
37
|
+
- os: windows-latest
|
|
38
|
+
classifier: windows-x86_64
|
|
39
|
+
java: 8
|
|
40
|
+
root-pom: 'pom.xml'
|
|
41
|
+
- os: macos-latest
|
|
42
|
+
classifier: osx-x86_64
|
|
43
|
+
java: 8
|
|
44
|
+
root-pom: 'pom.xml'
|
|
45
|
+
- os: macos-latest
|
|
46
|
+
classifier: osx-aarch_64
|
|
47
|
+
java: 8
|
|
48
|
+
root-pom: 'pom.xml'
|
|
49
|
+
runs-on: ${{ matrix.os }}
|
|
50
|
+
env:
|
|
51
|
+
ROOT_POM: ${{ matrix.root-pom }}
|
|
52
|
+
steps:
|
|
53
|
+
- name: 'Check out repository'
|
|
54
|
+
uses: actions/checkout@8e5e7e5ab8b370d6c329ec480221332ada57f0ab
|
|
55
|
+
- name: 'Set up JDK ${{ matrix.java }}'
|
|
56
|
+
uses: actions/setup-java@5ffc13f4174014e2d4d4572b3d74c3fa61aeb2c2
|
|
57
|
+
with:
|
|
58
|
+
java-version: ${{ matrix.java }}
|
|
59
|
+
distribution: 'zulu'
|
|
60
|
+
cache: 'maven'
|
|
61
|
+
server-id: sonatype-nexus-snapshots
|
|
62
|
+
server-username: CI_DEPLOY_USERNAME
|
|
63
|
+
server-password: CI_DEPLOY_PASSWORD
|
|
64
|
+
- uses: actions/setup-python@v5
|
|
65
|
+
with:
|
|
66
|
+
python-version: '3.10'
|
|
67
|
+
- name: Install rust nightly toolchain
|
|
68
|
+
uses: actions-rs/toolchain@v1
|
|
69
|
+
with:
|
|
70
|
+
toolchain: 1.74
|
|
71
|
+
override: true
|
|
72
|
+
components: clippy, rustfmt
|
|
73
|
+
|
|
74
|
+
- name: Setup linux-aarch_64 rust target
|
|
75
|
+
if: "contains(matrix.classifier, 'linux-aarch_64')"
|
|
76
|
+
run: |
|
|
77
|
+
sudo apt-get update
|
|
78
|
+
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
|
|
79
|
+
# Setup for cargo
|
|
80
|
+
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
|
|
81
|
+
- name: 'Test'
|
|
82
|
+
shell: bash
|
|
83
|
+
working-directory: java
|
|
84
|
+
run: make test
|
|
85
|
+
- name: 'Build and Deploy'
|
|
86
|
+
shell: bash
|
|
87
|
+
working-directory: java
|
|
88
|
+
run: mvn clean install -DskipTests -Dcargo-build.profile=release -Djni.classifier=${{ matrix.classifier }} # && make deploy
|
|
89
|
+
env:
|
|
90
|
+
CI_DEPLOY_USERNAME: ${{ secrets.NEXUS_STAGE_DEPLOYER_USER }}
|
|
91
|
+
CI_DEPLOY_PASSWORD: ${{ secrets.NEXUS_STAGE_DEPLOYER_PW }}
|
|
92
|
+
- name: 'Upload artifact'
|
|
93
|
+
uses: actions/upload-artifact@v3
|
|
94
|
+
with:
|
|
95
|
+
name: java-artifact-${{ matrix.classifier }}
|
|
96
|
+
path: |
|
|
97
|
+
java/target/*.jar
|
|
@@ -0,0 +1,284 @@
|
|
|
1
|
+
name: nodejs-test
|
|
2
|
+
|
|
3
|
+
env:
|
|
4
|
+
DEBUG: napi:*
|
|
5
|
+
MACOSX_DEPLOYMENT_TARGET: '10.13'
|
|
6
|
+
|
|
7
|
+
on:
|
|
8
|
+
push:
|
|
9
|
+
branches:
|
|
10
|
+
- main
|
|
11
|
+
tags:
|
|
12
|
+
- '*'
|
|
13
|
+
pull_request:
|
|
14
|
+
workflow_dispatch:
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
test:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
|
|
20
|
+
# Notes: this defaults only apply on run tasks.
|
|
21
|
+
defaults:
|
|
22
|
+
run:
|
|
23
|
+
working-directory: "nodejs"
|
|
24
|
+
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
- name: Install rust toolchain
|
|
28
|
+
uses: actions-rs/toolchain@v1
|
|
29
|
+
with:
|
|
30
|
+
toolchain: 1.74
|
|
31
|
+
override: true
|
|
32
|
+
components: clippy, rustfmt
|
|
33
|
+
|
|
34
|
+
- uses: pnpm/action-setup@v2
|
|
35
|
+
with:
|
|
36
|
+
version: 8
|
|
37
|
+
|
|
38
|
+
- name: Setup node
|
|
39
|
+
uses: actions/setup-node@v4
|
|
40
|
+
with:
|
|
41
|
+
node-version: '18'
|
|
42
|
+
cache: pnpm
|
|
43
|
+
cache-dependency-path: "nodejs/pnpm-lock.yaml"
|
|
44
|
+
|
|
45
|
+
- name: Corepack
|
|
46
|
+
run: corepack enable
|
|
47
|
+
|
|
48
|
+
- name: Install dependencies
|
|
49
|
+
run: pnpm install --frozen-lockfile
|
|
50
|
+
|
|
51
|
+
- name: Check format
|
|
52
|
+
run: pnpm exec prettier --check .
|
|
53
|
+
|
|
54
|
+
- name: Check diff
|
|
55
|
+
run: git diff --exit-code
|
|
56
|
+
|
|
57
|
+
- name: Build
|
|
58
|
+
run: pnpm build
|
|
59
|
+
|
|
60
|
+
- name: Test
|
|
61
|
+
run: cargo test --no-fail-fast
|
|
62
|
+
|
|
63
|
+
linux:
|
|
64
|
+
runs-on: ubuntu-latest
|
|
65
|
+
strategy:
|
|
66
|
+
matrix:
|
|
67
|
+
settings:
|
|
68
|
+
- target: x86_64-unknown-linux-gnu
|
|
69
|
+
build: |
|
|
70
|
+
docker run \
|
|
71
|
+
-v .:/build \
|
|
72
|
+
-e NAPI_TARGET=x86_64-unknown-linux-gnu \
|
|
73
|
+
-w /build/nodejs \
|
|
74
|
+
ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian \
|
|
75
|
+
bash -c "pnpm build"
|
|
76
|
+
cd nodejs
|
|
77
|
+
# change owner to current user
|
|
78
|
+
sudo chown -R 1001:121 *.node
|
|
79
|
+
- target: aarch64-unknown-linux-gnu
|
|
80
|
+
build: |
|
|
81
|
+
docker run \
|
|
82
|
+
-v .:/build \
|
|
83
|
+
-e NAPI_TARGET=aarch64-unknown-linux-gnu \
|
|
84
|
+
-w /build/nodejs \
|
|
85
|
+
ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 \
|
|
86
|
+
bash -c "set -e &&
|
|
87
|
+
rustup target add aarch64-unknown-linux-gnu &&
|
|
88
|
+
pnpm build --target aarch64-unknown-linux-gnu &&
|
|
89
|
+
aarch64-unknown-linux-gnu-strip *.node"
|
|
90
|
+
cd nodejs
|
|
91
|
+
# change owner to current user
|
|
92
|
+
sudo chown -R 1001:121 *.node
|
|
93
|
+
- target: aarch64-unknown-linux-musl
|
|
94
|
+
build: |
|
|
95
|
+
docker run \
|
|
96
|
+
-v .:/build \
|
|
97
|
+
-e NAPI_TARGET=aarch64-unknown-linux-musl \
|
|
98
|
+
-w /build/nodejs \
|
|
99
|
+
ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-alpine \
|
|
100
|
+
bash -c "set -e &&
|
|
101
|
+
rustup target add aarch64-unknown-linux-musl &&
|
|
102
|
+
pnpm build --target aarch64-unknown-linux-musl &&
|
|
103
|
+
/aarch64-linux-musl-cross/bin/aarch64-linux-musl-strip *.node"
|
|
104
|
+
cd nodejs
|
|
105
|
+
# change owner to current user
|
|
106
|
+
sudo chown -R 1001:121 *.node
|
|
107
|
+
|
|
108
|
+
# Notes: this defaults only apply on run tasks.
|
|
109
|
+
defaults:
|
|
110
|
+
run:
|
|
111
|
+
working-directory: "nodejs"
|
|
112
|
+
|
|
113
|
+
name: linux - ${{ matrix.settings.target }}
|
|
114
|
+
|
|
115
|
+
steps:
|
|
116
|
+
- uses: actions/checkout@v4
|
|
117
|
+
- uses: pnpm/action-setup@v2
|
|
118
|
+
with:
|
|
119
|
+
version: 8
|
|
120
|
+
- name: Setup node
|
|
121
|
+
uses: actions/setup-node@v4
|
|
122
|
+
with:
|
|
123
|
+
node-version: '18'
|
|
124
|
+
cache: pnpm
|
|
125
|
+
cache-dependency-path: "nodejs/pnpm-lock.yaml"
|
|
126
|
+
- name: Corepack
|
|
127
|
+
run: corepack enable
|
|
128
|
+
- name: Install dependencies
|
|
129
|
+
run: pnpm install --frozen-lockfile
|
|
130
|
+
- name: Build
|
|
131
|
+
shell: bash
|
|
132
|
+
working-directory: .
|
|
133
|
+
run: ${{ matrix.settings.build }}
|
|
134
|
+
- uses: actions/upload-artifact@v3
|
|
135
|
+
with:
|
|
136
|
+
name: bindings-linux-${{ matrix.settings.target }}
|
|
137
|
+
path: nodejs/*.node
|
|
138
|
+
|
|
139
|
+
windows:
|
|
140
|
+
runs-on: windows-latest
|
|
141
|
+
strategy:
|
|
142
|
+
matrix:
|
|
143
|
+
settings:
|
|
144
|
+
- target: x86_64-pc-windows-msvc
|
|
145
|
+
build: pnpm build
|
|
146
|
+
- target: aarch64-pc-windows-msvc
|
|
147
|
+
build: |
|
|
148
|
+
rustup target add aarch64-pc-windows-msvc;
|
|
149
|
+
NAPI_TARGET=aarch64-pc-windows-msvc pnpm build
|
|
150
|
+
|
|
151
|
+
# Notes: this defaults only apply on run tasks.
|
|
152
|
+
defaults:
|
|
153
|
+
run:
|
|
154
|
+
working-directory: "nodejs"
|
|
155
|
+
|
|
156
|
+
name: windows - ${{ matrix.settings.target }}
|
|
157
|
+
|
|
158
|
+
steps:
|
|
159
|
+
- uses: actions/checkout@v4
|
|
160
|
+
- uses: pnpm/action-setup@v2
|
|
161
|
+
with:
|
|
162
|
+
version: 8
|
|
163
|
+
- name: Setup node
|
|
164
|
+
uses: actions/setup-node@v4
|
|
165
|
+
with:
|
|
166
|
+
node-version: '18'
|
|
167
|
+
cache: pnpm
|
|
168
|
+
cache-dependency-path: "nodejs/pnpm-lock.yaml"
|
|
169
|
+
- name: Corepack
|
|
170
|
+
run: corepack enable
|
|
171
|
+
- name: Install dependencies
|
|
172
|
+
run: pnpm install --frozen-lockfile
|
|
173
|
+
- name: Build
|
|
174
|
+
shell: bash
|
|
175
|
+
run: ${{ matrix.settings.build }}
|
|
176
|
+
- uses: actions/upload-artifact@v3
|
|
177
|
+
with:
|
|
178
|
+
name: bindings-windows-${{ matrix.settings.target }}
|
|
179
|
+
path: nodejs/*.node
|
|
180
|
+
|
|
181
|
+
macos:
|
|
182
|
+
runs-on: macos-latest
|
|
183
|
+
strategy:
|
|
184
|
+
matrix:
|
|
185
|
+
settings:
|
|
186
|
+
- target: x86_64-apple-darwin
|
|
187
|
+
build: |
|
|
188
|
+
pnpm build
|
|
189
|
+
strip -x *.node
|
|
190
|
+
- target: aarch64-apple-darwin
|
|
191
|
+
build: |
|
|
192
|
+
sudo rm -Rf /Library/Developer/CommandLineTools/SDKs/*;
|
|
193
|
+
export CC=$(xcrun -f clang);
|
|
194
|
+
export CXX=$(xcrun -f clang++);
|
|
195
|
+
SYSROOT=$(xcrun --sdk macosx --show-sdk-path);
|
|
196
|
+
export CFLAGS="-isysroot $SYSROOT -isystem $SYSROOT";
|
|
197
|
+
rustup target add aarch64-apple-darwin;
|
|
198
|
+
|
|
199
|
+
export NAPI_TARGET=aarch64-apple-darwin;
|
|
200
|
+
pnpm build
|
|
201
|
+
strip -x *.node
|
|
202
|
+
|
|
203
|
+
# Notes: this defaults only apply on run tasks.
|
|
204
|
+
defaults:
|
|
205
|
+
run:
|
|
206
|
+
working-directory: "nodejs"
|
|
207
|
+
|
|
208
|
+
name: macos - ${{ matrix.settings.target }}
|
|
209
|
+
|
|
210
|
+
steps:
|
|
211
|
+
- uses: actions/checkout@v4
|
|
212
|
+
- uses: pnpm/action-setup@v2
|
|
213
|
+
with:
|
|
214
|
+
version: 8
|
|
215
|
+
- name: Setup node
|
|
216
|
+
uses: actions/setup-node@v4
|
|
217
|
+
with:
|
|
218
|
+
node-version: '18'
|
|
219
|
+
cache: pnpm
|
|
220
|
+
cache-dependency-path: "nodejs/pnpm-lock.yaml"
|
|
221
|
+
- name: Corepack
|
|
222
|
+
run: corepack enable
|
|
223
|
+
- name: Install dependencies
|
|
224
|
+
run: pnpm install --frozen-lockfile
|
|
225
|
+
- name: Build
|
|
226
|
+
run: ${{ matrix.settings.build }}
|
|
227
|
+
shell: bash
|
|
228
|
+
- uses: actions/upload-artifact@v3
|
|
229
|
+
with:
|
|
230
|
+
name: bindings-macos-${{ matrix.settings.target }}
|
|
231
|
+
path: nodejs/*.node
|
|
232
|
+
|
|
233
|
+
release:
|
|
234
|
+
name: Release
|
|
235
|
+
runs-on: ubuntu-latest
|
|
236
|
+
needs: [macos, linux, windows]
|
|
237
|
+
permissions:
|
|
238
|
+
id-token: write
|
|
239
|
+
|
|
240
|
+
# Notes: this defaults only apply on run tasks.
|
|
241
|
+
defaults:
|
|
242
|
+
run:
|
|
243
|
+
working-directory: "nodejs"
|
|
244
|
+
|
|
245
|
+
steps:
|
|
246
|
+
- uses: actions/checkout@v4
|
|
247
|
+
- uses: pnpm/action-setup@v2
|
|
248
|
+
with:
|
|
249
|
+
version: 8
|
|
250
|
+
- name: Setup node
|
|
251
|
+
uses: actions/setup-node@v4
|
|
252
|
+
with:
|
|
253
|
+
node-version: "18"
|
|
254
|
+
cache: pnpm
|
|
255
|
+
cache-dependency-path: "nodejs/pnpm-lock.yaml"
|
|
256
|
+
- name: Corepack
|
|
257
|
+
run: corepack enable
|
|
258
|
+
- name: Install dependencies
|
|
259
|
+
run: pnpm install --frozen-lockfile
|
|
260
|
+
|
|
261
|
+
- name: Download all artifacts
|
|
262
|
+
uses: actions/download-artifact@v3
|
|
263
|
+
with:
|
|
264
|
+
path: nodejs/artifacts
|
|
265
|
+
- name: Move artifacts
|
|
266
|
+
run: pnpm exec napi artifacts
|
|
267
|
+
|
|
268
|
+
- name: List packages
|
|
269
|
+
run: ls -R ./npm
|
|
270
|
+
shell: bash
|
|
271
|
+
|
|
272
|
+
- name: Publish Dry Run
|
|
273
|
+
# Since this command will not exit with non-zero code when file missing,
|
|
274
|
+
# we need to check the output manually.
|
|
275
|
+
run: |
|
|
276
|
+
npm publish --access public --provenance --dry-run
|
|
277
|
+
|
|
278
|
+
- name: Publish
|
|
279
|
+
run: |
|
|
280
|
+
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
|
|
281
|
+
npm publish --access public --provenance
|
|
282
|
+
env:
|
|
283
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
284
|
+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
# This file is autogenerated by maturin v1.5.1
|
|
2
|
+
# To update, run
|
|
3
|
+
#
|
|
4
|
+
# maturin generate-ci github
|
|
5
|
+
#
|
|
6
|
+
name: python-test
|
|
7
|
+
|
|
8
|
+
on:
|
|
9
|
+
push:
|
|
10
|
+
branches:
|
|
11
|
+
- main
|
|
12
|
+
- master
|
|
13
|
+
tags:
|
|
14
|
+
- '*'
|
|
15
|
+
pull_request:
|
|
16
|
+
workflow_dispatch:
|
|
17
|
+
|
|
18
|
+
permissions:
|
|
19
|
+
contents: read
|
|
20
|
+
|
|
21
|
+
jobs:
|
|
22
|
+
sdist:
|
|
23
|
+
runs-on: ubuntu-latest
|
|
24
|
+
steps:
|
|
25
|
+
- uses: actions/checkout@v4
|
|
26
|
+
- uses: PyO3/maturin-action@v1
|
|
27
|
+
with:
|
|
28
|
+
working-directory: "python"
|
|
29
|
+
command: sdist
|
|
30
|
+
args: -o dist
|
|
31
|
+
- name: Upload sdist
|
|
32
|
+
uses: actions/upload-artifact@v3
|
|
33
|
+
with:
|
|
34
|
+
name: wheels
|
|
35
|
+
path: python/dist
|
|
36
|
+
|
|
37
|
+
linux:
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
strategy:
|
|
40
|
+
matrix:
|
|
41
|
+
target: [ x86_64, aarch64 ]
|
|
42
|
+
steps:
|
|
43
|
+
- uses: actions/checkout@v4
|
|
44
|
+
- uses: PyO3/maturin-action@v1
|
|
45
|
+
with:
|
|
46
|
+
target: ${{ matrix.target }}
|
|
47
|
+
manylinux: auto
|
|
48
|
+
working-directory: "python"
|
|
49
|
+
command: build
|
|
50
|
+
args: --release -o dist --find-interpreter
|
|
51
|
+
env:
|
|
52
|
+
# Workaround ring 0.17 build issue
|
|
53
|
+
CFLAGS_aarch64_unknown_linux_gnu: "-D__ARM_ARCH=8"
|
|
54
|
+
- name: Upload wheels
|
|
55
|
+
uses: actions/upload-artifact@v3
|
|
56
|
+
with:
|
|
57
|
+
name: wheels
|
|
58
|
+
path: python/dist
|
|
59
|
+
|
|
60
|
+
windows:
|
|
61
|
+
runs-on: windows-latest
|
|
62
|
+
steps:
|
|
63
|
+
- uses: actions/checkout@v4
|
|
64
|
+
- uses: PyO3/maturin-action@v1
|
|
65
|
+
with:
|
|
66
|
+
working-directory: "python"
|
|
67
|
+
command: build
|
|
68
|
+
args: --release -o dist --find-interpreter
|
|
69
|
+
- name: Upload wheels
|
|
70
|
+
uses: actions/upload-artifact@v3
|
|
71
|
+
with:
|
|
72
|
+
name: wheels
|
|
73
|
+
path: python/dist
|
|
74
|
+
|
|
75
|
+
macos:
|
|
76
|
+
runs-on: macos-latest
|
|
77
|
+
steps:
|
|
78
|
+
- uses: actions/checkout@v4
|
|
79
|
+
- uses: PyO3/maturin-action@v1
|
|
80
|
+
with:
|
|
81
|
+
working-directory: "python"
|
|
82
|
+
command: build
|
|
83
|
+
target: universal2-apple-darwin
|
|
84
|
+
args: --release -o dist --find-interpreter
|
|
85
|
+
- name: Upload wheels
|
|
86
|
+
uses: actions/upload-artifact@v3
|
|
87
|
+
with:
|
|
88
|
+
name: wheels
|
|
89
|
+
path: python/dist
|
|
90
|
+
|
|
91
|
+
release:
|
|
92
|
+
name: Release
|
|
93
|
+
runs-on: ubuntu-latest
|
|
94
|
+
permissions:
|
|
95
|
+
contents: read
|
|
96
|
+
id-token: write
|
|
97
|
+
needs: [ macos, linux, windows ]
|
|
98
|
+
steps:
|
|
99
|
+
- uses: actions/download-artifact@v3
|
|
100
|
+
with:
|
|
101
|
+
name: wheels
|
|
102
|
+
path: python/dist
|
|
103
|
+
- name: Publish to PyPI
|
|
104
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
105
|
+
with:
|
|
106
|
+
password: ${{ secrets.PYPI_API_TOKEN }}
|
|
107
|
+
skip-existing: true
|
|
108
|
+
packages-dir: python/dist
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
name: rust-test
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
- master
|
|
8
|
+
tags:
|
|
9
|
+
- '*'
|
|
10
|
+
pull_request:
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
permissions:
|
|
14
|
+
contents: read
|
|
15
|
+
|
|
16
|
+
jobs:
|
|
17
|
+
rust-test:
|
|
18
|
+
strategy:
|
|
19
|
+
matrix:
|
|
20
|
+
os: [macos-latest, ubuntu-latest, windows-latest]
|
|
21
|
+
runs-on: ${{ matrix.os }}
|
|
22
|
+
steps:
|
|
23
|
+
- name: Git checkout
|
|
24
|
+
uses: actions/checkout@v2
|
|
25
|
+
- name: Install rust nightly toolchain
|
|
26
|
+
uses: actions-rs/toolchain@v1
|
|
27
|
+
with:
|
|
28
|
+
toolchain: 1.74
|
|
29
|
+
override: true
|
|
30
|
+
components: clippy, rustfmt
|
|
31
|
+
- name: Rust code test
|
|
32
|
+
run: cargo test
|
kcl_lib-0.8.5/.gitignore
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
*.a
|
|
4
|
+
*.o
|
|
5
|
+
*.so
|
|
6
|
+
|
|
7
|
+
*.exe
|
|
8
|
+
*.lib
|
|
9
|
+
*.dll
|
|
10
|
+
|
|
11
|
+
a.out*
|
|
12
|
+
zz_*
|
|
13
|
+
/_build*
|
|
14
|
+
*.dylib
|
|
15
|
+
*.lock
|
|
16
|
+
.kclvm
|
|
17
|
+
|
|
18
|
+
# KCL cache and temp output
|
|
19
|
+
.kclvm
|
|
20
|
+
.kclvm_cov
|
|
21
|
+
*.dylib
|
|
22
|
+
*.so
|
|
23
|
+
*.dll
|
|
24
|
+
*.d
|
|
25
|
+
*.ll
|
|
26
|
+
*.ll.lock
|
|
27
|
+
_a.out.*
|
|
28
|
+
_a.out_*.*
|
|
29
|
+
|
|
30
|
+
**/target/
|
|
31
|
+
**/.DS_Store
|
|
32
|
+
**/.vscode
|
|
33
|
+
__pycache__
|
|
34
|
+
|
|
35
|
+
!lib/**/*.dylib
|
|
36
|
+
!lib/**/*.dll
|
|
37
|
+
!lib/**/*.lib
|
|
38
|
+
!lib/**/*.so
|
|
39
|
+
!lib/**/*.exe
|
|
40
|
+
!scripts/*.exe
|
kcl_lib-0.8.5/Cargo.toml
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
[package]
|
|
2
|
+
name = "kcl-lang"
|
|
3
|
+
version = "0.8.5"
|
|
4
|
+
edition = "2021"
|
|
5
|
+
readme = "README.md"
|
|
6
|
+
documentation = "kcl-lang.io"
|
|
7
|
+
description = "KCL Rust SDK"
|
|
8
|
+
license = "Apache-2.0"
|
|
9
|
+
|
|
10
|
+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
|
11
|
+
|
|
12
|
+
[dependencies]
|
|
13
|
+
anyhow = "1"
|
|
14
|
+
kclvm-api = { git = "https://github.com/kcl-lang/kcl", version = "0.8.5" }
|
kcl_lib-0.8.5/PKG-INFO
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: kcl_lib
|
|
3
|
+
Version: 0.8.5
|
|
4
|
+
Classifier: Programming Language :: Rust
|
|
5
|
+
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
6
|
+
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
7
|
+
Requires-Dist: protobuf >=4.25.3
|
|
8
|
+
Requires-Dist: pdoc ; extra == 'docs'
|
|
9
|
+
Requires-Dist: ruff ; extra == 'lint'
|
|
10
|
+
Requires-Dist: pytest ; extra == 'test'
|
|
11
|
+
Provides-Extra: docs
|
|
12
|
+
Provides-Extra: lint
|
|
13
|
+
Provides-Extra: test
|
|
14
|
+
Summary: KCL Programming Language Python Lib
|
|
15
|
+
License: Apache-2.0
|
|
16
|
+
Requires-Python: >=3.8
|
|
17
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
18
|
+
Project-URL: Documentation, https://kcl-lang.io
|
|
19
|
+
Project-URL: Homepage, https://kcl-lang.io
|
|
20
|
+
Project-URL: Repository, https://github.com/kcl-lang/kcl
|
|
21
|
+
|
|
22
|
+
# KCL Artifact Library for Python
|
|
23
|
+
|
|
24
|
+
## Developing
|
|
25
|
+
|
|
26
|
+
Setup virtualenv:
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
python3 -m venv venv
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Activate venv:
|
|
33
|
+
|
|
34
|
+
```shell
|
|
35
|
+
source venv/bin/activate
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
Install maturin:
|
|
39
|
+
|
|
40
|
+
```shell
|
|
41
|
+
cargo install maturin
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Build bindings:
|
|
45
|
+
|
|
46
|
+
```shell
|
|
47
|
+
maturin develop
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Test
|
|
51
|
+
|
|
52
|
+
```shell
|
|
53
|
+
python3 -m pytest
|
|
54
|
+
```
|
|
55
|
+
|