Repository: Morisset/PyNeb_devel (language: python)

Issue:
Fix: Test Github Action
I had modify the pipeline to install the package locally in the virtual enviroment.


Discussion / hints:

Fix patch:
diff --git a/environment.yml b/environment.yml
index 9c6d7975..1b2b8c7e 100644
--- a/environment.yml
+++ b/environment.yml
@@ -8,7 +8,5 @@ dependencies:
   - matplotlib
   - scipy
   - h5py
-  - pandas
-  - astropy
   - pip:
      - pyneb
diff --git a/pyneb/core/pynebcore.py b/pyneb/core/pynebcore.py
index b18c96cb..13f71a08 100644
--- a/pyneb/core/pynebcore.py
+++ b/pyneb/core/pynebcore.py
@@ -42,7 +42,7 @@
     import pyfits
 if config.INSTALLED['astropy Table']:
     from astropy.table import Table #, Column
-elif config.INSTALLED['h5py']:
+if config.INSTALLED['h5py']:
     import h5py
 if config.INSTALLED['ai4neb']:
     from ai4neb import manage_RM
diff --git a/pyproject.toml b/pyproject.toml
index d88046d3..35a405eb 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -4,15 +4,9 @@ build-backend = "setuptools.build_meta"
 
 [project]
 name = "pyneb"
-version = "1.1.23"
+version = "1.1.24b3"
 requires-python = ">= 3.8"
-dependencies = [
-"numpy",
-"matplotlib",
-"scipy",
-"h5py",
-# astropy
-]
+dynamic = ["dependencies"]
 description = "A Python package for nebular analysis"
 authors = [
     { name = "Christophe Morisset", email = "chris.morisset@gmail.com" },
@@ -46,3 +40,9 @@ packages=['pyneb',
                  'atomic_data/deprecated/*.dat']
 'pyneb.extinction'=['*.txt']
 'pyneb.plot'=['level_diagrams/*.png']
+
+[tool.setuptools.dynamic]
+dependencies = {file = ["requirements.txt"]}
+
+[tool.pytest.ini_options]
+testpaths = [ "tests"]
diff --git a/requirements.txt b/requirements.txt
new file mode 100644
index 00000000..4bbafb7c
--- /dev/null
+++ b/requirements.txt
@@ -0,0 +1,5 @@
+numpy
+matplotlib
+scipy
+h5py
+astropy
diff --git a/setup.py b/setup.py
index f55fa223..82737cd4 100644
--- a/setup.py
+++ b/setup.py
@@ -25,4 +25,3 @@
 #                    'pyneb.plot':['level_diagrams/*.png']
 #                    }
 #    )
-


Test patch:
diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml
new file mode 100644
index 00000000..fdcb12b6
--- /dev/null
+++ b/.github/workflows/tests.yml
@@ -0,0 +1,26 @@
+name: test
+on:
+  pull_request:
+    branches:
+      - master
+      - main
+      - devel
+
+jobs:
+  tests:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - name: Set up Python
+        uses: actions/setup-python@v4
+        with:
+          python-version: 3.8.x
+      - name: Install dependencies
+        run: |
+          python -m pip install --upgrade pip
+          #pip install scipy numpy matplotlib astropy h5py
+          pip install .
+      - name: Test with pytest
+        run: |
+          pip install pytest
+          pytest tests --doctest-modules --junitxml=junit/test-results.xml
diff --git a/pyneb/test/__init__.py b/pyneb/test/__init__.py
deleted file mode 100644
index e69de29b..00000000