Skip to content

Commit

Permalink
fix: update ci_cd (#150)
Browse files Browse the repository at this point in the history
* FIX: ci_cd pacakge name

* FIX: update python version

* MAIT: change the dynamic version from pyproject.toml file

* DOC: fix typo
  • Loading branch information
Revathyvenugopal162 authored Aug 1, 2023
1 parent 230b450 commit 6b62933
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/ci_cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ on:

env:
MAIN_PYTHON_VERSION: '3.10'
PACKAGE_NAME: ansys-motorcad-core
LIBRARY_NAME: ansys-motorcad-core
LIBRARY_NAMESPACE: 'ansys.motorcad.core'
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
DOCUMENTATION_CNAME: 'motorcad.docs.pyansys.com'

Expand All @@ -24,7 +25,7 @@ jobs:
name: Code style
runs-on: ubuntu-latest
steps:
- name: PyAnsys code style checks
- name: Ansys code style checks
uses: ansys/actions/code-style@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}
Expand All @@ -33,7 +34,7 @@ jobs:
name: Documentation Style Check
runs-on: ubuntu-latest
steps:
- name: PyAnsys documentation style checks
- name: Ansys documentation style checks
uses: ansys/actions/doc-style@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -46,14 +47,16 @@ jobs:
fail-fast: false
matrix:
os: [windows-latest]
python-version: ['3.7', '3.8', '3.9', '3.10']
python-version: ['3.8', '3.9', '3.10', '3.11']
steps:
- name: Build wheelhouse and perform smoke test
uses: ansys/actions/build-wheelhouse@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}
library-namespace: ${{ env.LIBRARY_NAMESPACE }}
operating-system: ${{ matrix.os }}
python-version: ${{ matrix.python-version }}

check-licenses: false

tests:
Expand Down Expand Up @@ -149,7 +152,7 @@ jobs:
- name: Build library source and wheel artifacts
uses: ansys/actions/build-library@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}
python-version: ${{ env.MAIN_PYTHON_VERSION }}

release:
Expand All @@ -161,7 +164,7 @@ jobs:
- name: Release to PyPI repository
uses: ansys/actions/release-pypi-public@v4
with:
library-name: ${{ env.PACKAGE_NAME }}
library-name: ${{ env.LIBRARY_NAME }}
twine-username: __token__
twine-token: ${{ secrets.PYPI_TOKEN }}

Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ build-backend = "flit_core.buildapi"

[project]
name="ansys-motorcad-core"
dynamic = ["version"]
version = "0.2.dev0"
description = "Pythonic interface to Ansys Motor-CAD."
readme = "README.rst"
requires-python = ">=3.7"
requires-python = ">=3.8"
license = {file = "LICENSE"}
authors = [
{name = "Ansys, Inc.", email = "[email protected]"},
Expand All @@ -30,6 +30,7 @@ dependencies = [
"psutil >= 5.9.0",
"requests >= 2.27.1",
"packaging >= 21.3",
"importlib-metadata>=4.0",
]

[project.optional-dependencies]
Expand Down
10 changes: 8 additions & 2 deletions src/ansys/motorcad/core/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""PyMotorCAD is a Python RPC-JSON interface for Motor-CAD."""

__version__ = "0.2.dev0"
try:
import importlib.metadata as importlib_metadata
except ModuleNotFoundError: # pragma: no cover
import importlib_metadata

import ansys.motorcad.core.geometry
from ansys.motorcad.core.motorcad_methods import MotorCAD, MotorCADCompatibility
Expand All @@ -10,3 +12,7 @@
set_motorcad_exe,
set_server_ip,
)

# Read from the pyproject.toml
# major, minor, patch
__version__ = importlib_metadata.version("ansys-motorcad-core")

0 comments on commit 6b62933

Please sign in to comment.