Repository: esa/NIDN (language: python)

Issue:
Get first release on pip
As title


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/deploy_to_pypi.yml b/.github/workflows/deploy_to_pypi.yml
new file mode 100644
index 0000000..c28063c
--- /dev/null
+++ b/.github/workflows/deploy_to_pypi.yml
@@ -0,0 +1,28 @@
+# This workflows will upload a Python Package using Twine when a release is created
+# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
+
+name: Upload Python Package to pypi
+
+on: workflow_dispatch
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: "3.8"
+      - name: Install dependencies
+        run: |
+          pip install setuptools wheel twine
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+      - name: Build and publish
+        env:
+          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+        run: |
+          python setup.py sdist bdist_wheel
+          twine upload dist/*
diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644
index 0000000..700e1dc
--- /dev/null
+++ b/MANIFEST.in
@@ -0,0 +1,2 @@
+include nidn/utils/resources/default_config.toml
+include nidn/materials/data/*.csv
\ No newline at end of file
diff --git a/nidn/__init__.py b/nidn/__init__.py
index e2afbcf..e5a2d9e 100644
--- a/nidn/__init__.py
+++ b/nidn/__init__.py
@@ -34,10 +34,11 @@
     os.environ["TORCH_DEVICE"] = "cpu"
 
 logger.info(f"Initialized NIDN for {os.environ['TORCH_DEVICE']}")
-
 # Set precision (and potentially GPU)
 torch.set_default_tensor_type(torch.DoubleTensor)
 logger.info("Using double precision")
+logger.info(f"Switching log level to warning.")
+set_log_level("WARNING")
 
 __all__ = [
     "compute_spectrum",
diff --git a/setup.py b/setup.py
index 9c370b7..a549951 100644
--- a/setup.py
+++ b/setup.py
@@ -16,6 +16,7 @@
     url="https://github.com/esa/nidn",
     author="ESA Advanced Concepts Team",
     author_email="pablo.gomez@esa.int",
+    include_package_data=True,
     install_requires=[
         "dotmap>=1.3.24",
         "loguru>=0.5.3",
@@ -24,6 +25,7 @@
         "pandas>=1.3.1",
         "scipy>=1.6.0",
         "tqdm>=4.56.1",
+        "toml>=0.10.2",
         "torch>=1.9",
     ],
     classifiers=[
@@ -36,6 +38,8 @@
     ],
     packages=[
         "nidn",
+        "nidn.fdtd",
+        "nidn.fdtd_integration",
         "nidn.materials",
         "nidn.plots",
         "nidn.tests",


Test patch:
diff --git a/.github/workflows/deploy_to_test_pypi.yml b/.github/workflows/deploy_to_test_pypi.yml
new file mode 100644
index 0000000..fdc638f
--- /dev/null
+++ b/.github/workflows/deploy_to_test_pypi.yml
@@ -0,0 +1,31 @@
+# This workflows will upload a Python Package using Twine when a release is created
+# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
+
+name: Upload Python Package to testpypi
+
+on:
+  workflow_dispatch:
+  release:
+    types: [created]
+
+jobs:
+  deploy:
+    runs-on: ubuntu-18.04
+
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: 3.8
+      - name: Install dependencies
+        run: |
+          pip install setuptools wheel twine
+          if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
+      - name: Build and publish
+        env:
+          TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
+          TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
+        run: |
+          python setup.py sdist bdist_wheel
+          twine upload -r testpypi  dist/*