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

Create a minimal requirements file #2443

Merged
merged 58 commits into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
0588089
Independence from click
germa89 Oct 23, 2023
1fb714a
Independence from request
germa89 Oct 23, 2023
1d0cce6
Independence from tqm
germa89 Oct 23, 2023
e7623e6
ansys-tools-path independence
germa89 Oct 24, 2023
3ac11f8
Skipping modules
germa89 Oct 24, 2023
0f201fa
Minimal ci job
germa89 Oct 24, 2023
5b914b0
independence from ATP
germa89 Oct 24, 2023
c61d192
independence from ansys-mapdl-math
germa89 Oct 24, 2023
e6507f4
Independence from matplotlib
germa89 Oct 24, 2023
f1708e9
Bug in parameters
germa89 Oct 24, 2023
716ff91
Removing pyvista
germa89 Oct 24, 2023
f5c7e17
setting configuration
germa89 Oct 24, 2023
03219bb
Adapting test to new setup
germa89 Oct 24, 2023
936e388
Removing pytest
germa89 Oct 24, 2023
9535d03
Removing pymapdl from requirements
germa89 Oct 24, 2023
facfa06
fixing missing import
germa89 Oct 24, 2023
9e25e31
installing pymapdl from repo, no pypi
germa89 Oct 24, 2023
73bc1db
fixing issues with dpf
germa89 Oct 24, 2023
56fe302
fixing vm runs
germa89 Oct 24, 2023
11c358c
Missing import
germa89 Oct 24, 2023
de47f74
fixing write to array
germa89 Oct 25, 2023
717a3ac
Fixing wrong import
germa89 Oct 25, 2023
ba364f2
Avoiding MPI issue warning in Linux
germa89 Oct 25, 2023
c32f2a9
fixing no mode when no ATP
germa89 Oct 25, 2023
1c5b3a1
Fixing mapdl not launching
germa89 Oct 25, 2023
f535d6e
Update the image cache
germa89 Oct 25, 2023
8c90200
Adding missing import.
germa89 Oct 25, 2023
ac306eb
disabling license check when there is no ATP.
germa89 Oct 25, 2023
57c5fdd
Merge branch 'feat/create-minimal-file' of https://github.com/pyansys…
germa89 Oct 25, 2023
4b93152
Externalising vms execution to a python file.
germa89 Oct 25, 2023
e27a57a
Removing unused env vars
germa89 Oct 25, 2023
a56f400
avoiding circular import
germa89 Oct 25, 2023
99e06c0
Adding coverage artifacts
germa89 Oct 25, 2023
4bd79fa
Adding missing packages for proper testing
germa89 Oct 25, 2023
3208fbc
Removing checking session ID and test
germa89 Oct 25, 2023
690f979
Merge branch 'main' into feat/create-minimal-file
germa89 Oct 25, 2023
88d4ce5
Fixing orphan imported functions
germa89 Oct 26, 2023
d0c1504
Fixing calling licensing tests functions which require ATP.
germa89 Oct 26, 2023
9fa9ade
Using a more clear approach based on 'requires' function
germa89 Oct 26, 2023
34f92f2
Refactoring. Using `requires` instead of global vars.
germa89 Oct 26, 2023
e76272f
Merging main
germa89 Oct 26, 2023
51c122b
Fix missing import and missing not
germa89 Oct 26, 2023
a28898a
replacing negative conditions by positive ones
germa89 Oct 26, 2023
2bd2f1b
Merge branch 'main' into feat/create-minimal-file
germa89 Oct 26, 2023
a6c422f
Fixing test_report test
germa89 Oct 27, 2023
f776984
Empty commit
germa89 Oct 27, 2023
1474624
Adding minimum requirements to release and renaming jobs
germa89 Oct 27, 2023
c6851cb
Merge branch 'main' into feat/create-minimal-file
germa89 Oct 27, 2023
1f56c58
Merge branch 'main' into feat/create-minimal-file
germa89 Oct 27, 2023
7ef9065
Fixing test requirements
germa89 Oct 30, 2023
c64c4b1
Giving extra permissions
germa89 Oct 30, 2023
87d5cfd
testing no fetch-depth
germa89 Oct 30, 2023
3cf48e0
fixing typo
germa89 Oct 31, 2023
a94472e
removing persist-credentials as indicated in https://github.com/EndBu…
germa89 Oct 31, 2023
6ed4c25
Merge branch 'main' into feat/create-minimal-file
germa89 Oct 31, 2023
1a44451
Update the image cache
germa89 Oct 31, 2023
6f51e85
Empty comment to trigger CICD
germa89 Oct 31, 2023
39844fc
Merge branch 'feat/create-minimal-file' of https://github.com/pyansys…
germa89 Oct 31, 2023
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
14 changes: 14 additions & 0 deletions .ci/run_vms.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""Run some vm manuals"""
from ansys.mapdl.core import launch_mapdl
from ansys.mapdl.core.examples import vmfiles

mapdl = launch_mapdl()

vms = list(vmfiles.keys())

for i, vm in enumerate(vms[:2]):
mapdl.clear()
print(f"Running the vm {i}: {vm}")
output = mapdl.input(vmfiles[vm])
print(f"Running the vm {i}: Successfully completed")
mapdl.exit()
91 changes: 85 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ defaults:
permissions:
contents: write
packages: read

pull-requests: write

jobs:

doc-style:
Expand Down Expand Up @@ -263,7 +264,7 @@ jobs:
run: cat log.txt

build-test:
name: "Remote: Build and unit testing"
name: "Remote: Build & test"
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
timeout-minutes: 35
Expand Down Expand Up @@ -458,7 +459,7 @@ jobs:
if compgen -G './logs-${{ matrix.mapdl-version }}/*.out' > /dev/null ;then for f in ./logs-${{ matrix.mapdl-version }}/*.out; do echo "::group:: Output file $f" && cat $f && echo "::endgroup::" ; done; fi || echo "Failed to display the 'log' files."

build-test-ubuntu:
name: "Local: Build and unit testing on Ubuntu"
name: "Local: Build & test on Ubuntu"
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
timeout-minutes: 55
Expand All @@ -482,8 +483,6 @@ jobs:
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}
persist-credentials: false
fetch-depth: 0


- name: "Setup Python"
Expand Down Expand Up @@ -581,10 +580,89 @@ jobs:
with:
name: ubuntu-v22.2.0-local.xml
path: ./ubuntu-v22.2.0-local.xml

- name: 'Upload minimal requirements file'
uses: actions/upload-artifact@v3
with:
name: minimum_requirements.txt
path: ./minimum_requirements.txt

build-test-ubuntu-minimal:
name: "Local: Build & test minimal package on Ubuntu"
runs-on: ubuntu-latest
if: github.ref != 'refs/heads/main' || github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
timeout-minutes: 55
container:
image: ghcr.io/ansys/mapdl:v22.2-ubuntu
options: "-u=0:0 --entrypoint /bin/bash"
credentials:
username: ${{ secrets.GH_USERNAME }}
password: ${{ secrets.GITHUB_TOKEN }}
env:
ON_LOCAL: true
ON_UBUNTU: true
# Because there is no 'ansys-tools-path' we need to input the executable path.
PYMAPDL_MAPDL_EXEC: /ansys_inc/v222/ansys/bin/ansys222

steps:
- name: "Install Git and checkout project"
uses: actions/checkout@v4
with:
repository: ${{ github.event.pull_request.head.repo.full_name }}
ref: ${{ github.event.pull_request.head.ref }}

- name: "Setup Python"
uses: actions/setup-python@v4
with:
python-version: ${{ env.MAIN_PYTHON_VERSION }}

- name: "Checking Python"
run: |
python --version
python -m pip install --upgrade pip

- name: "Install ansys-mapdl-core"
run: |
python -m pip install . --no-deps
python -m pip install -r minimum_requirements.txt
python -c "from ansys.mapdl import core as pymapdl; print('Import successfull')"

- name: "Running some verification manual examples"
run: |
unset PYMAPDL_START_INSTANCE
export ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}
python .ci/run_vms.py

- name: "Unit testing requirements installation"
run: |
python -m pip install pytest pytest-rerunfailures pytest-cov

- name: "Unit testing"
run: |
unset PYMAPDL_START_INSTANCE
export ANSYSLMD_LICENSE_FILE=1055@${{ secrets.LICENSE_SERVER }}
pytest -k "not test_dpf" \
${{ env.PYTEST_ARGUMENTS }} \
--skip-regression-check \
--cov-report=xml:ubuntu-v22.2.0-local-minimal.xml

- uses: codecov/codecov-action@v3
name: "Upload coverage to Codecov"
with:
token: ${{ secrets.CODECOV_TOKEN }}
root_dir: ${{ github.workspace }}
name: ubuntu-v22.2.0-local-minimal.xml
flags: ubuntu,local,v22.2.0,minimal

- name: 'Upload coverage artifacts'
uses: actions/upload-artifact@v3
with:
name: ubuntu-v22.2.0-local-minimal.xml
path: ./ubuntu-v22.2.0-local-minimal.xml

test-windows:
if: github.repository == ''
name: "Local: Build and unit testing on Windows"
name: "Local: Build & test on Windows"
runs-on: [self-hosted, Windows, pymapdl]
timeout-minutes: 30
env:
Expand Down Expand Up @@ -676,6 +754,7 @@ jobs:
./**/*.tar.gz
./**/*pymapdl-Documentation-*.pdf
./**/ansys-mapdl-core*.zip
./minimum_requirements.txt

- name: Upload to Public PyPi
env:
Expand Down
2 changes: 1 addition & 1 deletion doc/source/getting_started/contribution.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use these issue templates:
* **🎓 Adding an example**: Proposing a new example for the library
* **💡 New feature**: Enhancements to the code

If your issue does not fit into one of these categories, click on `Open a black issue <pymapdl_new_blank_issue_>`_.
If your issue does not fit into one of these categories, click on `Open a blank issue <pymapdl_new_blank_issue_>`_.


Viewing PyMAPDL documentation
Expand Down
6 changes: 6 additions & 0 deletions minimum_requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ansys-api-mapdl==0.5.1
importlib-metadata==6.8.0
numpy==1.26.1
platformdirs==3.11.0
psutil==5.9.6
pyansys-tools-versioning==0.5.0
20 changes: 12 additions & 8 deletions src/ansys/mapdl/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,18 @@

__version__ = importlib_metadata.version(__name__.replace(".", "-"))


from ansys.tools.path.path import (
change_default_ansys_path,
find_ansys,
get_ansys_path,
get_available_ansys_installations,
save_ansys_path,
)
try:
from ansys.tools.path.path import (
change_default_ansys_path,
find_ansys,
get_ansys_path,
get_available_ansys_installations,
save_ansys_path,
)
except:
# We don't really use these imports in the library. They are here for
# convenience.
pass

from ansys.mapdl.core._version import SUPPORTED_ANSYS_VERSIONS
from ansys.mapdl.core.convert import convert_apdl_block, convert_script
Expand Down
Loading