Skip to content
Closed
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
6 changes: 6 additions & 0 deletions .coverage-config
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
branch = True
source_pkgs =
moldflow
omit =
src/moldflow/message_box.py
*/site-packages/moldflow/message_box.py

[paths]
source =
Expand All @@ -12,6 +15,9 @@ source =
fail_under = 93
show_missing = True
precision = 2
omit =
src/moldflow/message_box.py
*/site-packages/moldflow/message_box.py

[html]
title = Moldflow API Unit Test Coverage
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.14'

- name: Install dependencies
run: |
Expand All @@ -35,7 +35,7 @@ jobs:
strategy:
matrix:
os: [windows-2022]
python-version: ['3.10', '3.11', '3.12', '3.13']
python-version: ['3.10', '3.11', '3.12', '3.13', '3.14']

steps:
- uses: actions/checkout@v5
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'
python-version: '3.14'

- name: Install dependencies
run: |
Expand Down
31 changes: 21 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ on:
description: "Confirm publish package"
required: true
type: boolean
docs_only:
description: "Only publish documentation (skip package publish)"
required: false
type: boolean
default: false

jobs:
guard-ci-success:
Expand Down Expand Up @@ -77,53 +82,59 @@ jobs:
with:
python-version: '3.13'

- name: Install dependencies for docs
if: ${{ github.event.inputs.docs_only == 'true' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Check if version exists on PyPI
id: pypi_check
shell: pwsh
if: ${{ github.event.inputs.docs_only != 'true' }}
run: |
$packageName = 'moldflow'

try {
$resp = Invoke-WebRequest -Uri "https://test.pypi.org/pypi/$packageName/json" -UseBasicParsing -ErrorAction Stop
$resp = Invoke-WebRequest -Uri "https://pypi.org/pypi/$packageName/json" -UseBasicParsing -ErrorAction Stop
$data = $resp.Content | ConvertFrom-Json
$versions = @($data.releases.PSObject.Properties.Name)
} catch {
$versions = @()
}

$versionJson = Get-Content -Raw -Path version.json | ConvertFrom-Json
$patch = if ($env:BUILD_NUMBER) { $env:BUILD_NUMBER } else { "$($versionJson.patch)" }
$version = "$($versionJson.major).$($versionJson.minor).$patch"
$version = "$($versionJson.major).$($versionJson.minor).$($versionJson.patch)"
$exists = if ($versions -contains $version) { 'true' } else { 'false' }
Write-Output "Release $version exists on PyPI: $exists"
"exists=$exists" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8
"version=$version" | Out-File -FilePath $env:GITHUB_OUTPUT -Append -Encoding utf8

- name: Skip publish, version already exists
if: steps.pypi_check.outputs.exists == 'true'
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'true' }}
run: Write-Output "Version ${{ steps.pypi_check.outputs.version }} already exists on PyPI. Skipping publish."

- name: Install build dependencies
if: steps.pypi_check.outputs.exists == 'false'
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt

- name: Build package
if: steps.pypi_check.outputs.exists == 'false'
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
run: |
python run.py build

- name: Publish to PyPI
if: steps.pypi_check.outputs.exists == 'false'
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
TWINE_PASSWORD: ${{ secrets.PYPI_API_TOKEN }}
run: |
python run.py publish --skip-build --testpypi
python run.py publish --skip-build

- name: Create GitHub Release
if: steps.pypi_check.outputs.exists == 'false'
if: ${{ github.event.inputs.docs_only != 'true' && steps.pypi_check.outputs.exists == 'false' }}
run: |
python run.py release
env:
Expand Down
79 changes: 69 additions & 10 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,48 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Added
- Initial public release
- Python API wrapper for Moldflow Synergy
- Comprehensive test suite
- Documentation with examples
- CI/CD pipeline for automated testing and publishing
- N/A

### Changed
- N/A

### Deprecated
- N/A

### Removed
- N/A

### Fixed
- Fixed `GeomType` enum not being exposed in package `__init__.py` - users can now import it directly with `from moldflow import GeomType`

### Security
- N/A

## [26.0.3]

### Added
- N/A

### Changed
- N/A

### Deprecated
- N/A

### Removed
- N/A

### Fixed
- Fixed README links

### Security
- N/A

## [26.0.2] - 2025-10-10

### Added
- Added convenience class for showing message boxes and text input dialogs via Win32
- Add more examples in the documentation

### Changed
- N/A
Expand All @@ -29,13 +66,35 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Security
- N/A

## [26.0.0] - 2025-XX-XX
## [26.0.1] - 2025-09-12

### Added
- N/A

### Changed
- N/A

### Deprecated
- N/A

### Removed
- N/A

### Fixed
- Fix return types for `from_list` functions in data classes
- Fix color band range options to 1 to 256

### Security
- N/A

## [26.0.0] - 2025-09-01

### Added
- Initial version aligned with Moldflow Synergy 2026
- Basic API functionality
- Windows support
- Initial version aligned with Moldflow Synergy 2026.0.1
- Python 3.10-3.13 compatibility

[Unreleased]: https://github.com/Autodesk/moldflow-api/compare/v26.0.0...HEAD
[Unreleased]: https://github.com/Autodesk/moldflow-api/compare/v26.0.3...HEAD
[26.0.3]: https://github.com/Autodesk/moldflow-api/releases/tag/v26.0.3
[26.0.2]: https://github.com/Autodesk/moldflow-api/releases/tag/v26.0.2
[26.0.1]: https://github.com/Autodesk/moldflow-api/releases/tag/v26.0.1
[26.0.0]: https://github.com/Autodesk/moldflow-api/releases/tag/v26.0.0
13 changes: 6 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Moldflow API is a Python wrapper library for the Synergy API, designed to simpli

Before you begin, ensure you have:
- Windows 10/11
- Python 3.10.x - 3.13.x
- Python 3.10.x - 3.14.x
- Autodesk Moldflow Synergy 2026.0.1 or later

## Install
Expand Down Expand Up @@ -71,7 +71,7 @@ python run.py build-docs
Options:
- `--skip-build` (`-s`): Skip building before generating docs

The documentation can be accessed locally by opening the [index.html](docs/build/html/index.html) in the [html](docs/build/html/) folder.
The documentation can be accessed locally by opening the index.html in the docs/build/html/ folder.

### Running the Formatter

Expand Down Expand Up @@ -145,7 +145,7 @@ Key modules include:

## Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details on how to contribute to this project. Here's a quick overview:
We welcome contributions! Please see our [Contributing Guide](https://github.com/Autodesk/moldflow-api/blob/main/CONTRIBUTING.md) for details on how to contribute to this project. Here's a quick overview:

1. Fork the repository
2. Create a feature branch (`git checkout -b feature/amazing-feature`)
Expand All @@ -161,15 +161,14 @@ We use [Semantic Versioning](https://semver.org/). For available versions, see t

## License

This project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.
This project is licensed under the Apache License 2.0 - see the [LICENSE](https://github.com/Autodesk/moldflow-api/blob/main/LICENSE) file for details.

## Support

- **Documentation**: [Full documentation available online](https://autodesk.github.io/moldflow-api)
- **Issues**: Report bugs and request features through [GitHub Issues](https://github.com/Autodesk/moldflow-api/issues)
- **Security**: For security issues, please see our [Security Policy](SECURITY.md)
- **Discussions**: Join our [GitHub Discussions](https://github.com/Autodesk/moldflow-api/discussions) for questions and community support
- **Security**: For security issues, please see our [Security Policy](https://github.com/Autodesk/moldflow-api/blob/main/SECURITY.md)

## Code of Conduct

This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
This project adheres to the Contributor Covenant [code of conduct](https://github.com/Autodesk/moldflow-api/blob/main/CODE_OF_CONDUCT.md). By participating, you are expected to uphold this code.
109 changes: 109 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# Release steps (minimal)

This file documents the minimal, explicit steps to bump the version and publish a release for moldflow-api.

Summary (short):

- Edit the root `version.json` (only this file).
- Commit on a branch named `release/MAJOR.MINOR.PATCH` and push.
- Wait for CI to pass on that branch.
- Trigger the manual "Publish package (manual)" workflow in GitHub Actions and confirm.

Why this works (important notes):

- The canonical version source for releases is the root `version.json` in the repository root.
- The `run.py` script (used for building and releasing locally and by many repo commands)
reads the `patch` value directly from the root `version.json` and will raise a
RuntimeError if `patch` is missing.
- The workflow only publishes when run on a branch whose name starts with `release/` and when
you confirm the manual workflow dispatch.
- The release workflow checks PyPI for an existing version and will skip publishing if that
exact version already exists.

Minimal step-by-step

1. Decide the new major/minor/patch values.

- Always set a numeric `patch` value in the root `version.json`.

2. Edit `version.json` at the repository root. Example (bumping to MAJOR.MINOR.PATCH, e.g. 1.2.0):

```json
{
"major": "27",
"minor": "0",
"patch": "0"
}
```

3. Commit and push on a `release/` branch. Example (use the placeholder branch name below and replace with your version):

```bash
# create branch using the target version (branch name must start with 'release/')
# use a placeholder like 'release/MAJOR.MINOR.PATCH' and replace with your values
git checkout -b release/MAJOR.MINOR.PATCH # e.g. release/1.2.0
git add version.json
git commit -m "Bump version to MAJOR.MINOR.PATCH" # e.g. "Bump version to 1.2.0"
git push -u origin release/MAJOR.MINOR.PATCH
```

4. Wait for CI to pass on that branch.

- The publish workflow has a guard that requires the `ci.yml` workflow to have completed
successfully for the same commit before allowing publish.

5. Trigger the publish workflow manually in the GitHub Actions UI for the repository.

- Open the `Publish package (manual)` workflow, choose `Run workflow`, set `confirm` to
`true`, and run it on your `release/MAJOR.MINOR.PATCH` branch (replace the placeholder
with the actual version).
- Alternatively, you can use the GitHub CLI (if you have it configured). Example using a
placeholder branch name (replace with your actual branch):
```bash
# example (replace with the correct workflow file name and branch if needed)
# gh workflow run publish.yml --ref release/MAJOR.MINOR.PATCH -f confirm=true
# e.g. --ref release/1.2.0
```

6. What the workflow does (high level):

- Ensures CI (`ci.yml`) passed for the commit.
- Computes the release version using `version.json`.
- If the computed version already exists on PyPI the workflow will skip the publish.
- If not present, it builds the package, uploads to PyPI (requires the repo to have
`PYPI_API_TOKEN` in secrets), creates a GitHub release (tag `vMAJOR.MINOR.PATCH`) and
deploys documentation to GitHub Pages.

Local testing and notes

- You can build the package locally to smoke test the build step:

```bash
python run.py build
```

- Publishing to PyPI is intentionally restricted to the manual GitHub Actions workflow.
If you need to test publishing to TestPyPI locally, you can use `python -m twine upload`
with TestPyPI credentials, but this is separate from the CI-based publish flow.

Edge cases and tips

- `run.py` now requires a `patch` value in the root `version.json`. It will raise a
RuntimeError if that key is missing. Do not rely on `run.py` falling back to any
environment variable.
- If you want CI to inject a monotonic build number into the patch segment, make the CI
step explicitly update `version.json` (or generate a temporary `version.json`) with the
desired `patch` before running the build and publish steps. That keeps `run.py` and the
workflow in agreement.
- The `run.py` script will write a package-local `src/moldflow/version.json` at build time;
you do not need to edit that file directly (it is generated and typically ignored by Git).

Cleanup (optional)

- After a successful release you may merge the `release/` branch to `main` (if you use merge
workflow) and delete the `release/` branch.

Contact

If anything in CI behaves unexpectedly, check the logs for the `publish` workflow and the
`ci` workflow; feel free to open an issue or ask a maintainer.
Loading