Skip to content

Commit 0623855

Browse files
Updated wheelhose Release Workflow (#1195)
* Updated wheelhose Release Workflow * Updated wheelhose Release Workflow * Updated pyaedt_with_IDE.bat to support wheelhouse * Updated pyaedt_with_IDE.bat to support wheelhouse * Rename the wheelhouse file. * Update documentation to mention the wheelhouses. * Release version is generic. * Fixed rst * Fixed rst Co-authored-by: maxcapodi78 <Shark78> Co-authored-by: MaxJPRey <[email protected]>
1 parent 8ebf4f9 commit 0623855

File tree

5 files changed

+155
-79
lines changed

5 files changed

+155
-79
lines changed

.github/workflows/unit_tests.yml

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,10 @@ jobs:
4242
with:
4343
python-version: ${{ matrix.python-version }}
4444

45+
# - name: Test import
46+
# working-directory: tests
47+
# run: python -c "import pyaedt"
48+
4549
- name: 'Create virtual env'
4650
run: |
4751
python -m venv testenv
@@ -61,36 +65,6 @@ jobs:
6165
cd tmp
6266
python -c "import pyaedt; print('Imported pyaedt')"
6367
64-
# - name: Test import
65-
# working-directory: tests
66-
# run: python -c "import pyaedt"
67-
- name: Retrieve PyAEDT version
68-
run: |
69-
testenv\Scripts\Activate.ps1
70-
echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
71-
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
72-
id: version
73-
74-
- name: Generate wheelhouse
75-
run: |
76-
testenv\Scripts\Activate.ps1
77-
pip install wheel setuptools -U
78-
pip wheel . -w wheelhouse
79-
80-
81-
- name: Zip wheelhouse
82-
uses: vimtor/action-zip@v1
83-
with:
84-
files: wheelhouse
85-
dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip
86-
87-
- name: Upload Wheelhouse
88-
uses: actions/upload-artifact@v2
89-
with:
90-
name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}
91-
path: '*.zip'
92-
retention-days: 7
93-
9468
- name: 'Unit testing'
9569
run: |
9670
testenv\Scripts\Activate.ps1
@@ -144,13 +118,3 @@ jobs:
144118
env:
145119
TWINE_USERNAME: __token__
146120
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
147-
148-
- name: Release
149-
uses: softprops/action-gh-release@v1
150-
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
151-
with:
152-
files: |
153-
./**/*.whl
154-
./**/*.tar.gz
155-
./**/*.pdf
156-
./**/*.zip

.github/workflows/wheelhouse.yml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
# This is a basic workflow to help you get started with Actions
2+
3+
name: WheelHouse
4+
5+
env:
6+
python.venv: 'testvenv'
7+
# Following env vars when changed will "reset" the mentioned cache,
8+
# by changing the cache file name. It is rendered as ...-v%RESET_XXX%-...
9+
# You should go up in number, if you go down (or repeat a previous value)
10+
# you might end up reusing a previous cache if it haven't been deleted already.
11+
# It applies 7 days retention policy by default.
12+
RESET_PIP_CACHE: 0
13+
PACKAGE_NAME: PyAEDT
14+
# Controls when the workflow will run
15+
on:
16+
# Triggers the workflow on push or pull request events but only for the main branch
17+
push:
18+
tags:
19+
- 'v*'
20+
- v*
21+
22+
23+
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
24+
jobs:
25+
# This workflow contains a single job called "build"
26+
build:
27+
# The type of runner that the job will run on
28+
runs-on: Windows
29+
strategy:
30+
matrix:
31+
python-version: [ 3.7, 3.8, 3.9]
32+
# Steps represent a sequence of tasks that will be executed as part of the job
33+
steps:
34+
- uses: actions/checkout@v2
35+
- name: Set up Python ${{ matrix.python-version }}
36+
uses: actions/setup-python@v2
37+
with:
38+
python-version: ${{ matrix.python-version }}
39+
40+
- name: 'Create virtual env'
41+
run: |
42+
python -m venv testenv
43+
testenv\Scripts\Activate.ps1
44+
python -m pip install pip -U
45+
python -m pip install wheel setuptools -U
46+
python -c "import sys; print(sys.executable)"
47+
pip install .
48+
pip install jupyterlab
49+
50+
51+
- name: Retrieve PyAEDT version
52+
run: |
53+
testenv\Scripts\Activate.ps1
54+
echo "::set-output name=PYAEDT_VERSION::$(python -c "from pyaedt import __version__; print(__version__)")"
55+
echo "PyAEDT version is: $(python -c "from pyaedt import __version__; print(__version__)")"
56+
id: version
57+
58+
- name: Generate wheelhouse
59+
run: |
60+
testenv\Scripts\Activate.ps1
61+
pip install wheel setuptools -U
62+
pip wheel . -w wheelhouse
63+
64+
- name: Zip wheelhouse
65+
uses: vimtor/action-zip@v1
66+
with:
67+
files: wheelhouse
68+
dest: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}.zip
69+
70+
- name: Upload Wheelhouse
71+
uses: actions/upload-artifact@v2
72+
with:
73+
name: ${{ env.PACKAGE_NAME }}-v${{ steps.version.outputs.PYAEDT_VERSION }}-wheelhouse-${{ runner.os }}-${{ matrix.python-version }}
74+
path: '*.zip'
75+
retention-days: 7
76+
77+
- name: Release
78+
uses: softprops/action-gh-release@v1
79+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
80+
with:
81+
files: |
82+
./**/*.tar.gz
83+
./**/*.zip

doc/source/Resources/Installation.rst

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,30 @@ In addition to the runtime dependencies listed in the installation information,
1313
Add how to install from the AEDT installer like as in https://mapdldocs.pyansys.com/getting_started/running_mapdl.html
1414

1515

16-
Installing on CPython v3.7-v3.9
17-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
Installing on CPython v3.7-v3.9 from pypi
17+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1818
Install the prerequisite packages ``pythonnet`` and ``pywin32`` with:
1919

2020
.. code:: python
2121
2222
pip install pyaedt
2323
2424
25-
Using IronPython in AEDT
26-
~~~~~~~~~~~~~~~~~~~~~~~~
27-
To use IronPython in AEDT:
28-
29-
1. Download the PyAEDT package from ``https://pypi.org/project/pyaedt/#files``
30-
2. Extract the files.
31-
3. Install PyAEDT into Electronics Desktop, specifying the full paths to ``ipy64`` and ``setup-distutils.py`` as needed:
32-
33-
.. code::
25+
Offline PyAEDT installation from a wheelhouse
26+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
27+
PyAEDT can be installed from one of the wheelhouse available in the release assets.
28+
Wheelhouses have been added starting from release v0.4.70.
29+
They are available for CPython 3.7, 3.8 and 3.9.
3430

35-
ipy64 setup-distutils.py install --user
31+
This can be helpful for users part of companies restricting access to external network.
32+
They can install PyAEDT and all its dependencies from one single entry point that can be shared internally.
33+
It will ease the review of the PyAEDT package content for security reasons.
3634

37-
38-
Using Standalone IronPython
39-
~~~~~~~~~~~~~~~~~~~~~~~~~~~
40-
To use standalone IronPython:
35+
For instance, here is the command to execute to install PyAEDT package and all its dependencies.
4136

4237
.. code::
4338
44-
ipy64 -X:Frames -m pip install pyaedt
39+
pip install --no-cache-dir --no-index --find-links=file:///<path_to_wheelhouse>/PyAEDT-v<release_version>-wheelhouse-Windows-3.7 pyaedt
4540
4641
4742
Installing PyAEDT from a Batch File
@@ -72,4 +67,22 @@ is executed only when running the command with the ``-update`` option:
7267
7368
pyaedt_with_IDE.bat -update
7469
70+
In addition, it is possible to install PyAEDT package and all its dependencies provided in the wheelhouse by
71+
executing the bat file mentioned above. Wheelhous 3.7 package has to be used in this case.
72+
73+
.. code::
74+
75+
pyaedt_with_IDE.bat <path_to_wheelhouse>PyAEDT-v<release_version>-wheelhouse-Windows-3.7
76+
77+
78+
Using IronPython in AEDT
79+
~~~~~~~~~~~~~~~~~~~~~~~~
80+
To use IronPython in AEDT:
81+
82+
1. Download the PyAEDT package from ``https://pypi.org/project/pyaedt/#files``
83+
2. Extract the files.
84+
3. Install PyAEDT into Electronics Desktop, specifying the full paths to ``ipy64`` and ``setup-distutils.py`` as needed:
85+
86+
.. code::
7587
88+
ipy64 setup-distutils.py install --user

doc/source/Resources/pyaedt_with_IDE.bat

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
2+
set arg1=%1
33
set env_vars=ANSYSEM_ROOT222 ANSYSEM_ROOT221 ANSYSEM_ROOT212 ANSYSEM_ROOT211
44
setlocal enableextensions enabledelayedexpansion
55
set latest_env_var_present=
@@ -23,33 +23,41 @@ set cmd=call echo %%%aedt_var%%%
2323
for /f "delims=" %%i in ('%cmd%') do set aedt_path=%%i
2424
echo Found AEDT %version_pretty% at %aedt_path%
2525

26-
set /p run=Python or Jupyter?(0=Spyder, 1=Jupyter, 2=Console)
26+
set /p run=Python or Jupyter?(0=InstallOnly, 1=Jupyter, 2=Console, 3=Spyder)
27+
if [%run%] == [] set run=0
2728
setlocal enableDelayedExpansion
2829

2930
if not exist "%APPDATA%\pyaedt_env_ide\" (
3031
echo Installing Pyaedt
3132
cd "%APPDATA%"
3233
"%aedt_path%\commonfiles\CPython\3_7\winx64\Release\python\python.exe" -m venv "%APPDATA%\pyaedt_env_ide"
33-
"%APPDATA%\pyaedt_env_ide\Scripts\python.exe" -m pip install --upgrade pip
34-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt
35-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install jupyterlab
36-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install spyder
37-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipython -U
38-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipyvtklink
34+
if NOT [%arg1%]==[] (
35+
echo Installing Pyaedt from local wheels %arg1%
36+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install --no-cache-dir --no-index --find-links=%arg1% pyaedt
37+
) ELSE (
38+
echo Installing Pyaedt from pip
39+
"%APPDATA%\pyaedt_env_ide\Scripts\python.exe" -m pip install --upgrade pip
40+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt
41+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install jupyterlab
42+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install spyder
43+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipython -U
44+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipyvtklink
45+
)
3946
call "%APPDATA%\pyaedt_env_ide\Scripts\python" "%APPDATA%\pyaedt_env_ide\Lib\site-packages\pyaedt\misc\aedtlib_personalib_install.py" %aedt_var%
4047
)
41-
if [%1%]==[-update] (
48+
if [%arg1%]==[-update] (
4249
echo Updating Pyaedt
4350
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt -U
4451
)
4552
if %run%==1 (
4653
echo Launching Jupyter Lab
4754
"%APPDATA%\pyaedt_env_ide\Scripts\jupyter.exe" lab
48-
) else ( if %run%==0 (
55+
) else ( if %run%==3 (
4956
echo Launching Spyder
5057
"%APPDATA%\pyaedt_env_ide\Scripts\spyder.exe"
51-
) else (
58+
) else ( if %run%==2 (
5259
"%APPDATA%\pyaedt_env_ide\Scripts\ipython.exe"
5360
)
61+
)
5462
)
5563

pyaedt_with_IDE.bat

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
2+
set arg1=%1
33
set env_vars=ANSYSEM_ROOT222 ANSYSEM_ROOT221 ANSYSEM_ROOT212 ANSYSEM_ROOT211
44
setlocal enableextensions enabledelayedexpansion
55
set latest_env_var_present=
@@ -23,33 +23,41 @@ set cmd=call echo %%%aedt_var%%%
2323
for /f "delims=" %%i in ('%cmd%') do set aedt_path=%%i
2424
echo Found AEDT %version_pretty% at %aedt_path%
2525

26-
set /p run=Python or Jupyter?(0=Spyder, 1=Jupyter, 2=Console)
26+
set /p run=Python or Jupyter?(0=InstallOnly, 1=Jupyter, 2=Console, 3=Spyder)
27+
if [%run%] == [] set run=0
2728
setlocal enableDelayedExpansion
2829

2930
if not exist "%APPDATA%\pyaedt_env_ide\" (
3031
echo Installing Pyaedt
3132
cd "%APPDATA%"
3233
"%aedt_path%\commonfiles\CPython\3_7\winx64\Release\python\python.exe" -m venv "%APPDATA%\pyaedt_env_ide"
33-
"%APPDATA%\pyaedt_env_ide\Scripts\python.exe" -m pip install --upgrade pip
34-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt
35-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install jupyterlab
36-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install spyder
37-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipython -U
38-
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipyvtklink
34+
if NOT [%arg1%]==[] (
35+
echo Installing Pyaedt from local wheels %arg1%
36+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install --no-cache-dir --no-index --find-links=%arg1% pyaedt
37+
) ELSE (
38+
echo Installing Pyaedt from pip
39+
"%APPDATA%\pyaedt_env_ide\Scripts\python.exe" -m pip install --upgrade pip
40+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt
41+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install jupyterlab
42+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install spyder
43+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipython -U
44+
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install ipyvtklink
45+
)
3946
call "%APPDATA%\pyaedt_env_ide\Scripts\python" "%APPDATA%\pyaedt_env_ide\Lib\site-packages\pyaedt\misc\aedtlib_personalib_install.py" %aedt_var%
4047
)
41-
if [%1%]==[-update] (
48+
if [%arg1%]==[-update] (
4249
echo Updating Pyaedt
4350
"%APPDATA%\pyaedt_env_ide\Scripts\pip" install pyaedt -U
4451
)
4552
if %run%==1 (
4653
echo Launching Jupyter Lab
4754
"%APPDATA%\pyaedt_env_ide\Scripts\jupyter.exe" lab
48-
) else ( if %run%==0 (
55+
) else ( if %run%==3 (
4956
echo Launching Spyder
5057
"%APPDATA%\pyaedt_env_ide\Scripts\spyder.exe"
51-
) else (
58+
) else ( if %run%==2 (
5259
"%APPDATA%\pyaedt_env_ide\Scripts\ipython.exe"
5360
)
61+
)
5462
)
5563

0 commit comments

Comments
 (0)