From 7cba41cb482e4e5fc7be030074f5c508b55ff3b9 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 13:36:50 +0200 Subject: [PATCH 01/10] simplifying workflow --- .github/workflows/ubuntu.yml | 1 - README.md | 15 ++------- pyproject.toml | 60 +++++++++++++++++------------------- 3 files changed, 31 insertions(+), 45 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 32befa9..ce7bed2 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -38,7 +38,6 @@ jobs: run: | echo "Installing Python dependencies and irrevolutions" python3 -m pip install --upgrade pip - python3 -m pip install -r requirements.txt # Adjust this if you're using a different file for dependencies python3 -m pip install . # Install irrevolutions package # Optionally run tests within the environment diff --git a/README.md b/README.md index bbcc9a1..c1fe989 100644 --- a/README.md +++ b/README.md @@ -71,26 +71,15 @@ For a windows box: docker run --rm -ti -v "C:/...":/home/numerix" -w /home/numerix kumiori3\numerix:stable-amd64 ``` - -We recommend using Poetry to manage Python dependencies and the virtual environment for the project. Follow the instructions below to install Poetry and set up the environment. - -``` -curl -sSL https://install.python-poetry.org | python3 - -export PATH="$HOME/.local/bin:$PATH" -``` - Clone this repository: ``` -git clone https://github.com/kumiori/irrevolutions.git +git clone https://github.com/kumiori/irrevolutions.gt cd irrevolutions ``` -Finally, to install `irrevolutions` with poetry run -```poetry install``` - -Alternatively, `irrevolutions` can be installed using setuptools from the root directory +Finally, `irrevolutions` can be installed using setuptools from the root directory ```python3 -m pip install .``` diff --git a/pyproject.toml b/pyproject.toml index 3073da1..d865f44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,41 +2,39 @@ requires = ["setuptools>=42", "wheel"] build-backend = "setuptools.build_meta" -[tool.poetry] +[project] name = "irrevolutions" version = "0.1.0" description = "A Python package for solving nonlinear and nonconvex evolutionary problems using a general energetic notion of stability and dolfinx." -authors = ["Your Name "] - -# Optional dependencies are specified in this section -[tool.poetry.dependencies] -python = "^3.9" -pandas = "^1.2" -sympy = "^1.8" -pytest = "^6.0" -matplotlib = "^3.4" -gmsh = "^4.11.0" -PyYAML = "^6.0.1" -scipy = "^1.12.0" -pyvista = "^0.43" -numba = "^0.60.0" - -[tool.poetry.extras] -dolfinx_support = [] +authors = [ + {name = "Andrés A León Baldelli", email = "leon.baldelli@cnrs.fr"} +] +dependencies = [ + "pandas>=1.2", + "sympy>=1.8", + "pytest>=6.0", + "matplotlib>=3.4", + "gmsh>=4.11.0", + "PyYAML>=6.0.1", + "scipy>=1.12.0", + "pyvista>=0.43", + "numba>=0.60.0" +] +readme = "README.md" +requires-python = ">=3.9" +license = {text = "GNU Lesser General Public License v3.0"} -[tool.poetry.scripts] -irrevolutions = 'irrevolutions:main' +[project.urls] +homepage = "https://github.com/kumiori3/irrevolutions" +repository = "https://github.com/kumiori3/irrevolutions" -# Ensure that non-code files (e.g., default_parameters.yml) are included in the package -[tool.poetry.include] -irrevolutions = ["src/irrevolutions/models/default_parameters.yml"] +[tool.setuptools.packages.find] +where = ["src"] +include = ["irrevolutions*"] -# Additional files to include (e.g., readme, licenses, configs) -include = [ - "README.md", - "LICENSE", - "src/irrevolutions/models/default_parameters.yml" -] +[project.scripts] +irrevolutions = "irrevolutions:main" -[tool.poetry.packages] -irrevolutions = { from = "src/irrevolutions" } +# Optional include files like configuration, license, etc. +[tool.setuptools.package-data] +irrevolutions = ["models/default_parameters.yml"] \ No newline at end of file From 1a28804f1f97652d9b5de7d215ebdb52c204e14e Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 13:50:28 +0200 Subject: [PATCH 02/10] import issues --- .github/workflows/conda.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/conda.yml b/.github/workflows/conda.yml index 16e1c19..128725b 100644 --- a/.github/workflows/conda.yml +++ b/.github/workflows/conda.yml @@ -55,4 +55,4 @@ jobs: source $(conda info --base)/etc/profile.d/conda.sh # Ensure conda is properly initialized echo "Running tests" conda activate fenicsx-env - cd test && pytest -v . || echo "Tests failed" \ No newline at end of file + cd test && python3 -m pytest . || echo "Tests failed" \ No newline at end of file From f577740987225d666f97078c3c3c92b16d99cc17 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 13:56:22 +0200 Subject: [PATCH 03/10] fixing conda relic --- .github/workflows/ubuntu.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index ce7bed2..3c229ee 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -44,5 +44,4 @@ jobs: - name: Run tests run: | echo "Running tests" - conda activate fenicsx-env - cd test && pytest -v . || echo "Tests failed" \ No newline at end of file + cd test && python3 -m pytest . || echo "Tests failed" \ No newline at end of file From 765acdbb46e000f8b8bb57b542aa43f69f3da27b Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:02:10 +0200 Subject: [PATCH 04/10] binary conflict --- .github/workflows/ubuntu.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 3c229ee..5ab9f43 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -38,6 +38,7 @@ jobs: run: | echo "Installing Python dependencies and irrevolutions" python3 -m pip install --upgrade pip + python3 -m pip install --upgrade --force-reinstall numpy python3 -m pip install . # Install irrevolutions package # Optionally run tests within the environment From 0fe6b60a45fd05e0e7d92a12aa44416ab37f86ed Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:11:09 +0200 Subject: [PATCH 05/10] debug versions --- .github/workflows/ubuntu.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 5ab9f43..d1adeb3 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -40,7 +40,11 @@ jobs: python3 -m pip install --upgrade pip python3 -m pip install --upgrade --force-reinstall numpy python3 -m pip install . # Install irrevolutions package - + - name: Check versions of installed packages + run: | + python3 -c "import numpy; print(f'NumPy version: {numpy.__version__}')" + python3 -c "import scipy; print(f'SciPy version: {scipy.__version__}')" + python3 -c "import pyvista; print(f'PyVista version: {pyvista.__version__}')" # Optionally run tests within the environment - name: Run tests run: | From c6eca147a69d5b8105d470d1d99c0f21513a0d54 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:16:04 +0200 Subject: [PATCH 06/10] versions --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index d1adeb3..8661f97 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -38,7 +38,7 @@ jobs: run: | echo "Installing Python dependencies and irrevolutions" python3 -m pip install --upgrade pip - python3 -m pip install --upgrade --force-reinstall numpy + python3 -m pip install numpy==1.21.6 --force-reinstall # Downgrade NumPy to a compatible version python3 -m pip install . # Install irrevolutions package - name: Check versions of installed packages run: | From e81f6b10ffafdfd0a6d7f2a98a0b377c5e83c6d1 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:23:37 +0200 Subject: [PATCH 07/10] pinning numpy <2 --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index d865f44..d09b188 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ dependencies = [ "PyYAML>=6.0.1", "scipy>=1.12.0", "pyvista>=0.43", + "numpy==1.21.6", # Pin NumPy to this version "numba>=0.60.0" ] readme = "README.md" From 92fe8c6b59275b400be4f9e46ab13569248db039 Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:26:16 +0200 Subject: [PATCH 08/10] numpy version --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d09b188..d84df6f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,7 @@ dependencies = [ "PyYAML>=6.0.1", "scipy>=1.12.0", "pyvista>=0.43", - "numpy==1.21.6", # Pin NumPy to this version + "numpy<2", # Pin NumPy to this version "numba>=0.60.0" ] readme = "README.md" From 1d0e72d3056e11b429fcb9cddc6a59864738aeca Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:42:41 +0200 Subject: [PATCH 09/10] try to pin fenicsx --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 8661f97..2e87c62 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,7 +31,7 @@ jobs: echo "Adding FEniCS PPA and installing fenicsx" sudo add-apt-repository ppa:fenics-packages/fenics sudo apt update - sudo apt-get install -y fenicsx + sudo apt-get install -y fenicsx=0.7.3-3~ppa1~lunar1 # Install irrevolutions dependencies (if any) and the package itself - name: Install Python dependencies and irrevolutions From 5d6d4f43508229872e3407f2aa3b4d4d4d90779e Mon Sep 17 00:00:00 2001 From: kumiori Date: Mon, 7 Oct 2024 14:44:07 +0200 Subject: [PATCH 10/10] undoing pinning --- .github/workflows/ubuntu.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ubuntu.yml b/.github/workflows/ubuntu.yml index 2e87c62..8661f97 100644 --- a/.github/workflows/ubuntu.yml +++ b/.github/workflows/ubuntu.yml @@ -31,7 +31,7 @@ jobs: echo "Adding FEniCS PPA and installing fenicsx" sudo add-apt-repository ppa:fenics-packages/fenics sudo apt update - sudo apt-get install -y fenicsx=0.7.3-3~ppa1~lunar1 + sudo apt-get install -y fenicsx # Install irrevolutions dependencies (if any) and the package itself - name: Install Python dependencies and irrevolutions