Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 0 additions & 25 deletions .bumpversion.cfg

This file was deleted.

23 changes: 22 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.10', '3.11']
python: ['3.10', '3.11', '3.12']

steps:
- uses: compas-dev/compas-actions.build@v4
Expand Down Expand Up @@ -49,3 +49,24 @@ jobs:
- name: Tear down docker container
run: |
docker rm -f nanomq

build-cpython-components:
runs-on: windows-latest

steps:
- name: Checkout repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Create CPython Grasshopper user objects
run: |
invoke build-cpython-ghuser-components

- uses: actions/upload-artifact@v5
with:
name: compas_eve_components
path: src/compas_eve/ghpython/components/ghuser
3 changes: 2 additions & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: compas-dev/compas-actions.docs@v2
- uses: compas-dev/compas-actions.docs@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
use_conda: false
93 changes: 13 additions & 80 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ on:
- 'v*'

jobs:
build:
Build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ['3.10', '3.11']
os: [ubuntu-latest]
python: ['3.10']

steps:
- uses: compas-dev/compas-actions.build@v4
with:
python: ${{ matrix.python }}
invoke_lint: true
check_import: false
use_conda: false
invoke_test: false
python: ${{ matrix.python }}
- name: Run unit tests
run: |
pytest tests/unit
Expand All @@ -44,81 +46,12 @@ jobs:
docker rm -f nanomq

Publish:
needs: build
runs-on: windows-latest
needs: Build
runs-on: ubuntu-latest
steps:
# The steps should rely on compas-actions.publish
# but this bug is blocking it: https://github.com/compas-dev/compas-actions.publish/issues/1
# so atm, it's a copy of the steps

# - uses: compas-dev/compas-actions.publish@v2
# with:
# pypi_token: ${{ secrets.PYPI }}
# github_token: ${{ secrets.TOKEN }}
# build_ghpython_components: true
# gh_source: src/compas_eve/ghpython/components
# gh_target: src/compas_eve/ghpython/components/ghuser
# release_name_prefix: COMPAS EVE v

- uses: actions/checkout@v3

- name: Get Version From Tag
id: tag_name
run: |
echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash

- name: Get Changelog Entry
id: changelog_reader
uses: mindsers/changelog-reader-action@v2
with:
version: ${{ steps.tag_name.outputs.current_version }}
path: ./CHANGELOG.md

- name: Assemble Release Name
id: assemble_release_name
shell: bash
run: |
release_name="COMPAS EVE v${{ steps.tag_name.outputs.current_version }}"
echo Using release name: $release_name
echo "release_name=$release_name" >> $GITHUB_OUTPUT

- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
- uses: compas-dev/compas-actions.publish@v3
with:
body: ${{ steps.changelog_reader.outputs.changes }}
token: ${{ secrets.TOKEN }}
name: ${{ steps.assemble_release_name.outputs.release_name }}

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Install CPython dependencies
run: |
python -m pip install --upgrade pip
python -m pip install wheel

- uses: NuGet/[email protected]
- name: Install dependencies
run: |
choco install ironpython --version=2.7.8.1

- uses: compas-dev/compas-actions.ghpython_components@v4
with:
source: src/compas_eve/ghpython/components
target: src/compas_eve/ghpython/components/ghuser
prefix: ""

- shell: bash
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
python setup.py clean --all sdist bdist_wheel
twine check dist/*
twine upload dist/* --skip-existing
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI }}
publish_to_pypi: true
pypi_token: ${{ secrets.PYPI }}
github_token: ${{ secrets.GITHUB_TOKEN }}
python: '3.10'
59 changes: 59 additions & 0 deletions .github/workflows/yak_publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: publish_yak

on:
workflow_dispatch:
inputs:
environment:
description: "Choose deployment environment"
required: true
type: choice
options:
- test
- prod

jobs:

publish_test_yak:
runs-on: windows-latest

steps:

- name: Set test flag based on input
shell: pwsh
run: |
if ("${{ github.event.inputs.environment }}" -eq "test") {
echo "TEST_FLAG=--test-server" | Out-File -FilePath $env:GITHUB_ENV -Append
}
else {
echo "TEST_FLAG=" | Out-File -FilePath $env:GITHUB_ENV -Append
}

- name: Checkout repo
uses: actions/checkout@v4

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]

- name: Create CPython Grasshopper user objects
run: |
invoke build-cpython-ghuser-components

- name: Create Rhino8 Yak package
shell: pwsh
run: |
invoke yakerize -m $Env:YAK_TEMPLATE\manifest.yml -l $Env:YAK_TEMPLATE\icon.png -g $Env:USER_OBJECTS -t rh8
env:
USER_OBJECTS: src\compas_eve\ghpython\components\ghuser
YAK_TEMPLATE: src\compas_eve\ghpython\yak_template

- name: Publish to Yak server (Rhino 8)
shell: pwsh
run: |
$test_flag = if ($Env:TEST_FLAG) { $Env:TEST_FLAG } else { "" }
$file = Get-ChildItem -Path dist\yak_package\*rh8*.yak -File | Select-Object -ExpandProperty Name
$command = "invoke publish-yak -y dist\yak_package\$file $test_flag".Trim()
Invoke-Expression $command
env:
YAK_TOKEN: ${{ secrets.YAK_DF_TOKEN }}
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Removed

* Removed Rhino7 Grasshopper components and replaced them with Rhino8 ones.

## [2.0.0] 2025-10-30

Expand Down
19 changes: 10 additions & 9 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import pytest
import compas
import compas_eve
from pathlib import Path
import math
import numpy
import pytest

import compas
import compas_eve

def pytest_ignore_collect(path):
if "rhino" in str(path):
return True

if "blender" in str(path):
def pytest_ignore_collect(collection_path: Path, config):
# Skip anything under rhino/blender/ghpython
parts_lower = {p.lower() for p in collection_path.parts}
if {"rhino", "blender", "ghpython"} & parts_lower:
return True

if "ghpython" in str(path):
return True
# return None -> don't ignore
return None


@pytest.fixture(autouse=True)
Expand Down
41 changes: 38 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["setuptools>=66.0"]
build-backend = "setuptools.build_meta"

# ============================================================================
# project info
# Project info
# ============================================================================

[project]
Expand Down Expand Up @@ -33,6 +33,11 @@ classifiers = [
"Programming Language :: Python :: 3.14",
]

[tool.setuptools.dynamic]
version = { attr = "compas_eve.__version__" }
dependencies = { file = "requirements.txt" }
optional-dependencies = { dev = { file = "requirements-dev.txt" } }

[project.entry-points.'compas_pb.plugins']
serializers = 'compas_eve.codecs.conversions'

Expand All @@ -46,7 +51,7 @@ Forum = "https://forum.compas-framework.org/"


# ============================================================================
# setuptools config
# Linting and formatting
# ============================================================================

[tool.ruff]
Expand Down Expand Up @@ -99,4 +104,34 @@ max-doc-length = 179

[tool.ruff.format]
docstring-code-format = true
docstring-code-line-length = "dynamic"
docstring-code-line-length = "dynamic"

# ============================================================================
# Release automation
# ============================================================================

[tool.bumpversion]
current_version = "2.0.0"
message = "Bump version to {new_version}"
commit = true
tag = true

[[tool.bumpversion.files]]
filename = "src/compas_eve/__init__.py"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
filename = "docs/installation.rst"
search = "{current_version}"
replace = "{new_version}"

[[tool.bumpversion.files]]
glob = "src/compas_eve/ghpython/components/**/code.py"
search = "# r: compas_eve>={current_version}"
replace = "# r: compas_eve>={new_version}"

[[tool.bumpversion.files]]
filename = "CHANGELOG.md"
search = "Unreleased"
replace = "[{new_version}] {now:%Y-%m-%d}"
3 changes: 2 additions & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ pytest-mock
ruff
sphinx_compas2_theme
twine
wheel
wheel
pythonnet
Loading