diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..673d0c2 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,48 @@ +name: test + +on: + push: + - master + pull_request: + +jobs: + unit-test: + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + jdk: [8, 17, 19] + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v3 + + - name: Set up JDK ${{ matrix.jdk }} + uses: actions/setup-java@v1 + with: + java-version: ${{ matrix.jdk }} + + - name: Install Clojure + uses: DeLaGuardo/setup-clojure@11.0 + with: + cli: 1.11.1.1347 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v4 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install numpy + + - name: Run tests (jdk<17) + if: ${{ matrix.jdk < 17 }} + run: | + clojure -M:test + - name: Run tests (jdk>=17) + if: ${{ matrix.jdk >= 17 }} + run: | + clojure -M:jdk-${{matrix.jdk}}:test diff --git a/.gitignore b/.gitignore index 6bd4f64..476e9bb 100644 --- a/.gitignore +++ b/.gitignore @@ -20,4 +20,5 @@ a.out *.iml .lsp .clj-kondo -pregen-ffi-test \ No newline at end of file +pregen-ffi-test +*~ diff --git a/CHANGELOG.md b/CHANGELOG.md index 02545d3..8ff520c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ # Time for a ChangeLog! +## Unreleased + * Fix issue with locating python dll on MS-Windows + [#246](https://github.com/clj-python/libpython-clj/issues/246). + ## 2.024 * large dtype-next/hamf upgrade. * fix for call-attr (it was broken when using keywords). diff --git a/src/libpython_clj2/python/info.clj b/src/libpython_clj2/python/info.clj index 5667f0b..170be78 100644 --- a/src/libpython_clj2/python/info.clj +++ b/src/libpython_clj2/python/info.clj @@ -96,6 +96,7 @@ print(json.dumps( "Failed to find value python executable. Tried %s" default-python-executables))))) python-home (find-python-home system-info options) + platform (:platform system-info) java-lib-path (java-library-path-addendum python-home) [ver-maj ver-med _ver-min] (:version system-info) lib-version (format "%s.%s" ver-maj ver-med) @@ -105,7 +106,12 @@ print(json.dumps( libnames (concat [libname] ;;Make sure we try without the 'm' suffix (when lib-version - [(str "python" lib-version)]))] + [(str "python" lib-version)]) + ;; The official python dll + ;; does not have a dot in + ;; its name. + (when (= platform "win32") + [(str "python" ver-maj ver-med)]))] (merge system-info {:python-home python-home diff --git a/test/libpython_clj2/python_test.clj b/test/libpython_clj2/python_test.clj index e693169..6f46a39 100644 --- a/test/libpython_clj2/python_test.clj +++ b/test/libpython_clj2/python_test.clj @@ -365,7 +365,7 @@ class Foo: bridged-dict (py/as-python {"a" 1 "b" 2}) bridged-iter (py/as-python (repeat 5 1)) bridged-list (py/as-python (vec (range 10))) - pycol (py/import-module "collections") + pycol (py/import-module "collections.abc") mapping-type (py/get-attr pycol "Mapping") iter-type (py/get-attr pycol "Iterable") sequence-type (py/get-attr pycol "Sequence")]