Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple interface versions #297

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .github/workflows/generate_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,13 @@ jobs:
cache: maven

- name: "Clean library folder"
run: find . ! -name 'poetry.lock' -type f -exec rm -f {} +
run: find . ! -name 'poetry.lock' -path './src' -prune -o -type f -exec rm -f {} +
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just use maven clean to do all of this and remove this step entirely? It's a bit odd having two different ways of doing different parts of the same job.

working-directory: ansys-grantami-serverapi-openapi

- name: "Build client library"
run: mvn -Dbuild-id=${{ github.run_number }} ${{ env.IS_RELEASE_BRANCH == 'true' && '-Dis-release' || '' }} -s .m2/settings.xml compile
run: |
mvn clean
mvn -Dbuild-id=${{ github.run_number }} ${{ env.IS_RELEASE_BRANCH == 'true' && '-Dis-release' || '' }} -s .m2/settings.xml compile
env:
MAVEN_OPTS: "-Dlog4j2.formatMsgNoLookups=true"
SERVER_USERNAME: ${{ secrets.REPO_USER }}
Expand Down
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ The release process follows the standard [PyAnsys release guidelines](https://de

Once the tag is pushed to GitHub, a workflow will build and publish the release.

## Creating a new interface version

Once a release is completed, the build scripts should be updated to build the new in-development version of the
package, additionally the oldest release can be removed.

1. Update the version number of the package in the ``version`` node of the pom.xml file to begin development
2. Update the ``interface-dev-version`` element in the pom.xml file to refer to the current in-development version
of Granta MI. For example 24R2 would be ``v242``
3. Remove the oldest folder from the ``src/ansys/grantami/serverapi_openapi`` directory, it is no longer supported
4. Create a PR to merge these changes into main

## Using this package directly

Expand Down Expand Up @@ -95,8 +105,8 @@ Or with pip:
```

### Minimal setup
The following code snippet demonstrates how to perform the minimal setup required to interact with the API using this
library.
The following code snippet demonstrates how to perform the minimal setup required to interact with the 2025 R1 version of the
API using this library.

```python
from typing import Optional
Expand All @@ -108,7 +118,7 @@ from ansys.openapi.common import (
generate_user_agent,
SessionConfiguration,
)
from ansys.grantami.serverapi_openapi import models
from ansys.grantami.serverapi_openapi.v251 import models

SERVICE_PATH = "/proxy/v1.svc/mi" # "/proxy/v1.svc" for Granta MI 2024 R1 and older
MI_AUTH_PATH = "/v1alpha/schema/mi-version"
Expand Down
347 changes: 182 additions & 165 deletions ansys-grantami-serverapi-openapi/poetry.lock

Large diffs are not rendered by default.

5 changes: 2 additions & 3 deletions ansys-grantami-serverapi-openapi/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
[tool.poetry]
name = "ansys-grantami-serverapi-openapi"
description = "Autogenerated client library for the Granta MI Server API."
version = "5.0.0.dev383"
version = "5.0.0.dev394"
license = "MIT"
authors = ["ANSYS, Inc. <[email protected]>"]
maintainers = ["ANSYS, Inc. <[email protected]>"]
Expand All @@ -26,8 +26,7 @@ classifiers = [
"Topic :: Scientific/Engineering :: Information Analysis",
]
packages = [
{ include = "**/*.py", from = "src" },
{ include = "**/py.typed", from = "src" },
{ include = "*", from = "src" },
]

[tool.poetry.dependencies]
Expand Down

This file was deleted.

This file was deleted.

Loading
Loading