Repository: tschoonj/xraylib (language: python)

Issue:
Bump crazy-max/ghaction-chocolatey from 1.5.0 to 1.6.0
Bumps [crazy-max/ghaction-chocolatey](https://github.com/crazy-max/ghaction-chocolatey) from 1.5.0 to 1.6.0.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/crazy-max/ghaction-chocolatey/releases">crazy-max/ghaction-chocolatey's releases</a>.</em></p>
<blockquote>
<h2>v1.6.0</h2>
<ul>
<li>Bump <code>@​actions/exec</code> from 1.0.4 to 1.1.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/122">#122</a>)</li>
<li>Bump <code>@​actions/core</code> from 1.2.7 to 1.5.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/123">#123</a>)</li>
<li>Chocolatey 0.11.1 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/124">#124</a>)</li>
<li>Simplify build script (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/119">#119</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/crazy-max/ghaction-chocolatey/blob/master/CHANGELOG.md">crazy-max/ghaction-chocolatey's changelog</a>.</em></p>
<blockquote>
<h2>1.6.0 (2021/09/04)</h2>
<ul>
<li>Bump <code>@​actions/exec</code> from 1.0.4 to 1.1.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/122">#122</a>)</li>
<li>Bump <code>@​actions/core</code> from 1.2.7 to 1.5.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/123">#123</a>)</li>
<li>Chocolatey 0.11.1 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/124">#124</a>)</li>
<li>Simplify build script (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/119">#119</a>)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/87d06bbbd2cfb1835f1820042d356aef4875fb5f"><code>87d06bb</code></a> Update CHANGELOG</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/c4a299cbcee2d3625a563d7a7d17ef086962c3a4"><code>c4a299c</code></a> Bump <code>@​actions/exec</code> from 1.0.4 to 1.1.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/122">#122</a>)</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/4dd0765c5dcfebf54bb0f65ce5a041a6d6ddff0a"><code>4dd0765</code></a> Bump <code>@​actions/core</code> from 1.2.7 to 1.5.0 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/123">#123</a>)</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/8bf78e4bd9cbcac15ea45eb6f335f65246b9ea88"><code>8bf78e4</code></a> Chocolatey 0.11.1 (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/124">#124</a>)</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/bdc1e49ed3484cf171a14495f025b37efd98c5f3"><code>bdc1e49</code></a> Update README</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/7a25c2815e3b54598f65ec5d1d53d9f2bba000d7"><code>7a25c28</code></a> Remove stale bot</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/affee6f74d7dfe1dc88b6850abde0c5eb93e4d88"><code>affee6f</code></a> Fix tsconfig</li>
<li><a href="https://github.com/crazy-max/ghaction-chocolatey/commit/5e2f40f3cb297e1a19626132aa8054023491ebca"><code>5e2f40f</code></a> Simplify build script (<a href="https://github-redirect.dependabot.com/crazy-max/ghaction-chocolatey/issues/119">#119</a>)</li>
<li>See full diff in <a href="https://github.com/crazy-max/ghaction-chocolatey/compare/v1.5.0...v1.6.0">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=crazy-max/ghaction-chocolatey&package-manager=github_actions&previous-version=1.5.0&new-version=1.6.0)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)


</details>


Discussion / hints:

Fix patch:
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 709859ea..e6f49d97 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -11,27 +11,47 @@ on:
       - master
 
 jobs:
+  pip:
+    runs-on: ${{ matrix.os }}
+    strategy:
+      fail-fast: false
+      matrix:
+        os: [ubuntu-latest, macos-latest]
+        python-version: ['3.7', '3.8', '3.9', '3.10']
+    name: Pip install with Python ${{ matrix.python-version }} on ${{ matrix.os }}
+    steps:
+      - uses: actions/checkout@v2
+      - name: Set up Python
+        uses: actions/setup-python@v2
+        with:
+          python-version: ${{ matrix.python-version }}
+      - name: Install xraylib with pip
+        run: |
+          python -m pip install -U numpy pip
+          python -m pip install . -vv
+      - name: Test importing xraylib
+        run: |
+          python -c "import xraylib"
+          python -c "import xraylib_np"
+
   visual-studio:
     timeout-minutes: 60
     runs-on: windows-latest
     strategy:
       matrix:
-        python-version: [ '3.6', '3.7', '3.8', '3.9']
+        python-version: [ '3.7', '3.8', '3.9', '3.10']
         compiler:
           - cl
           - clang-cl
         # don't know why but cl.exe does not like the Cython generated code with python < 3.8
         include:
           - numpy: enabled
-          - python-version: 3.6
-            numpy: disabled
-            compiler: cl
           - python-version: 3.7
             numpy: disabled
             compiler: cl
     name: Visual Studio with ${{matrix.compiler}} and Python ${{ matrix.python-version }}
     steps:
-    - uses: actions/checkout@v2.3.4
+    - uses: actions/checkout@v2.4.0
     - uses: conda-incubator/setup-miniconda@v2.1.1
       with:
         auto-update-conda: true
@@ -40,7 +60,7 @@ jobs:
     - name: Install meson, ninja, numpy and cython
       run: |
         conda install -q -y meson ninja numpy cython swig
-    - uses: ilammy/msvc-dev-cmd@v1.9.0
+    - uses: ilammy/msvc-dev-cmd@v1.10.0
     - name: Build with meson
       run: |
         meson setup builddir --buildtype=release -Dpython=python -Dpython-bindings=enabled -Dpython-numpy-bindings=${{ matrix.numpy }}
@@ -71,11 +91,11 @@ jobs:
       run:
         shell: msys2 {0}
     steps:
-    - uses: crazy-max/ghaction-chocolatey@v1.5.0
+    - uses: crazy-max/ghaction-chocolatey@v1.6.0
       with:
         args: install innosetup lazarus
     # required for the lib command
-    - uses: ilammy/msvc-dev-cmd@v1.9.0
+    - uses: ilammy/msvc-dev-cmd@v1.10.0
       with:
         arch: x64
     - uses: msys2/setup-msys2@v2
@@ -87,7 +107,6 @@ jobs:
           git
           mingw-w64-x86_64-gcc
           mingw-w64-x86_64-gcc-fortran
-          mingw-w64-x86_64-libtool
           mingw-w64-x86_64-libxml2
           mingw-w64-x86_64-clang
           mingw-w64-x86_64-openmp
@@ -99,11 +118,12 @@ jobs:
           mingw-w64-x86_64-meson
           automake
           autoconf
+          libtool
           make
           patch
           wget
           tar
-    - uses: actions/checkout@v2.3.4
+    - uses: actions/checkout@v2.4.0
     - name: Primary build and test with Meson
       if: matrix.buildsystem == 'meson'
       run: |
@@ -213,7 +233,7 @@ jobs:
             # -fdeclspec is only supported by llvm's clang!
             enable_ruby: disable
     steps:
-    - uses: actions/checkout@v2.3.4
+    - uses: actions/checkout@v2.4.0
     - name: Install Homebrew dependencies
       run: |
         set -ex
@@ -328,13 +348,12 @@ jobs:
       fail-fast: false
       matrix:
         image: 
-          - ubuntu:bionic
           - ubuntu:focal
           - ubuntu:devel
-          - debian:buster
+          - debian:bullseye
           - debian:sid
           - centos:7
-          - centos:8
+          - rockylinux:8
           - fedora:latest
           - fedora:rawhide
         cc:
@@ -344,15 +363,11 @@ jobs:
           - autotools
           - meson
         exclude:
-          - image: ubuntu:bionic
-            buildsystem: meson
           - image: ubuntu:focal
             buildsystem: meson
-          - image: debian:buster
-            buildsystem: meson
           - image: centos:7
             buildsystem: meson
-          - image: centos:8
+          - image: rockylinux:8
             buildsystem: meson
         include:
           # at least some versions of clang cannot compile php bindings
@@ -368,7 +383,7 @@ jobs:
             cxx: g++
             php: enable
           - cc: clang
-            image: centos:8
+            image: rockylinux:8
             perl: disable
             libs: -stdlib=libstdc++
             fortran: disable
@@ -393,19 +408,18 @@ jobs:
             perl: disable
             python: disable
             clang_cflags: -Qunused-arguments
-          - image: ubuntu:bionic
-            lua: /usr/bin/lua5.3
           - image: ubuntu:focal
             lua: /usr/bin/lua5.3
           - image: ubuntu:devel
             lua: /usr/bin/lua5.3
-          - image: debian:buster
+          - image: debian:bullseye
             lua: /usr/bin/lua5.3
           - image: debian:sid
             lua: /usr/bin/lua5.3
+            php: disable # comes with PHP 8, unsupported by SWIG
           - image: centos:7
             lua: /usr/bin/lua
-          - image: centos:8
+          - image: rockylinux:8
             lua: /usr/bin/lua
           - image: fedora:latest
             lua: /usr/bin/lua
@@ -430,7 +444,7 @@ jobs:
         set -ex
         yum install -y git
         set +ex
-    - uses: actions/checkout@v2.3.4
+    - uses: actions/checkout@v2.4.0
     - name: Install ubuntu dependencies
       if: startsWith(matrix.image, 'ubuntu') || startsWith(matrix.image, 'debian')
       run: |
@@ -450,7 +464,7 @@ jobs:
       env:
         DEBIAN_FRONTEND: noninteractive
     - name: Activate CentOS 8 PowerTools and EPEL repo
-      if: matrix.image == 'centos:8'
+      if: matrix.image == 'rockylinux:8'
       run: |
         set -ex
         yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm
@@ -465,7 +479,7 @@ jobs:
         yum install -y python36-Cython # this one needs to be brought in separately for CentOS 7
         set +ex
     - name: Install RHEL dependencies
-      if: startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora')
+      if: startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora') || startsWith(matrix.image, 'rockylinux')
       run: |
         set -ex
         yum update -y
@@ -476,7 +490,7 @@ jobs:
         which javac
         set +ex
     - name: Install RHEL dependencies Meson and Ninja
-      if: matrix.buildsystem == 'meson' && (startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora'))
+      if: matrix.buildsystem == 'meson' && (startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora') || startsWith(matrix.image, 'rockylinux'))
       run: |
         set -ex
         yum install -y meson ninja-build
@@ -539,7 +553,7 @@ jobs:
         DISTCHECK_CONFIGURE_FLAGS: --${{matrix.fpc}}-pascal --enable-java --${{matrix.perl}}-perl --enable-lua --${{matrix.python}}-python --${{matrix.python}}-python-numpy --${{matrix.php}}-php --enable-ruby --${{matrix.fortran}}-fortran2003
         CFLAGS: ${{matrix.clang_cflags}}
     - name: Test rpm-build
-      if: matrix.buildsystem == 'autotools' && (startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora'))
+      if: matrix.buildsystem == 'autotools' && (startsWith(matrix.image, 'centos') || startsWith(matrix.image, 'fedora') || startswith(matrix.image, 'rockylinux'))
       run: |
         set -ex
         rpmdev-setuptree
diff --git a/meson.build b/meson.build
index 6bdc31da..aabce27b 100644
--- a/meson.build
+++ b/meson.build
@@ -82,6 +82,8 @@ if get_option('default_library') != 'static'
   elif cc.has_argument('-fvisibility=hidden')
     config_h_data.set('XRL_EXTERN', '__attribute__((visibility("default"))) extern')
   endif
+else
+  config_h_data.set('XRL_EXTERN', 'extern')
 endif
  
 if cc.get_id() not in ['msvc', 'clang-cl'] and cc.has_header('complex.h')
diff --git a/pyproject.toml b/pyproject.toml
new file mode 100644
index 00000000..6d34f721
--- /dev/null
+++ b/pyproject.toml
@@ -0,0 +1,33 @@
+[project]
+authors = [
+    {name="Tom Schoonjans", email="Tom.Schoonjans@gmail.com"}
+]
+description = "pip-installable xraylib"
+requires-python = "~=3.7"
+readme = "README.md"
+classifiers = [
+    "Intended Audience :: Developers",
+    "License :: OSI Approved :: BSD",
+    "Programming Language :: Python :: 3",
+    "Topic :: Software Development :: Libraries :: Python Modules",
+]
+dependencies = [
+  "numpy"
+]
+
+[project.urls]
+repository = "https://github.com/tschoonj/xraylib"
+documentation = "https://github.com/tschoonj/xraylib"
+
+[build-system]
+requires = ["mesonpep517", "ninja", "Cython", "numpy"]
+build-backend = "mesonpep517.buildapi"
+
+[tool.mesonpep517.metadata]
+meson-python-option-name = "python"
+meson-options = [
+  "-Ddefault_library=static",
+  "-Dpython-bindings=enabled",
+  "-Dpython-numpy-bindings=enabled"
+]
+summary = "pip-installable xraylib"
\ No newline at end of file


Test patch:
diff --git a/python/tests/meson.build b/python/tests/meson.build
index d4811f50..9591eef3 100644
--- a/python/tests/meson.build
+++ b/python/tests/meson.build
@@ -13,6 +13,8 @@ test_env = environment()
 test_env.prepend('PYTHONPATH', pydir)
 if host_system == 'windows'
     test_env.prepend('PATH', src_build_dir)
+    # see https://github.com/xhochy/python-feedstock/blob/6efc12d0479e958a138bfaf3d1eb6b47a10d5f68/recipe/patches/0014-Add-CondaEcosystemModifyDllSearchPath.patch
+    test_env.prepend('CONDA_DLL_SEARCH_MODIFICATION_ENABLE', '1')
 endif
 
 foreach _test : tests