Compare commits
324 Commits
Author | SHA1 | Date | |
---|---|---|---|
c111c3813f | |||
42f173783f | |||
d8aeffc780 | |||
55b35a322e | |||
fa2b411b78 | |||
f933b716f4 | |||
8cf515b39f | |||
c209414459 | |||
a6638fb08a | |||
dee61d7b08 | |||
91dbd8bc07 | |||
b80be3ab47 | |||
e23c09d4dd | |||
3734729d22 | |||
0b99828bb6 | |||
7c13493e90 | |||
2ba2a2a771 | |||
77cd2c0956 | |||
4bb01c8473 | |||
cb1bc5f3cd | |||
fcd317aae4 | |||
8877a3c146 | |||
b8d1f92872 | |||
e7009146e4 | |||
a03bc56651 | |||
2833086f13 | |||
67da0afff9 | |||
573f4a8bc8 | |||
11a1948ebc | |||
137b1600a8 | |||
6ef6e60467 | |||
374a57746e | |||
20a61d19d1 | |||
782dc863d4 | |||
daab399185 | |||
e4370b6108 | |||
0403eddfd7 | |||
95f22c849d | |||
9fe98c9185 | |||
d90bc06ff4 | |||
e63cda47eb | |||
44e8b10185 | |||
533c43952c | |||
19ebe81f5b | |||
ff34befdd3 | |||
8b1c2fbc04 | |||
ae62d18ff3 | |||
22ee8f364a | |||
9948d645a4 | |||
23e631ea94 | |||
977396c615 | |||
34f46d5022 | |||
936e4adbf1 | |||
c19114f3d2 | |||
ab1740e2a5 | |||
667ef08235 | |||
dec4b2a6e3 | |||
4c12ac0506 | |||
d8b33f880f | |||
fec30b6abc | |||
3117c86ea4 | |||
8bb54b8382 | |||
08ac3093a8 | |||
152e2ccc0c | |||
ef6b1d9ca1 | |||
284a911a38 | |||
5c2d11d814 | |||
a26c922360 | |||
0ba1480511 | |||
ddb5f19a29 | |||
3c70a17d78 | |||
994b2de5c3 | |||
29d1308d0e | |||
4e0a5c1b44 | |||
f01cb3c62d | |||
908c7efe12 | |||
df3f38ba7d | |||
e5b9c1020c | |||
4a5411d0ca | |||
0422a9a4fd | |||
f622646127 | |||
b8f4106107 | |||
b32d37fc48 | |||
650a99936b | |||
b4d43b584b | |||
0d39b80547 | |||
d86f2560ac | |||
c5db75b131 | |||
0b33d376c2 | |||
95faa77326 | |||
39b183c731 | |||
f408eae3d2 | |||
2134a8e5de | |||
8d0ab1a2b8 | |||
efabead34c | |||
4d2468541c | |||
e7f966bea8 | |||
147dea9927 | |||
6f2330aa85 | |||
8e7d73973d | |||
8c9d476771 | |||
96a23c4672 | |||
4f88e5f0a7 | |||
a49aa621ed | |||
eb0380ef2d | |||
9414ebcc0b | |||
0c6b538605 | |||
905e2094de | |||
4623f854af | |||
3802dd36fc | |||
a046a9a82b | |||
c795346cd0 | |||
3bd4326f2c | |||
b08726834a | |||
26954ba9f8 | |||
20496480f7 | |||
2c8e9f90d7 | |||
197aa2fc55 | |||
4beba625ed | |||
67a03bdd03 | |||
30db5097ff | |||
b80b69b023 | |||
9bf4dead4f | |||
c727428359 | |||
055c3bdd8f | |||
55e0cbe58d | |||
851f986d32 | |||
61ddb1a6d8 | |||
63b0703ae8 | |||
c694322a52 | |||
0e24bc5311 | |||
42e76b4b83 | |||
774b8f079c | |||
ba8eeca234 | |||
c512fd7f8a | |||
4639d82900 | |||
39cfd257a8 | |||
82f3361603 | |||
e97a042552 | |||
65cb520fce | |||
d9067d3292 | |||
2ae59c5ca3 | |||
50313ec810 | |||
f262b62cb7 | |||
3237e02c10 | |||
374d5bd238 | |||
4933e0106c | |||
f825678307 | |||
be8df00e51 | |||
58192a56ff | |||
6103b11ab8 | |||
441db38ca2 | |||
61c79305dc | |||
73cb3ff917 | |||
7c4321306a | |||
49b8d2747a | |||
9dc390a64d | |||
929e7fe993 | |||
ada7da5eca | |||
829c9cb0fe | |||
4631ca24cb | |||
b9e1d6fda6 | |||
2efdf57ec3 | |||
7f7460d366 | |||
553db98e51 | |||
699532553b | |||
4acbbc84ce | |||
02dff4020c | |||
7375479cf2 | |||
24d6d17894 | |||
1e67d9d4bd | |||
53132b1fd8 | |||
a0146d9ea5 | |||
032f5b17d5 | |||
15ef98b356 | |||
dcd5015cae | |||
219a7f14c2 | |||
7f00e3aa25 | |||
85a22b9a2a | |||
a653ebbb66 | |||
d3dfc556e0 | |||
e96d50f4f0 | |||
16e30e893f | |||
d81e82cf9c | |||
7e536090ad | |||
429c341f84 | |||
5bcbf4251b | |||
f28df119ed | |||
9e96dffb3c | |||
be68a24e48 | |||
3e0545f4aa | |||
0f66979c90 | |||
16d7e95ce6 | |||
cb257a57d6 | |||
0ae59a5548 | |||
d9077a00ad | |||
a8d537e29c | |||
15d5bf50c1 | |||
17b517dd5a | |||
1408f075ee | |||
ed6b2c8e77 | |||
69c4f8ce70 | |||
216b454c14 | |||
0ed9aaf127 | |||
c1bc2a8f51 | |||
b7359511a4 | |||
26545d537f | |||
0ab0bd44a2 | |||
415f1d9619 | |||
31f5188454 | |||
363e9aea12 | |||
ca263dd395 | |||
1e2e9c0871 | |||
6db080ebc8 | |||
5247831f32 | |||
5e204bf872 | |||
9cbcebf665 | |||
fdc005a2f7 | |||
004daabdf9 | |||
a14fa0b099 | |||
020b19a3c2 | |||
d2ea7ddf66 | |||
6210725498 | |||
3531fd4197 | |||
1c94c0500c | |||
eae6825815 | |||
a11d9e9351 | |||
5d985a3e13 | |||
6b6de6ddf2 | |||
aa723677a3 | |||
3477374e44 | |||
f28d56915a | |||
cf3ab0f291 | |||
e53597609c | |||
3d8c49afe3 | |||
669b7aded0 | |||
0ceebbee9c | |||
ab01c82bb7 | |||
65e95eae3d | |||
5fcd6d048e | |||
89a450f697 | |||
653d2b21ee | |||
cbf5f4df6d | |||
2d90bb61be | |||
9c18ba2350 | |||
0b9c32e6bf | |||
b09684bd9e | |||
45ac31914d | |||
2a9ae9dc8d | |||
5b77fbdbd0 | |||
e0f88cf27a | |||
29b0d3b5d0 | |||
6c05eabb2c | |||
be59e657b9 | |||
bf83d1f1ba | |||
a99251b3b7 | |||
32479cfe2a | |||
2a3cec9aac | |||
e7aaaab78d | |||
f835e905a9 | |||
637df816fd | |||
cef71917e8 | |||
c865f88379 | |||
7dbafade7a | |||
3f9366e0c9 | |||
f69db1296b | |||
587ba78ada | |||
41127aa9d3 | |||
4bb7008d5d | |||
d8a9721d18 | |||
5d237a4eda | |||
30999f1cd3 | |||
fc6ea7af77 | |||
0d0afa4497 | |||
a4d57836f5 | |||
e9c5722b1d | |||
803c016174 | |||
2a5c28f9a9 | |||
5afd7562d4 | |||
afcc5b88c1 | |||
bd072b07a3 | |||
324e803f0e | |||
a757aaa633 | |||
37b2635a01 | |||
ab06822559 | |||
9678dabcb6 | |||
5a024a1949 | |||
00a7f93a94 | |||
9d3cf53570 | |||
ccc30676ef | |||
5c01da0271 | |||
a4cf10655f | |||
900d90fdb4 | |||
2ca2b5f87b | |||
12c5b1ba49 | |||
134c904d90 | |||
059dc0e521 | |||
dfa76e9462 | |||
abf4ce8e52 | |||
2761fc47f6 | |||
f3d080d971 | |||
00b5cd9288 | |||
5954a57a5d | |||
d40e7832a2 | |||
eb33fd8c9c | |||
5e7fe2f663 | |||
a4a74c780a | |||
2235d10966 | |||
cba4690d88 | |||
ce8338cc3e | |||
800ce9ccdf | |||
2895434602 | |||
c3cd16858a | |||
b0c71ad0f5 | |||
7c964a3d05 | |||
10b2aa4f2a | |||
ae1353ef82 | |||
613864cf42 | |||
3ee3ae9a6c | |||
7ee7964440 | |||
789f0b2a3b | |||
62b021d566 | |||
27266e32ec | |||
7b445af622 |
15
.github/dependabot.yml
vendored
Normal file
15
.github/dependabot.yml
vendored
Normal file
@ -0,0 +1,15 @@
|
||||
# To get started with Dependabot version updates, you'll need to specify which
|
||||
# package ecosystems to update and where the package manifests are located.
|
||||
# Please see the documentation for all configuration options:
|
||||
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
|
||||
|
||||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "pip" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
||||
- package-ecosystem: "github-actions" # See documentation for possible values
|
||||
directory: "/" # Location of package manifests
|
||||
schedule:
|
||||
interval: "daily"
|
38
.github/workflows/black.yml
vendored
Normal file
38
.github/workflows/black.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: black
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/black.yml
|
||||
- 'pyproject.toml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/black.yml
|
||||
- 'pyproject.toml'
|
||||
jobs:
|
||||
black:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
pip install \
|
||||
poetry
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
poetry install
|
||||
poetry build
|
||||
|
||||
- name: Run black
|
||||
shell: bash
|
||||
run: |
|
||||
poetry run black --check --diff . generate/generate.py docs/conf.py kittycad/client_test.py kittycad/examples_test.py
|
34
.github/workflows/build-test.yml
vendored
34
.github/workflows/build-test.yml
vendored
@ -5,22 +5,26 @@ on:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/build-test.yml
|
||||
- 'pyproject.toml'
|
||||
- 'spec.json'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/build-test.yml
|
||||
- 'pyproject.toml'
|
||||
- 'spec.json'
|
||||
jobs:
|
||||
build-test:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
python-version: [3.6, 3.7, 3.8, 3.9]
|
||||
python-version: [3.8, 3.9]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python ${{ matrix.python-version }}
|
||||
uses: actions/setup-python@v2
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: ${{ matrix.python-version }}
|
||||
|
||||
@ -29,21 +33,27 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
pip install \
|
||||
flake8 \
|
||||
poetry \
|
||||
pytest
|
||||
poetry
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
cd kittycad
|
||||
poetry install
|
||||
poetry build
|
||||
|
||||
- name: Lint with flake8
|
||||
- name: Run pytest
|
||||
shell: bash
|
||||
run: |
|
||||
# stop the build if there are Python syntax errors or undefined names
|
||||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
|
||||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
|
||||
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
|
||||
poetry run pytest --cov=./ --cov-report=xml kittycad
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
|
||||
- name: Upload coverage to Codecov
|
||||
uses: codecov/codecov-action@v3
|
||||
with:
|
||||
token: ${{ secrets.CODECOV_TOKEN }}
|
||||
fail_ci_if_error: true
|
||||
flags: unittests
|
||||
files: ${{ github.workspace }}/coverage.xml
|
||||
verbose: true
|
||||
|
||||
|
62
.github/workflows/generate-docs.yml
vendored
Normal file
62
.github/workflows/generate-docs.yml
vendored
Normal file
@ -0,0 +1,62 @@
|
||||
name: generate docs
|
||||
permissions:
|
||||
contents: write
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
paths:
|
||||
- docs/conf.py
|
||||
- '**.rst'
|
||||
- '**.py'
|
||||
- .github/workflows/generate-docs.yml
|
||||
jobs:
|
||||
generate-docs:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: 3.x
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
sudo apt update && sudo apt install -y \
|
||||
enchant-2 \
|
||||
--no-install-recommends
|
||||
pip install \
|
||||
poetry
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
poetry build
|
||||
|
||||
- name: Generate the docs
|
||||
shell: bash
|
||||
run: |
|
||||
rm -rf docs/html
|
||||
poetry install
|
||||
poetry run sphinx-build -b html docs/ docs/html/
|
||||
|
||||
- name: Check for modified files
|
||||
id: git-check
|
||||
run: echo ::set-output name=modified::$(if git diff-index --ignore-submodules --quiet HEAD --; then echo "false"; else echo "true"; fi)
|
||||
|
||||
- name: Commit changes, if any
|
||||
if: steps.git-check.outputs.modified == 'true'
|
||||
run: |
|
||||
git add .
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git commit -am "I HAVE GENERATED YOUR NEW DOCS!" || true
|
||||
git fetch origin
|
||||
git rebase origin/${{github.ref_name }} || true
|
||||
git push origin ${{github.ref_name }}
|
||||
|
||||
|
7
.github/workflows/generate.yml
vendored
7
.github/workflows/generate.yml
vendored
@ -6,6 +6,8 @@ on:
|
||||
paths:
|
||||
- 'Makefile'
|
||||
- .github/workflows/generate.yml
|
||||
- 'spec.json'
|
||||
- 'generate/generate.py'
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
jobs:
|
||||
@ -14,13 +16,15 @@ jobs:
|
||||
if: ${{ github.event.pull_request.head.repo.full_name == github.repository }}
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.ref }}
|
||||
- name: Run generate
|
||||
shell: bash
|
||||
run: |
|
||||
make generate
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
|
||||
- name: Check for modified files
|
||||
id: git-check
|
||||
@ -33,5 +37,6 @@ jobs:
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
|
||||
git fetch origin
|
||||
git add .
|
||||
git commit -am "I have generated the latest API!" || true
|
||||
git push origin ${{github.event.pull_request.head.ref }} || true
|
||||
|
5
.github/workflows/make-release.yml
vendored
5
.github/workflows/make-release.yml
vendored
@ -8,8 +8,8 @@ jobs:
|
||||
name: make-release
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/setup-python@v2
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.x'
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
@ -21,7 +21,6 @@ jobs:
|
||||
- name: Do the release
|
||||
shell: bash
|
||||
run: |
|
||||
cd kittycad
|
||||
poetry publish --build \
|
||||
--username ${{secrets.PYPI_USERNAME}} \
|
||||
--password ${{secrets.PYPI_SECRET}}
|
||||
|
38
.github/workflows/mypy.yml
vendored
Normal file
38
.github/workflows/mypy.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: mypy
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/mypy.yml
|
||||
- 'pyproject.toml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/mypy.yml
|
||||
- 'pyproject.toml'
|
||||
jobs:
|
||||
mypy:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
pip install \
|
||||
poetry
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
poetry install
|
||||
poetry build
|
||||
|
||||
- name: Run mypy
|
||||
shell: bash
|
||||
run: |
|
||||
poetry run mypy .
|
38
.github/workflows/ruff.yml
vendored
Normal file
38
.github/workflows/ruff.yml
vendored
Normal file
@ -0,0 +1,38 @@
|
||||
name: ruff
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/ruff.yml
|
||||
- 'pyproject.toml'
|
||||
pull_request:
|
||||
paths:
|
||||
- '**.py'
|
||||
- .github/workflows/ruff.yml
|
||||
- 'pyproject.toml'
|
||||
jobs:
|
||||
ruff:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v4
|
||||
|
||||
# Installation instructions are from: https://python-poetry.org/docs/
|
||||
- name: Install dependencies
|
||||
shell: bash
|
||||
run: |
|
||||
pip install \
|
||||
poetry
|
||||
|
||||
- name: Build
|
||||
shell: bash
|
||||
run: |
|
||||
poetry install
|
||||
poetry build
|
||||
|
||||
- name: Run ruff
|
||||
shell: bash
|
||||
run: |
|
||||
poetry run ruff check --format=github .
|
67
.github/workflows/update-spec-for-docs.yml
vendored
Normal file
67
.github/workflows/update-spec-for-docs.yml
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- v*
|
||||
pull_request:
|
||||
paths:
|
||||
- .github/workflows/update-spec-for-docs.yml
|
||||
workflow_dispatch:
|
||||
name: update spec for docs
|
||||
concurrency:
|
||||
group: docs-${{ github.ref }}
|
||||
cancel-in-progress: true
|
||||
jobs:
|
||||
update-spec:
|
||||
name: update-spec
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: make generate
|
||||
shell: bash
|
||||
run: |
|
||||
make generate
|
||||
env:
|
||||
KITTYCAD_API_TOKEN: ${{secrets.KITTYCAD_API_TOKEN}}
|
||||
# Ensure no files changed.
|
||||
- name: Ensure no files changed
|
||||
shell: bash
|
||||
run: |
|
||||
if [[ `git status --porcelain kittycad/` ]]; then
|
||||
echo "Files changed, exiting";
|
||||
exit 1;
|
||||
else
|
||||
# No changes
|
||||
echo "No files changed, proceeding";
|
||||
fi
|
||||
# Checkout the docs repo since we will want to update the files there.
|
||||
- uses: actions/checkout@v3
|
||||
with:
|
||||
repository: 'kittycad/website'
|
||||
path: 'docs'
|
||||
token: ${{secrets.PAT_GITHUB}}
|
||||
- name: move spec to docs
|
||||
shell: bash
|
||||
run: |
|
||||
rm docs/kittycad.py.patch.json || true
|
||||
cp kittycad.py.patch.json docs/kittycad.py.patch.json
|
||||
- name: commit the changes in the docs repo
|
||||
shell: bash
|
||||
run: |
|
||||
cd docs
|
||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git add .
|
||||
git commit -am "YOYO NEW SPEC PYTHON DOCS!" || exit 0
|
||||
git fetch origin
|
||||
git rebase origin/main || exit 0
|
||||
export NEW_BRANCH="update-spec-python"
|
||||
git checkout -b "$NEW_BRANCH"
|
||||
git push -f origin "$NEW_BRANCH"
|
||||
gh pr create --title "Update lang spec docs for python" \
|
||||
--body "Updating the generated docs for python" \
|
||||
--head "$NEW_BRANCH" \
|
||||
--base main || true
|
||||
env:
|
||||
GITHUB_TOKEN: ${{secrets.PAT_GITHUB}}
|
||||
|
||||
|
10
kittycad/.gitignore → .gitignore
vendored
10
kittycad/.gitignore → .gitignore
vendored
@ -20,4 +20,12 @@ dmypy.json
|
||||
.idea/
|
||||
|
||||
/coverage.xml
|
||||
/.coverage
|
||||
/.coverage
|
||||
|
||||
poetry.lock
|
||||
testing
|
||||
|
||||
# Sphinx documentation
|
||||
docs/_build/
|
||||
docs/_autosummary/
|
||||
docs/html/_sources/
|
10
Dockerfile
10
Dockerfile
@ -1,7 +1,13 @@
|
||||
FROM python:latest
|
||||
FROM python:3.9
|
||||
|
||||
RUN pip install \
|
||||
openapi-python-client
|
||||
poetry
|
||||
|
||||
WORKDIR /home/user/src/
|
||||
|
||||
COPY . /home/user/src/
|
||||
|
||||
RUN poetry update && poetry install
|
||||
|
||||
# Set the default command to bash.
|
||||
CMD ["bash"]
|
||||
|
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 KittyCAD
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
31
Makefile
31
Makefile
@ -5,20 +5,39 @@ ifeq ($(INTERACTIVE), 1)
|
||||
DOCKER_FLAGS += -t
|
||||
endif
|
||||
|
||||
# For this to work, you need to install toml-cli: https://github.com/gnprice/toml-cli
|
||||
# `cargo install toml-cli`
|
||||
VERSION := $(shell toml get $(CURDIR)/pyproject.toml tool.poetry.version | jq -r .)
|
||||
|
||||
.PHONY: generate
|
||||
generate: docker-image
|
||||
generate: docker-image ## Generate the api client.
|
||||
docker run --rm -i $(DOCKER_FLAGS) \
|
||||
--name python-generator \
|
||||
-v $(CURDIR):/usr/src \
|
||||
--workdir /usr/src \
|
||||
$(DOCKER_IMAGE_NAME) openapi-python-client update \
|
||||
--url https://api.kittycad.io \
|
||||
--config /usr/src/config.yml
|
||||
-e KITTYCAD_API_TOKEN \
|
||||
--disable-content-trust \
|
||||
-v $(CURDIR):/home/user/src \
|
||||
--workdir /home/user/src \
|
||||
$(DOCKER_IMAGE_NAME) ./generate/run.sh
|
||||
|
||||
.PHONY: shell
|
||||
shell: docker-image ## Pop into a shell in the docker image.
|
||||
docker run --rm -i $(DOCKER_FLAGS) \
|
||||
--name python-generator-shell \
|
||||
-e KITTYCAD_API_TOKEN \
|
||||
--disable-content-trust \
|
||||
-v $(CURDIR):/home/user/src \
|
||||
--workdir /home/user/src \
|
||||
$(DOCKER_IMAGE_NAME) /bin/bash
|
||||
|
||||
|
||||
.PHONY: docker-image
|
||||
docker-image:
|
||||
docker build -t $(DOCKER_IMAGE_NAME) .
|
||||
|
||||
.PHONY: tag
|
||||
tag: ## Create a new git tag to prepare to build a release.
|
||||
git tag -sa "v$(VERSION)" -m "v$(VERSION)"
|
||||
@echo "Run git push origin v$(VERSION) to push your new tag to GitHub and trigger a release."
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
|
@ -1,9 +1,12 @@
|
||||

|
||||
|
||||
# kittycad.py
|
||||
|
||||
The Python API client for KittyCAD.
|
||||
|
||||
This is generated from
|
||||
[openapi-generators/openapi-python-client](https://github.com/openapi-generators/openapi-python-client).
|
||||
- [PyPI](https://pypi.org/project/kittycad/)
|
||||
- [Python docs](https://python.api.docs.kittycad.io/)
|
||||
- [KittyCAD API Docs](https://docs.kittycad.io/?lang=python)
|
||||
|
||||
## Generating
|
||||
|
||||
|
1942
assets/testing.obj
Normal file
1942
assets/testing.obj
Normal file
File diff suppressed because it is too large
Load Diff
BIN
assets/testing.stl
Normal file
BIN
assets/testing.stl
Normal file
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
project_name_override: kittycad
|
||||
package_name_override: kittycad
|
33
docs/_templates/custom-class-template.rst
vendored
Normal file
33
docs/_templates/custom-class-template.rst
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
{{ fullname | escape | underline}}
|
||||
|
||||
.. currentmodule:: {{ module }}
|
||||
|
||||
.. autoclass:: {{ objname }}
|
||||
:members:
|
||||
:show-inheritance:
|
||||
:inherited-members:
|
||||
|
||||
{% block methods %}
|
||||
.. automethod:: __init__
|
||||
|
||||
{% if methods %}
|
||||
.. rubric:: {{ _('Methods') }}
|
||||
|
||||
.. autosummary::
|
||||
{% for item in methods %}
|
||||
~{{ name }}.{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block attributes %}
|
||||
{% if attributes %}
|
||||
.. rubric:: {{ _('Attributes') }}
|
||||
|
||||
.. autosummary::
|
||||
{% for item in attributes %}
|
||||
~{{ name }}.{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
67
docs/_templates/custom-module-template.rst
vendored
Normal file
67
docs/_templates/custom-module-template.rst
vendored
Normal file
@ -0,0 +1,67 @@
|
||||
{{ fullname | escape | underline}}
|
||||
|
||||
.. automodule:: {{ fullname }}
|
||||
|
||||
{% block attributes %}
|
||||
{% if attributes %}
|
||||
.. rubric:: Module Attributes
|
||||
|
||||
.. autosummary::
|
||||
:toctree:
|
||||
{% for item in attributes %}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block functions %}
|
||||
{% if functions %}
|
||||
.. rubric:: {{ _('Functions') }}
|
||||
|
||||
.. autosummary::
|
||||
:toctree:
|
||||
{% for item in functions %}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block classes %}
|
||||
{% if classes %}
|
||||
.. rubric:: {{ _('Classes') }}
|
||||
|
||||
.. autosummary::
|
||||
:toctree:
|
||||
:template: custom-class-template.rst
|
||||
{% for item in classes %}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block exceptions %}
|
||||
{% if exceptions %}
|
||||
.. rubric:: {{ _('Exceptions') }}
|
||||
|
||||
.. autosummary::
|
||||
:toctree:
|
||||
{% for item in exceptions %}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block modules %}
|
||||
{% if modules %}
|
||||
.. rubric:: Modules
|
||||
|
||||
.. autosummary::
|
||||
:toctree:
|
||||
:template: custom-module-template.rst
|
||||
:recursive:
|
||||
{% for item in modules %}
|
||||
{{ item }}
|
||||
{%- endfor %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
151
docs/conf.py
Normal file
151
docs/conf.py
Normal file
@ -0,0 +1,151 @@
|
||||
# Configuration file for the Sphinx documentation builder.
|
||||
#
|
||||
# This file only contains a selection of the most common options. For a full
|
||||
# list see the documentation:
|
||||
# https://www.sphinx-doc.org/en/master/usage/configuration.html
|
||||
|
||||
import datetime
|
||||
import os
|
||||
import pathlib
|
||||
import sys
|
||||
from typing import List
|
||||
|
||||
import toml
|
||||
|
||||
# The full version, including alpha/beta/rc tags
|
||||
# Get the version from the pyproject file.
|
||||
|
||||
ROOT = pathlib.Path(__file__).parent.parent
|
||||
PACKAGE_SRC = ROOT / "kittycad"
|
||||
|
||||
sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)))
|
||||
sys.path.append(os.path.abspath("../kittycad"))
|
||||
|
||||
# -- Project information -----------------------------------------------------
|
||||
|
||||
project = "kittycad"
|
||||
author = "KittyCAD Team Members"
|
||||
year = datetime.date.today().year
|
||||
copyright = str(year) + ", " + author
|
||||
|
||||
with open(os.path.abspath("../pyproject.toml"), "r") as f:
|
||||
parsed_toml = toml.load(f)
|
||||
version = parsed_toml["tool"]["poetry"]["version"]
|
||||
version = "v" + version
|
||||
|
||||
|
||||
release = version
|
||||
language = "en"
|
||||
default_role = "any"
|
||||
|
||||
|
||||
# -- General configuration ---------------------------------------------------
|
||||
|
||||
# Add any Sphinx extension module names here, as strings. They can be
|
||||
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
|
||||
# ones.
|
||||
extensions = [
|
||||
"autoclasstoc",
|
||||
"sphinx.ext.autodoc",
|
||||
"sphinx.ext.autosectionlabel",
|
||||
"sphinx.ext.autosummary",
|
||||
"sphinx.ext.coverage",
|
||||
"sphinx.ext.doctest",
|
||||
"sphinx.ext.graphviz",
|
||||
"sphinx.ext.imgconverter",
|
||||
"sphinx.ext.intersphinx",
|
||||
"sphinx.ext.linkcode",
|
||||
"sphinx.ext.mathjax",
|
||||
"sphinx.ext.napoleon",
|
||||
"sphinx.ext.viewcode",
|
||||
"sphinx_autodoc_typehints",
|
||||
"sphinx_rtd_theme",
|
||||
"sphinx_copybutton",
|
||||
"sphinxext.opengraph",
|
||||
]
|
||||
|
||||
numpydoc_show_class_members = False
|
||||
|
||||
# Add any paths that contain templates here, relative to this directory.
|
||||
templates_path = ["_templates"]
|
||||
|
||||
# List of patterns, relative to source directory, that match files and
|
||||
# directories to ignore when looking for source files.
|
||||
# This pattern also affects html_static_path and html_extra_path.
|
||||
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
|
||||
|
||||
|
||||
# -- Options for HTML output -------------------------------------------------
|
||||
|
||||
# The theme to use for HTML and HTML Help pages. See the documentation for
|
||||
# a list of builtin themes.
|
||||
#
|
||||
html_theme = "sphinx_rtd_theme"
|
||||
|
||||
# Add any paths that contain custom themes here, relative to this directory.
|
||||
html_theme_path: List[str] = []
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
# so a file named "default.css" will overwrite the builtin "default.css".
|
||||
html_static_path: List[str] = []
|
||||
|
||||
# The name of the Pygments (syntax highlighting) style to use.
|
||||
pygments_style = "trac"
|
||||
|
||||
# pygments_style = "lovelace"
|
||||
# pygments_dark_style = "one-dark"
|
||||
|
||||
# -- autodoc --
|
||||
|
||||
autodoc_default_options = {
|
||||
"members": True,
|
||||
"special-members": True,
|
||||
"private-members": True,
|
||||
"inherited-members": True,
|
||||
"undoc-members": True,
|
||||
"exclude-members": "__weakref__",
|
||||
}
|
||||
|
||||
autodoc_inherit_docstrings = True
|
||||
|
||||
# -- autosummary --
|
||||
|
||||
autosummary_generate = True
|
||||
autoclass_content = "both"
|
||||
html_show_sourcelink = False
|
||||
set_type_checking_flag = True
|
||||
|
||||
# -- autosectionlabel --
|
||||
|
||||
autosectionlabel_prefix_document = True
|
||||
|
||||
# -- intersphinx --
|
||||
|
||||
intersphinx_mapping = {
|
||||
"python": ("https://docs.python.org/3", None),
|
||||
}
|
||||
|
||||
# This is a function linkcode_resolve(domain, info), which should return the URL
|
||||
# to source code corresponding to the object in given domain with given information.
|
||||
# FROM: https://www.sphinx-doc.org/en/master/usage/extensions/linkcode.html
|
||||
def linkcode_resolve(domain, info):
|
||||
if domain != "py":
|
||||
return None
|
||||
if not info["module"]:
|
||||
return None
|
||||
filename = info["module"].replace(".", "/")
|
||||
return "https://github.com/kittycad/kittycad.py/%s.py" % filename
|
||||
|
||||
|
||||
# Spell checker.
|
||||
try:
|
||||
import enchant # noqa # pylint: disable=unused-import
|
||||
except ImportError as ex:
|
||||
print(
|
||||
"enchant module import failed:\n" "{0}\n" "Spell checking disabled.".format(ex),
|
||||
file=sys.stderr,
|
||||
)
|
||||
else:
|
||||
extensions.append("sphinxcontrib.spelling")
|
||||
spelling_show_suggestions = True
|
4
docs/html/.buildinfo
Normal file
4
docs/html/.buildinfo
Normal file
@ -0,0 +1,4 @@
|
||||
# Sphinx build info version 1
|
||||
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
|
||||
config: cd3bba1878bfa92a239de9b4e9758963
|
||||
tags: 645f666f9bcd5a90fca523b33c5a78b7
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
docs/html/.doctrees/_autosummary/kittycad.api.ai.doctree
Normal file
BIN
docs/html/.doctrees/_autosummary/kittycad.api.ai.doctree
Normal file
Binary file not shown.
BIN
docs/html/.doctrees/_autosummary/kittycad.api.api_calls.doctree
Normal file
BIN
docs/html/.doctrees/_autosummary/kittycad.api.api_calls.doctree
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
docs/html/.doctrees/_autosummary/kittycad.api.api_tokens.doctree
Normal file
BIN
docs/html/.doctrees/_autosummary/kittycad.api.api_tokens.doctree
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user