Skip to content

Commit 3730ad5

Browse files
authored
Merge pull request #444 from compas-dev/gh-cpython
Gh cpython -> `LTS-main-1.x`
2 parents 42a8f8e + 8bcf410 commit 3730ad5

File tree

94 files changed

+2054
-158
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+2054
-158
lines changed

.github/workflows/build.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
branches:
66
- main
7+
- LTS-main-1.x
78
pull_request:
89
branches:
910
- main
11+
- LTS-main-1.x
1012

1113
jobs:
1214
build:
@@ -15,7 +17,7 @@ jobs:
1517
strategy:
1618
matrix:
1719
os: [ubuntu-latest, macos-latest, windows-latest]
18-
python: ['3.8', '3.9', '3.10']
20+
python: ['3.9', '3.10', '3.11', '3.12', '3.13']
1921

2022
steps:
2123
- uses: compas-dev/compas-actions.build@v3

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
push:
55
branches:
66
- main
7+
- LTS-main-1.x
78
tags:
89
- 'v*'
910
pull_request_review:

.github/workflows/integration.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,25 @@ on:
44
push:
55
branches:
66
- main
7+
- LTS-main-1.x
78
pull_request:
89
branches:
910
- main
11+
- LTS-main-1.x
1012

1113
jobs:
1214
build:
13-
name: ubuntu-py38-integration
15+
name: ubuntu-py311-integration
1416
runs-on: ubuntu-latest
1517
steps:
1618
- uses: actions/checkout@v2
17-
- name: Set up Python 3.8
19+
- name: Set up Python 3.11
1820
uses: actions/setup-python@v2
1921
with:
20-
python-version: 3.8
22+
python-version: '3.11'
2123
- name: Set up docker containers
2224
run: |
23-
docker-compose -f "tests/integration_setup/docker-compose.yml" up -d --build
25+
docker compose -f "tests/integration_setup/docker-compose.yml" up -d --build
2426
docker ps -a
2527
- name: Install dependencies
2628
run: |

.github/workflows/ironpython.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,11 @@ on:
44
push:
55
branches:
66
- main
7+
- LTS-main-1.x
78
pull_request:
89
branches:
910
- main
11+
- LTS-main-1.x
1012

1113
jobs:
1214
build:
@@ -26,6 +28,11 @@ jobs:
2628
ipy -X:Frames -m pip install --no-deps compas.tar.gz
2729
ipy -X:Frames -m pip install --no-deps roslibpy.tar.gz
2830
ipy -X:Frames -m pip install --no-deps compas_robots.tar.gz
31+
32+
# untar and rename, these cannot be installed using ironpip because they not longer have a setup.py
33+
tar -xf compas.tar.gz && for /d %i in (compas-*) do ren "%i" compas
34+
tar -xf compas_robots.tar.gz && for /d %i in (compas_robots-*) do ren "%i" compas_robots
35+
2936
- uses: NuGet/[email protected]
3037
- uses: compas-dev/compas-actions.ghpython_components@v5
3138
with:
@@ -35,9 +42,9 @@ jobs:
3542
run: |
3643
ipy -m compas_fab
3744
env:
38-
IRONPYTHONPATH: ./src
45+
IRONPYTHONPATH: ./src;./compas/src;./compas_robots/src
3946
- name: Run tests
4047
run: |
4148
ipy tests/ipy_test_runner.py
4249
env:
43-
IRONPYTHONPATH: ./src
50+
IRONPYTHONPATH: ./src;./compas/src;./compas_robots/src

.github/workflows/pr-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ on:
44
types: [assigned, opened, synchronize, reopened, labeled, unlabeled]
55
branches:
66
- main
7+
- LTS-main-1.x
78

89
jobs:
910
build:

.github/workflows/publish_yak.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
name: publish_yak
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: "Choose deployment environment"
8+
required: true
9+
type: choice
10+
options:
11+
- test
12+
- prod
13+
14+
jobs:
15+
16+
publish_test_yak:
17+
runs-on: windows-latest
18+
19+
steps:
20+
21+
- name: Set test flag based on input
22+
shell: pwsh
23+
run: |
24+
if ("${{ github.event.inputs.environment }}" -eq "test") {
25+
echo "TEST_FLAG=--test-server" | Out-File -FilePath $env:GITHUB_ENV -Append
26+
}
27+
else {
28+
echo "TEST_FLAG=" | Out-File -FilePath $env:GITHUB_ENV -Append
29+
}
30+
31+
- name: Checkout repo
32+
uses: actions/checkout@v4
33+
34+
- name: Install dependencies
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requiremnets-dev.txt
38+
39+
- name: Create CPython Grasshopper user objects
40+
run: |
41+
invoke build-cpython-ghuser-components
42+
43+
- name: Create IronPython Grasshopper user objects
44+
run: |
45+
choco install ironpython --version=2.7.8.1
46+
invoke clean
47+
invoke build-ghuser-components
48+
49+
- name: Create Rhino7 Yak package
50+
shell: pwsh
51+
run: |
52+
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh7
53+
env:
54+
USER_OBJECTS: src\compas_fab\ghpython\components\ghuser
55+
YAK_TEMPLATE: src\compas_fab\ghpython\yak_template
56+
57+
- name: Publish to Yak server (Rhino 7)
58+
shell: pwsh
59+
run: |
60+
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
61+
$file = Get-ChildItem -Path dist\yak_package\*rh7*.yak -File | Select-Object -ExpandProperty Name
62+
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
63+
Invoke-Expression $command
64+
env:
65+
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}
66+
67+
- name: Create Rhino8 Yak package
68+
shell: pwsh
69+
run: |
70+
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh8
71+
env:
72+
USER_OBJECTS: src\compas_fab\ghpython\components_cpython\ghuser
73+
YAK_TEMPLATE: src\compas_fab\ghpython\yak_template
74+
75+
- name: Publish to Yak server (Rhino 8)
76+
shell: pwsh
77+
run: |
78+
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
79+
$file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
80+
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
81+
Invoke-Expression $command
82+
env:
83+
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,3 +120,4 @@ temp/**
120120

121121
# Grasshopper generated objects
122122
src/compas_fab/ghpython/components/ghuser/*.ghuser
123+
src/compas_fab/ghpython/components_cpython/ghuser/*.ghuser

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,27 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
* Added helper function `message` to `compas_fab.ghpython.components`.
13+
* Added helper function `error` to `compas_fab.ghpython.components`.
14+
* Added helper function `remark` to `compas_fab.ghpython.components`.
15+
* Added helper function `warning` to `compas_fab.ghpython.components`.
16+
* Added GH component definitions compatible with CPython in Rhino8.
17+
18+
### Changed
19+
20+
* Updated dev dependency to `compas_invocations2`.
21+
* Fixed `AttributeError` in `inverse_kinematics_spherical_wrist()`.
22+
* Fixed `AttributeError` in VisualizeRobot GH component.
23+
24+
### Removed
25+
26+
* Removed `create_id` from `compas_fab.ghpython.components`, using `compas_ghpython.create_id` instead.
27+
28+
829
## [1.0.2] 2024-02-22
930

1031
### Added

pyproject.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,34 @@ known_first_party = "compas_fab"
2424
default_section = "THIRDPARTY"
2525
forced_separate = "test_compas_fab"
2626
skip = ["__init__.py"]
27+
28+
[tool.ruff]
29+
line-length = 120
30+
indent-width = 4
31+
target-version = "py39"
32+
33+
[tool.ruff.lint]
34+
select = ["E", "F", "I"]
35+
36+
[tool.ruff.lint.per-file-ignores]
37+
"__init__.py" = ["I001"]
38+
"tests/*" = ["I001"]
39+
"tasks.py" = ["I001"]
40+
"src/compas_fab/ghpython/components/*/code.py" = ["F821", "F401"]
41+
"src/compas_fab/ghpython/components_cpython/*/code.py" = ["F821", "F401"]
42+
43+
[tool.ruff.lint.isort]
44+
force-single-line = true
45+
known-first-party = [
46+
"compas_fab"
47+
]
48+
49+
[tool.ruff.lint.pydocstyle]
50+
convention = "numpy"
51+
52+
[tool.ruff.lint.pycodestyle]
53+
max-line-length = 179
54+
55+
[tool.ruff.format]
56+
docstring-code-format = true
57+
docstring-code-line-length = "dynamic"

requirements-dev.txt

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
attrs >=19.3.0
2-
autopep8
32
black
43
bump2version >=1.0.1
54
check-manifest >=0.36
6-
compas_invocations
7-
doc8
8-
flake8
5+
compas-invocations2
6+
ruff
97
importlib_metadata <5.0
108
invoke>=0.14
11-
isort
12-
pylint
139
pytest
1410
pytest_mock
1511
pytest-cov
1612
sphinx_compas2_theme
17-
sybil
13+
sybil~=8.0.1
1814
twine
15+
tomlkit
1916
-e .

0 commit comments

Comments
 (0)