Repository: fusion-energy/openmc-plasma-source (language: python)

Issue:
added inital files for conda package
This PR adds files needed to produce a conda package

I also made a small change to one of the tests
```
# old 
assert pytest.approx(sum(tokamak_source.strengths), 1)

# new
assert pytest.approx(sum(tokamak_source.strengths)) == 1
```


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/anaconda-publish.yml b/.github/workflows/anaconda-publish.yml
new file mode 100644
index 0000000..247bb06
--- /dev/null
+++ b/.github/workflows/anaconda-publish.yml
@@ -0,0 +1,31 @@
+name: anaconda-publish
+
+on:
+  workflow_dispatch:
+  release:
+    types: [published]
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    container: continuumio/miniconda3:4.10.3
+
+    steps:
+      - uses: actions/checkout@v2
+
+      - name: Set up conda
+        run: |
+            apt-get --allow-releaseinfo-change update
+            apt install -y libgl1-mesa-glx
+            conda install -y anaconda-client conda-build
+            conda config --set anaconda_upload no
+            conda install boa -c conda-forge
+      - name: Build and publish to conda
+        env:
+          ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
+        run: |
+            conda mambabuild conda -c fusion-energy -c conda-forge --config-file conda/conda_build_config.yaml
+            conda convert /opt/conda/conda-bld/linux-64/*.tar.bz2 --platform osx-64
+            anaconda upload -f /opt/conda/conda-bld/*/*.tar.bz2
+
+# Note conversion to windows is not supported as OpenMC is a dependency 
diff --git a/conda/conda_build_config.yaml b/conda/conda_build_config.yaml
new file mode 100644
index 0000000..59d8986
--- /dev/null
+++ b/conda/conda_build_config.yaml
@@ -0,0 +1,5 @@
+python:
+    - 3.10
+    - 3.9
+    - 3.8
+    - 3.7
diff --git a/conda/meta.yaml b/conda/meta.yaml
new file mode 100644
index 0000000..f0b98a8
--- /dev/null
+++ b/conda/meta.yaml
@@ -0,0 +1,48 @@
+{% set name = "openmc_plasma_source" %}
+
+package:
+  name: "{{ name|lower }}"
+  # conda package version tag is obtained from the git release version tag
+  version: {{ GIT_DESCRIBE_TAG }}
+
+source:
+  path: ..
+
+build:
+  number: 0
+  script: python setup.py install --single-version-externally-managed --record=record.txt
+
+requirements:
+  build:
+    - python {{ python }}
+    - setuptools
+  run:
+    - python {{ python }}
+    - openmc
+    - param
+    - importlib-metadata  # <py3.8
+
+test:
+  imports:
+    - openmc_plasma_source
+  requires:
+    - pytest
+    - hypothesis
+  source_files:
+    - tests/
+  commands:
+    - pytest tests
+
+
+about:
+  home: "https://github.com/fusion-energy/openmc_plasma_source"
+  license: MIT
+  license_family: MIT
+  license_file: LICENSE.txt
+  doc_url: https://github.com/fusion-energy/openmc_plasma_source
+  dev_url: https://github.com/fusion-energy/openmc_plasma_source
+  summary: openmc_plasma_source - Creates tokamak plasma sources for OpenMC
+
+extra:
+  recipe-maintainers:
+    - shimwell


Test patch:
diff --git a/tests/test_tokamak_source.py b/tests/test_tokamak_source.py
index 714f130..70f77cb 100644
--- a/tests/test_tokamak_source.py
+++ b/tests/test_tokamak_source.py
@@ -316,7 +316,7 @@ def tokamak_source_strategy(draw):
 @settings(max_examples=50)
 def test_strengths_are_normalised(tokamak_source):
     """Tests that the sum of the strengths attribute is equal to"""
-    assert pytest.approx(sum(tokamak_source.strengths), 1)
+    assert pytest.approx(sum(tokamak_source.strengths)) == 1
 
 
 @given(tokamak_source=tokamak_source_strategy())