mirror of
https://github.com/yeicor-3d/yet-another-cad-viewer.git
synced 2025-12-19 22:24:17 +01:00
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c2656d7db | ||
|
|
161d76ee69 | ||
|
|
431c41a615 | ||
|
|
7144eb39da | ||
|
|
8e1c89ad6d | ||
|
|
7f692c0b52 | ||
|
|
86043132a8 | ||
|
|
23b4d25464 | ||
|
|
22514d8603 | ||
|
|
b440a89b13 | ||
|
|
cbdb5aff5e | ||
|
|
a3a9258a78 |
10
.github/workflows/build.yml
vendored
10
.github/workflows/build.yml
vendored
@@ -19,6 +19,8 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
- uses: "actions/setup-node@v4"
|
- uses: "actions/setup-node@v4"
|
||||||
with:
|
with:
|
||||||
cache: "yarn"
|
cache: "yarn"
|
||||||
@@ -35,6 +37,8 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
- run: "pipx install poetry"
|
- run: "pipx install poetry"
|
||||||
- uses: "actions/setup-python@v5"
|
- uses: "actions/setup-python@v5"
|
||||||
with:
|
with:
|
||||||
@@ -48,6 +52,8 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
- run: "pipx install poetry"
|
- run: "pipx install poetry"
|
||||||
- uses: "actions/setup-python@v5"
|
- uses: "actions/setup-python@v5"
|
||||||
with:
|
with:
|
||||||
@@ -66,13 +72,15 @@ jobs:
|
|||||||
runs-on: "ubuntu-latest"
|
runs-on: "ubuntu-latest"
|
||||||
steps:
|
steps:
|
||||||
- uses: "actions/checkout@v4"
|
- uses: "actions/checkout@v4"
|
||||||
|
with:
|
||||||
|
ref: "${{ inputs.ref }}"
|
||||||
- run: "pipx install poetry"
|
- run: "pipx install poetry"
|
||||||
- uses: "actions/setup-python@v5"
|
- uses: "actions/setup-python@v5"
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
cache: "poetry"
|
cache: "poetry"
|
||||||
- run: "SKIP_BUILD_FRONTEND=true poetry install"
|
- run: "SKIP_BUILD_FRONTEND=true poetry install"
|
||||||
- run: "PYTHONPATH=yacv_server YACV_DISABLE_SERVER=true poetry run python example/object.py"
|
- run: "YACV_DISABLE_SERVER=true poetry run python example/object.py"
|
||||||
- uses: "actions/upload-artifact@v4"
|
- uses: "actions/upload-artifact@v4"
|
||||||
with:
|
with:
|
||||||
name: "example"
|
name: "example"
|
||||||
|
|||||||
2
.github/workflows/deploy1.yml
vendored
2
.github/workflows/deploy1.yml
vendored
@@ -43,7 +43,7 @@ jobs:
|
|||||||
if git commit -am "Automatically update version to $CLEAN_VERSION"; then
|
if git commit -am "Automatically update version to $CLEAN_VERSION"; then
|
||||||
git push
|
git push
|
||||||
# Move the tag to the new commit
|
# Move the tag to the new commit
|
||||||
git tag -f -a "$CLEAN_VERSION" -m "$CLEAN_VERSION"
|
git tag -f -a "v$CLEAN_VERSION" -m "v$CLEAN_VERSION"
|
||||||
git push -f --tags # Force push the tag to GitHub
|
git push -f --tags # Force push the tag to GitHub
|
||||||
# The tag move will NOT trigger a new workflow
|
# The tag move will NOT trigger a new workflow
|
||||||
else
|
else
|
||||||
|
|||||||
35
.github/workflows/deploy2.yml
vendored
35
.github/workflows/deploy2.yml
vendored
@@ -32,24 +32,14 @@ jobs:
|
|||||||
name: "github-pages"
|
name: "github-pages"
|
||||||
url: "${{ steps.deployment.outputs.page_url }}"
|
url: "${{ steps.deployment.outputs.page_url }}"
|
||||||
steps:
|
steps:
|
||||||
- uses: "dawidd6/action-download-artifact@v3"
|
- uses: "actions/download-artifact@v4"
|
||||||
with:
|
with: # Downloads all artifacts from the build job
|
||||||
workflow: "build.yml"
|
|
||||||
name: "frontend"
|
|
||||||
path: "./public"
|
path: "./public"
|
||||||
allow_forks: false
|
- run: | # Merge the subdirectories of public into a single directory
|
||||||
- uses: "dawidd6/action-download-artifact@v3"
|
for dir in public/*; do
|
||||||
with:
|
mv "$dir/"* public/
|
||||||
workflow: "build.yml"
|
rmdir "$dir"
|
||||||
name: "logo"
|
done
|
||||||
path: "./public"
|
|
||||||
allow_forks: false
|
|
||||||
- uses: "dawidd6/action-download-artifact@v3"
|
|
||||||
with:
|
|
||||||
workflow: "build.yml"
|
|
||||||
name: "example"
|
|
||||||
path: "./public"
|
|
||||||
allow_forks: false
|
|
||||||
- uses: "actions/configure-pages@v4"
|
- uses: "actions/configure-pages@v4"
|
||||||
- uses: "actions/upload-pages-artifact@v3"
|
- uses: "actions/upload-pages-artifact@v3"
|
||||||
with:
|
with:
|
||||||
@@ -74,7 +64,12 @@ jobs:
|
|||||||
- uses: "actions/setup-node@v4"
|
- uses: "actions/setup-node@v4"
|
||||||
with:
|
with:
|
||||||
cache: "yarn"
|
cache: "yarn"
|
||||||
- uses: "JRubics/poetry-publish@v2.0"
|
- run: "pipx install poetry"
|
||||||
|
- uses: "actions/setup-python@v5"
|
||||||
with:
|
with:
|
||||||
python_version: "3.11"
|
python-version: "3.11"
|
||||||
pypi_token: "${{ secrets.PYPI_TOKEN }}"
|
cache: "poetry"
|
||||||
|
- run: "poetry install"
|
||||||
|
- run: "poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}"
|
||||||
|
- run: "poetry publish --build"
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "yet-another-cad-viewer",
|
"name": "yet-another-cad-viewer",
|
||||||
"version": "0.6.8",
|
"version": "0.6.13",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"private": true,
|
"private": true,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[tool.poetry]
|
[tool.poetry]
|
||||||
name = "yacv-server"
|
name = "yacv-server"
|
||||||
version = "0.6.8"
|
version = "0.6.13"
|
||||||
description = "Yet Another CAD Viewer (server)"
|
description = "Yet Another CAD Viewer (server)"
|
||||||
authors = ["Yeicor <4929005+Yeicor@users.noreply.github.com>"]
|
authors = ["Yeicor <4929005+Yeicor@users.noreply.github.com>"]
|
||||||
license = "MIT"
|
license = "MIT"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import os
|
import os
|
||||||
|
|
||||||
from cad import image_to_gltf
|
from yacv_server.cad import image_to_gltf
|
||||||
from yacv_server.yacv import YACV
|
from yacv_server.yacv import YACV
|
||||||
|
|
||||||
yacv = YACV()
|
yacv = YACV()
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ from http.server import SimpleHTTPRequestHandler
|
|||||||
|
|
||||||
from iterators import TimeoutIterator
|
from iterators import TimeoutIterator
|
||||||
|
|
||||||
from mylogger import logger
|
from yacv_server.mylogger import logger
|
||||||
|
|
||||||
# Find the frontend folder (optional, but recommended)
|
# Find the frontend folder (optional, but recommended)
|
||||||
FILE_DIR = os.path.dirname(__file__)
|
FILE_DIR = os.path.dirname(__file__)
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ from OCP.TopoDS import TopoDS_Shape
|
|||||||
from build123d import Shape, Axis, Location, Vector
|
from build123d import Shape, Axis, Location, Vector
|
||||||
from dataclasses_json import dataclass_json
|
from dataclasses_json import dataclass_json
|
||||||
|
|
||||||
from myhttp import HTTPHandler
|
|
||||||
from yacv_server.cad import get_shape, grab_all_cad, CADCoreLike, CADLike
|
from yacv_server.cad import get_shape, grab_all_cad, CADCoreLike, CADLike
|
||||||
|
from yacv_server.myhttp import HTTPHandler
|
||||||
from yacv_server.mylogger import logger
|
from yacv_server.mylogger import logger
|
||||||
from yacv_server.pubsub import BufferedPubSub
|
from yacv_server.pubsub import BufferedPubSub
|
||||||
from yacv_server.tessellate import _hashcode, tessellate
|
from yacv_server.tessellate import _hashcode, tessellate
|
||||||
@@ -302,10 +302,10 @@ def _preprocess_cad(obj: CADLike, **kwargs) -> CADCoreLike:
|
|||||||
_find_var_name_count = 0
|
_find_var_name_count = 0
|
||||||
|
|
||||||
|
|
||||||
def _find_var_name(obj: any) -> str:
|
def _find_var_name(obj: any, avoid_levels: int = 2) -> str:
|
||||||
"""A hacky way to get a stable name for an object that may change over time"""
|
"""A hacky way to get a stable name for an object that may change over time"""
|
||||||
global _find_var_name_count
|
global _find_var_name_count
|
||||||
for frame in inspect.stack():
|
for frame in inspect.stack()[avoid_levels:]:
|
||||||
for key, value in frame.frame.f_locals.items():
|
for key, value in frame.frame.f_locals.items():
|
||||||
if value is obj:
|
if value is obj:
|
||||||
return key
|
return key
|
||||||
|
|||||||
Reference in New Issue
Block a user