From 7b1ce38403fb5c4ba39eb5e21dce3e049649d8da Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Sun, 28 Nov 2021 09:26:38 +0000 Subject: [PATCH 1/3] Add wrap file for kastore 2.0.1 --- c/subprojects/kastore | 1 - c/subprojects/kastore.wrap | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) delete mode 120000 c/subprojects/kastore create mode 100644 c/subprojects/kastore.wrap diff --git a/c/subprojects/kastore b/c/subprojects/kastore deleted file mode 120000 index ee3ac9b241..0000000000 --- a/c/subprojects/kastore +++ /dev/null @@ -1 +0,0 @@ -full-projects/kastore/c/ \ No newline at end of file diff --git a/c/subprojects/kastore.wrap b/c/subprojects/kastore.wrap new file mode 100644 index 0000000000..6c39cc112e --- /dev/null +++ b/c/subprojects/kastore.wrap @@ -0,0 +1,5 @@ +[wrap-file] +directory = kastore-2.0.1 +source_url = https://github.com/tskit-dev/kastore/releases/download/C_2.0.1/kastore-2.0.1.tar.gz +source_filename = kastore-2.0.1.tar.gz +source_hash = eedd3af700f6adf2be01e2f2b768a167452edc35d0b468c9647b232864e9a65a From c9851be6f848e7e322c9be7b494ea79393aede4a Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Sun, 28 Nov 2021 09:39:45 +0000 Subject: [PATCH 2/3] Move submodules into the Python directory, rename --- .gitmodules | 2 +- .../full-projects => python/c-dependencies}/kastore | 0 python/{lib => c-library} | 0 python/setup.py | 4 ++-- 4 files changed, 3 insertions(+), 3 deletions(-) rename {c/subprojects/full-projects => python/c-dependencies}/kastore (100%) rename python/{lib => c-library} (100%) diff --git a/.gitmodules b/.gitmodules index 08c84692c3..a736e5abe4 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "c/kastore"] - path = c/subprojects/full-projects/kastore + path = python/c-dependencies/kastore url = https://github.com/tskit-dev/kastore.git diff --git a/c/subprojects/full-projects/kastore b/python/c-dependencies/kastore similarity index 100% rename from c/subprojects/full-projects/kastore rename to python/c-dependencies/kastore diff --git a/python/lib b/python/c-library similarity index 100% rename from python/lib rename to python/c-library diff --git a/python/setup.py b/python/setup.py index 44e15b9869..7c6fac691f 100644 --- a/python/setup.py +++ b/python/setup.py @@ -23,8 +23,8 @@ def finalize_options(self): self.include_dirs.append(numpy.get_include()) -libdir = "lib" -kastore_dir = os.path.join(libdir, "subprojects", "kastore") +libdir = "c-library" +kastore_dir = os.path.join("c-dependencies", "kastore", "c") tsk_source_files = [ "core.c", "tables.c", From a087bf695588a0c7395e3186be61a9211118bf0c Mon Sep 17 00:00:00 2001 From: Jerome Kelleher Date: Sun, 28 Nov 2021 09:48:41 +0000 Subject: [PATCH 3/3] Fixup CI to work with new layout --- .circleci/config.yml | 2 +- .github/workflows/tests.yml | 15 ++++----------- .github/workflows/wheels.yml | 11 +++++------ c/tests/meson-subproject/meson.build | 4 ++++ c/tests/meson-subproject/subprojects/kastore | 1 - c/tests/meson-subproject/subprojects/kastore.wrap | 1 + python/requirements/development.txt | 3 +-- python/requirements/development.yml | 2 +- 8 files changed, 17 insertions(+), 22 deletions(-) delete mode 120000 c/tests/meson-subproject/subprojects/kastore create mode 120000 c/tests/meson-subproject/subprojects/kastore.wrap diff --git a/.circleci/config.yml b/.circleci/config.yml index ea0163a350..dbe2c6c283 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -13,7 +13,7 @@ commands: sudo apt-get update sudo apt-get install -y ninja-build libcunit1-dev valgrind clang doxygen python3-pip # Install meson to the system packages so we can run it as root - sudo pip install meson==0.55 + sudo pip install meson pip install numpy==1.18.5 pip install --user -r python/requirements/CI-complete/requirements.txt pip install twine --user diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 7f5fcc7e1f..9be722f2be 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -71,11 +71,10 @@ jobs: working-directory: python if: matrix.os == 'windows-latest' run: | - rm -r lib - mkdir lib - cp -r --dereference ../c/subprojects lib/. - cp -r --dereference ../c/tskit lib/. - cp ../c/tskit.h lib/. + rm -r c-library + mkdir c-library + cp -r --dereference ../c/tskit c-library/ + cp ../c/tskit.h c-library/ - name: Fix windows .profile if: steps.cache.outputs.cache-hit != 'true' && matrix.os == 'windows-latest' @@ -165,12 +164,6 @@ jobs: mingw-w64-${{matrix.env}}-meson mingw-w64-${{matrix.env}}-cunit - - name: Fix windows symlinks - working-directory: c - run: | - rm -f subprojects/kastore - cp -r --dereference subprojects/full-projects/kastore/c subprojects/kastore - - name: Build working-directory: c run: | diff --git a/.github/workflows/wheels.yml b/.github/workflows/wheels.yml index c3e3d9ebd0..0d88e4566d 100644 --- a/.github/workflows/wheels.yml +++ b/.github/workflows/wheels.yml @@ -84,12 +84,11 @@ jobs: git reset --hard cd python ${PYTHON} -VV - # For some reason I can't work out the C compiler is not following symlinks - rm -r lib - mkdir lib - cp -r --dereference ../c/subprojects lib/. - cp -r --dereference ../c/tskit lib/. - cp ../c/tskit.h lib/. + # Fix symlinks for windows + rm -r c-library + mkdir c-library + cp -r --dereference ../c/tskit c-library/ + cp ../c/tskit.h c-library/ ${PYTHON} setup.py build_ext --inplace - name: Build Wheel env: diff --git a/c/tests/meson-subproject/meson.build b/c/tests/meson-subproject/meson.build index ee4218db18..94b6a9d84a 100644 --- a/c/tests/meson-subproject/meson.build +++ b/c/tests/meson-subproject/meson.build @@ -1,5 +1,9 @@ project('example', 'c') +# TODO update this once we have the tskit wrap setup and can +# test whether we can automatically pull in kastore or not. +# https://github.com/tskit-dev/tskit/issues/1961 + kastore_proj = subproject('kastore') kastore_dep = kastore_proj.get_variable('kastore_dep') tskit_proj = subproject('tskit') diff --git a/c/tests/meson-subproject/subprojects/kastore b/c/tests/meson-subproject/subprojects/kastore deleted file mode 120000 index ff09d40cad..0000000000 --- a/c/tests/meson-subproject/subprojects/kastore +++ /dev/null @@ -1 +0,0 @@ -../../../subprojects/full-projects/kastore/c/ \ No newline at end of file diff --git a/c/tests/meson-subproject/subprojects/kastore.wrap b/c/tests/meson-subproject/subprojects/kastore.wrap new file mode 120000 index 0000000000..c748a81107 --- /dev/null +++ b/c/tests/meson-subproject/subprojects/kastore.wrap @@ -0,0 +1 @@ +../../../subprojects/kastore.wrap \ No newline at end of file diff --git a/python/requirements/development.txt b/python/requirements/development.txt index 7759d4d43b..bd5ac945ea 100644 --- a/python/requirements/development.txt +++ b/python/requirements/development.txt @@ -10,8 +10,7 @@ h5py>=2.6.0 jsonschema>=3.0.0 jupyter-book>=0.12.1 kastore -# More recent meson is too strict. See #1515. -meson<=0.56 +meson msgpack>=1.0.0 msprime>=1.0.0 networkx diff --git a/python/requirements/development.yml b/python/requirements/development.yml index e5a370f1b3..5e8f0f8b20 100644 --- a/python/requirements/development.yml +++ b/python/requirements/development.yml @@ -16,7 +16,7 @@ dependencies: - h5py>=2.6.0 - jsonschema>=3.0.0 - kastore - - meson<=0.56 # More recent meson is too strict. See #1515. + - meson - msprime>=1.0.0 - networkx - ninja