keygen-py 0.0.1.dev5__tar.gz → 0.0.1.dev6__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.
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/.github/workflows/pr-checks.yml +41 -2
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/.github/workflows/release.yml +44 -5
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/.gitignore +4 -1
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/PKG-INFO +1 -1
- keygen_py-0.0.1.dev6/conda-recipe/LICENSE +21 -0
- keygen_py-0.0.1.dev6/conda-recipe/recipe.yaml +46 -0
- keygen_py-0.0.1.dev6/conda-recipe/variants.yaml +5 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/pyproject.toml +1 -1
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/src/config.rs +5 -4
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/src/lib.rs +2 -2
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/src/license.rs +3 -3
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/Cargo.lock +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/Cargo.toml +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/LICENSE +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/README.md +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/examples/offline_verification.py +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/examples/online_validation.py +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/keygen_sh.pyi +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/poetry.lock +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/src/date.rs +0 -0
- {keygen_py-0.0.1.dev5 → keygen_py-0.0.1.dev6}/src/utils.rs +0 -0
|
@@ -9,9 +9,22 @@ on:
|
|
|
9
9
|
permissions:
|
|
10
10
|
contents: read
|
|
11
11
|
|
|
12
|
+
# Make sure CI fails on all warnings, including Clippy lints
|
|
13
|
+
env:
|
|
14
|
+
RUSTFLAGS: "-Dwarnings"
|
|
15
|
+
|
|
12
16
|
jobs:
|
|
17
|
+
lint:
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
steps:
|
|
20
|
+
- uses: actions/checkout@v4
|
|
21
|
+
- name: Run Clippy
|
|
22
|
+
run: cargo clippy --all-targets --all-features
|
|
23
|
+
|
|
13
24
|
build:
|
|
14
25
|
name: ${{ matrix.platform.runner }} ${{ matrix.platform.target }} ${{ matrix.platform.manylinux }}
|
|
26
|
+
needs:
|
|
27
|
+
- lint
|
|
15
28
|
runs-on: ${{ matrix.platform.runner }}
|
|
16
29
|
strategy:
|
|
17
30
|
fail-fast: true
|
|
@@ -19,8 +32,10 @@ jobs:
|
|
|
19
32
|
platform:
|
|
20
33
|
- runner: ubuntu-latest
|
|
21
34
|
target: x86_64
|
|
35
|
+
target-platform: linux-64
|
|
22
36
|
before: 'yum install --assumeyes perl-core'
|
|
23
37
|
manylinux: 'auto'
|
|
38
|
+
create-conda-package: true
|
|
24
39
|
- runner: ubuntu-latest
|
|
25
40
|
target: x86_64
|
|
26
41
|
before: 'apt update && apt install -y libssl-dev'
|
|
@@ -54,23 +69,37 @@ jobs:
|
|
|
54
69
|
manylinux: 'musllinux_1_2'
|
|
55
70
|
- runner: windows-latest
|
|
56
71
|
target: x64
|
|
72
|
+
target-platform: win-64
|
|
73
|
+
create-conda-package: true
|
|
57
74
|
- runner: windows-latest
|
|
58
75
|
target: x86
|
|
59
76
|
- runner: macos-latest
|
|
60
77
|
target: x86_64
|
|
78
|
+
target-platform: osx-64
|
|
79
|
+
create-conda-package: true
|
|
61
80
|
- runner: macos-latest
|
|
62
81
|
target: aarch64
|
|
82
|
+
target-platform: osx-arm64
|
|
83
|
+
create-conda-package: true
|
|
63
84
|
steps:
|
|
64
85
|
- uses: actions/checkout@v4
|
|
65
86
|
- uses: actions/setup-python@v5
|
|
66
87
|
if: runner.os == 'Windows'
|
|
67
88
|
with:
|
|
68
|
-
python-version:
|
|
89
|
+
python-version: |
|
|
90
|
+
3.9
|
|
91
|
+
3.10
|
|
92
|
+
3.11
|
|
93
|
+
3.12
|
|
69
94
|
architecture: ${{ matrix.platform.target }}
|
|
70
95
|
- uses: actions/setup-python@v5
|
|
71
96
|
if: runner.os != 'Windows'
|
|
72
97
|
with:
|
|
73
|
-
python-version:
|
|
98
|
+
python-version: |
|
|
99
|
+
3.9
|
|
100
|
+
3.10
|
|
101
|
+
3.11
|
|
102
|
+
3.12
|
|
74
103
|
- name: Build wheels
|
|
75
104
|
uses: PyO3/maturin-action@v1
|
|
76
105
|
with:
|
|
@@ -79,9 +108,19 @@ jobs:
|
|
|
79
108
|
sccache: 'true'
|
|
80
109
|
manylinux: ${{ matrix.platform.manylinux }}
|
|
81
110
|
before-script-linux: ${{ matrix.platform.before }}
|
|
111
|
+
- name: Build conda package
|
|
112
|
+
if: matrix.platform.create-conda-package
|
|
113
|
+
uses: prefix-dev/rattler-build-action@v0.2.19
|
|
114
|
+
with:
|
|
115
|
+
upload-artifact: false
|
|
116
|
+
artifact-name: conda-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
|
|
117
|
+
recipe-path: 'conda-recipe/recipe.yaml'
|
|
118
|
+
build-args: '--target-platform ${{ matrix.platform.target-platform }} --experimental'
|
|
82
119
|
|
|
83
120
|
sdist:
|
|
84
121
|
runs-on: ubuntu-latest
|
|
122
|
+
needs:
|
|
123
|
+
- lint
|
|
85
124
|
steps:
|
|
86
125
|
- uses: actions/checkout@v4
|
|
87
126
|
- name: Build sdist
|
|
@@ -18,8 +18,10 @@ jobs:
|
|
|
18
18
|
platform:
|
|
19
19
|
- runner: ubuntu-latest
|
|
20
20
|
target: x86_64
|
|
21
|
+
target-platform: linux-64
|
|
21
22
|
before: 'yum install --assumeyes perl-core'
|
|
22
23
|
manylinux: 'auto'
|
|
24
|
+
create-conda-package: true
|
|
23
25
|
- runner: ubuntu-latest
|
|
24
26
|
target: x86_64
|
|
25
27
|
before: 'apt update && apt install -y libssl-dev'
|
|
@@ -53,23 +55,37 @@ jobs:
|
|
|
53
55
|
manylinux: 'musllinux_1_2'
|
|
54
56
|
- runner: windows-latest
|
|
55
57
|
target: x64
|
|
58
|
+
target-platform: win-64
|
|
59
|
+
create-conda-package: true
|
|
56
60
|
- runner: windows-latest
|
|
57
61
|
target: x86
|
|
58
62
|
- runner: macos-latest
|
|
59
63
|
target: x86_64
|
|
64
|
+
target-platform: osx-64
|
|
65
|
+
create-conda-package: true
|
|
60
66
|
- runner: macos-latest
|
|
61
67
|
target: aarch64
|
|
68
|
+
target-platform: osx-arm64
|
|
69
|
+
create-conda-package: true
|
|
62
70
|
steps:
|
|
63
71
|
- uses: actions/checkout@v4
|
|
64
72
|
- uses: actions/setup-python@v5
|
|
65
73
|
if: runner.os == 'Windows'
|
|
66
74
|
with:
|
|
67
|
-
python-version:
|
|
75
|
+
python-version: |
|
|
76
|
+
3.9
|
|
77
|
+
3.10
|
|
78
|
+
3.11
|
|
79
|
+
3.12
|
|
68
80
|
architecture: ${{ matrix.platform.target }}
|
|
69
81
|
- uses: actions/setup-python@v5
|
|
70
82
|
if: runner.os != 'Windows'
|
|
71
83
|
with:
|
|
72
|
-
python-version:
|
|
84
|
+
python-version: |
|
|
85
|
+
3.9
|
|
86
|
+
3.10
|
|
87
|
+
3.11
|
|
88
|
+
3.12
|
|
73
89
|
- name: Build wheels
|
|
74
90
|
uses: PyO3/maturin-action@v1
|
|
75
91
|
with:
|
|
@@ -83,6 +99,14 @@ jobs:
|
|
|
83
99
|
with:
|
|
84
100
|
name: wheels-${{ matrix.platform.runner }}-${{ matrix.platform.manylinux }}-${{ matrix.platform.target }}
|
|
85
101
|
path: dist
|
|
102
|
+
- name: Build conda package
|
|
103
|
+
if: matrix.platform.create-conda-package
|
|
104
|
+
uses: prefix-dev/rattler-build-action@v0.2.19
|
|
105
|
+
with:
|
|
106
|
+
upload-artifact: true
|
|
107
|
+
artifact-name: conda-${{ matrix.platform.runner }}-${{ matrix.platform.target }}
|
|
108
|
+
recipe-path: 'conda-recipe/recipe.yaml'
|
|
109
|
+
build-args: '--target-platform ${{ matrix.platform.target-platform }} --experimental'
|
|
86
110
|
|
|
87
111
|
sdist:
|
|
88
112
|
runs-on: ubuntu-latest
|
|
@@ -99,6 +123,7 @@ jobs:
|
|
|
99
123
|
name: wheels-sdist
|
|
100
124
|
path: dist
|
|
101
125
|
|
|
126
|
+
|
|
102
127
|
release:
|
|
103
128
|
name: Release
|
|
104
129
|
runs-on: ubuntu-latest
|
|
@@ -109,16 +134,30 @@ jobs:
|
|
|
109
134
|
attestations: write
|
|
110
135
|
steps:
|
|
111
136
|
- uses: actions/checkout@v4
|
|
137
|
+
- name: Install rattler-build
|
|
138
|
+
run: |
|
|
139
|
+
mkdir -p ${{ runner.temp }}/rattler-build
|
|
140
|
+
curl -Ls \
|
|
141
|
+
https://github.com/prefix-dev/rattler-build/releases/latest/download/rattler-build-x86_64-unknown-linux-musl \
|
|
142
|
+
-o ${{ runner.temp }}/rattler-build/rattler-build
|
|
143
|
+
chmod +x ${{ runner.temp }}/rattler-build/rattler-build
|
|
144
|
+
echo ${{ runner.temp }}/rattler-build >> $GITHUB_PATH
|
|
112
145
|
- uses: actions/download-artifact@v4
|
|
113
146
|
- name: Generate artifact attestation
|
|
114
147
|
uses: actions/attest-build-provenance@v1
|
|
115
148
|
with:
|
|
116
|
-
subject-path:
|
|
117
|
-
|
|
149
|
+
subject-path: |
|
|
150
|
+
wheels-*/*
|
|
151
|
+
conda-*/*
|
|
118
152
|
- name: Get project version
|
|
119
153
|
id: 'pyproject_version'
|
|
120
154
|
run: echo "version=v$(grep -m 1 version pyproject.toml | tr -s ' ' | tr -d '"' | tr -d "'" | cut -d' ' -f3)" >> $GITHUB_OUTPUT
|
|
121
|
-
|
|
155
|
+
- name: Publish to prefix.dev channel
|
|
156
|
+
run: |
|
|
157
|
+
for pkg in $(find conda-*/* -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
|
|
158
|
+
echo "Uploading ${pkg}"
|
|
159
|
+
rattler-build upload prefix -c terraquantumag "${pkg}"
|
|
160
|
+
done
|
|
122
161
|
- name: Publish to PyPI
|
|
123
162
|
uses: PyO3/maturin-action@v1
|
|
124
163
|
env:
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: keygen-py
|
|
3
|
-
Version: 0.0.1.
|
|
3
|
+
Version: 0.0.1.dev6
|
|
4
4
|
License-File: LICENSE
|
|
5
5
|
Summary: Unofficial Keygen SDK for Python. Integrate license activation and offline licensing. Wrapper around keygen-rs rust crate
|
|
6
6
|
Author-email: Terra Quantum AG <info@terraquantum.swiss>, Cedric Kring <ck@terraquantum.swiss>, Steven Beckers <sb@terraquantum.swiss>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Terra Quantum AG
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
schema_version: 1
|
|
2
|
+
|
|
3
|
+
context:
|
|
4
|
+
name: ${{ load_from_file("pyproject.toml").project.name }}
|
|
5
|
+
version: ${{ load_from_file("pyproject.toml").project.version }}
|
|
6
|
+
|
|
7
|
+
package:
|
|
8
|
+
name: ${{ name|lower }}
|
|
9
|
+
version: ${{ version }}
|
|
10
|
+
|
|
11
|
+
source:
|
|
12
|
+
path: ../dist
|
|
13
|
+
use_gitignore: false
|
|
14
|
+
|
|
15
|
+
build:
|
|
16
|
+
script: pip install --find-links . keygen-py
|
|
17
|
+
number: 0
|
|
18
|
+
|
|
19
|
+
requirements:
|
|
20
|
+
build:
|
|
21
|
+
- python
|
|
22
|
+
host:
|
|
23
|
+
- python
|
|
24
|
+
- pip
|
|
25
|
+
- setuptools
|
|
26
|
+
- wheel
|
|
27
|
+
run:
|
|
28
|
+
- python
|
|
29
|
+
|
|
30
|
+
tests:
|
|
31
|
+
- python:
|
|
32
|
+
imports:
|
|
33
|
+
- keygen_sh
|
|
34
|
+
pip_check: true
|
|
35
|
+
|
|
36
|
+
about:
|
|
37
|
+
summary: Unofficial Keygen SDK for Python. Integrate license activation and offline licensing. Wrapper around keygen-rs rust crate
|
|
38
|
+
license: MIT
|
|
39
|
+
license_file: LICENSE
|
|
40
|
+
homepage: https://github.com/terra-quantum-public/keygen-py
|
|
41
|
+
|
|
42
|
+
extra:
|
|
43
|
+
recipe-maintainers:
|
|
44
|
+
- sbtq
|
|
45
|
+
- cedrictq
|
|
46
|
+
|
|
@@ -13,6 +13,7 @@ impl KeygenConfig {
|
|
|
13
13
|
#[pyo3(signature = (api_url, api_version, api_prefix, account, product, package=None, environment=None, license_key=None, token=None, public_key=None, platform=None, user_agent=None, max_clock_drift=5)
|
|
14
14
|
)]
|
|
15
15
|
#[new]
|
|
16
|
+
#[allow(clippy::too_many_arguments)]
|
|
16
17
|
pub fn new(api_url: String,
|
|
17
18
|
api_version: String,
|
|
18
19
|
api_prefix: String,
|
|
@@ -34,7 +35,7 @@ impl KeygenConfig {
|
|
|
34
35
|
api_prefix,
|
|
35
36
|
account,
|
|
36
37
|
product,
|
|
37
|
-
package: package.
|
|
38
|
+
package: package.unwrap_or("".to_string()),
|
|
38
39
|
environment,
|
|
39
40
|
license_key,
|
|
40
41
|
token,
|
|
@@ -47,8 +48,8 @@ impl KeygenConfig {
|
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
50
|
|
|
50
|
-
impl
|
|
51
|
-
fn
|
|
52
|
-
|
|
51
|
+
impl From<KeygenConfig> for config::KeygenConfig {
|
|
52
|
+
fn from(val: KeygenConfig) -> Self {
|
|
53
|
+
val.inner
|
|
53
54
|
}
|
|
54
55
|
}
|
|
@@ -29,8 +29,8 @@ fn validate<'a>(py: Python<'a>, fingerprints: Option<Bound<'a, PyList>>, entitle
|
|
|
29
29
|
let fingerprints = fingerprints.unwrap_or_else(|| PyList::empty_bound(py));
|
|
30
30
|
let entitlements = entitlements.unwrap_or_else(|| PyList::empty_bound(py));
|
|
31
31
|
|
|
32
|
-
let fingerprints_vec = pylist_to_string_slice(fingerprints
|
|
33
|
-
let entitlements_vec = pylist_to_string_slice(entitlements
|
|
32
|
+
let fingerprints_vec = pylist_to_string_slice(fingerprints)?;
|
|
33
|
+
let entitlements_vec = pylist_to_string_slice(entitlements)?;
|
|
34
34
|
|
|
35
35
|
pyo3_async_runtimes::tokio::future_into_py(py, async move {
|
|
36
36
|
let result = keygen_rs::validate(&fingerprints_vec, &entitlements_vec).await;
|
|
@@ -36,9 +36,9 @@ impl License {
|
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
impl
|
|
40
|
-
fn
|
|
41
|
-
match
|
|
39
|
+
impl From<SchemeCode> for license::SchemeCode {
|
|
40
|
+
fn from(val: SchemeCode) -> Self {
|
|
41
|
+
match val {
|
|
42
42
|
SchemeCode::Ed25519Sign => license::SchemeCode::Ed25519Sign,
|
|
43
43
|
}
|
|
44
44
|
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|