From 8a6223c7e8d056f3ba5bd7a4d26927eb72852a35 Mon Sep 17 00:00:00 2001 From: IanCa Date: Mon, 5 Feb 2024 12:41:35 -0600 Subject: [PATCH 1/4] Fix toml install, make sure installer test works --- .github/workflows/test_installer.yaml | 12 +++--------- pyproject.toml | 7 +++++-- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/.github/workflows/test_installer.yaml b/.github/workflows/test_installer.yaml index d9e6dc24..ab845b09 100644 --- a/.github/workflows/test_installer.yaml +++ b/.github/workflows/test_installer.yaml @@ -6,7 +6,6 @@ on: jobs: build: - runs-on: ubuntu-latest strategy: @@ -14,18 +13,13 @@ jobs: python-version: ["3.7", "3.10"] steps: - - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel - - name: Install package + - name: Install package directly from the current repository run: | - pip install . + pip install git+https://github.com/${{ github.repository }}@develop - name: Run post-installation test run: | - python -c "import hed" \ No newline at end of file + python -c "from hed.models.hed_string import HedString; print('Import test passed.')" diff --git a/pyproject.toml b/pyproject.toml index 6c308f2b..bc817e5b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -62,8 +62,11 @@ versionfile_build = "hed/_version.py" tag_prefix = "" parentdir_prefix = "hedtools-" -[tool.setuptools] -packages = ["hed"] + +[tool.setuptools.packages.find] +where = [""] +include = ["hed*"] +namespaces = false [tool.setuptools.package-data] hed = ["schema/schema_data/*.xml"] From fcf7704630ab1847ae7eccb216c2dab1638712e2 Mon Sep 17 00:00:00 2001 From: IanCa Date: Mon, 5 Feb 2024 13:01:45 -0600 Subject: [PATCH 2/4] Tweak installer test --- .github/workflows/test_installer.yaml | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test_installer.yaml b/.github/workflows/test_installer.yaml index ab845b09..c4e6c032 100644 --- a/.github/workflows/test_installer.yaml +++ b/.github/workflows/test_installer.yaml @@ -13,13 +13,24 @@ jobs: python-version: ["3.7", "3.10"] steps: + - uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - - name: Install package directly from the current repository + + - name: Create and activate virtual environment + run: | + python -m venv .venv + source .venv/bin/activate + + - name: Install package run: | - pip install git+https://github.com/${{ github.repository }}@develop + python -m pip install --upgrade pip + pip install . + - name: Run post-installation test run: | + source .venv/bin/activate python -c "from hed.models.hed_string import HedString; print('Import test passed.')" + From 623f75350a8b8565554f6ae2f97345ec19c3492d Mon Sep 17 00:00:00 2001 From: IanCa Date: Mon, 5 Feb 2024 13:08:35 -0600 Subject: [PATCH 3/4] Need venv in more steps --- .github/workflows/test_installer.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test_installer.yaml b/.github/workflows/test_installer.yaml index c4e6c032..c22baec1 100644 --- a/.github/workflows/test_installer.yaml +++ b/.github/workflows/test_installer.yaml @@ -26,6 +26,7 @@ jobs: - name: Install package run: | + source .venv/bin/activate python -m pip install --upgrade pip pip install . From bf462e2817c8ff310ec3dd97606484b01ed90c39 Mon Sep 17 00:00:00 2001 From: IanCa Date: Mon, 5 Feb 2024 13:34:03 -0600 Subject: [PATCH 4/4] Run installer test in a different folder --- .github/workflows/test_installer.yaml | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test_installer.yaml b/.github/workflows/test_installer.yaml index c22baec1..ef71d32c 100644 --- a/.github/workflows/test_installer.yaml +++ b/.github/workflows/test_installer.yaml @@ -1,8 +1,8 @@ on: push: - branches: [develop] + branches: ["develop"] pull_request: - branches: [develop] + branches: ["develop"] jobs: build: @@ -19,19 +19,26 @@ jobs: with: python-version: ${{ matrix.python-version }} + - name: Create work directory + run: | + mkdir workdir + echo "WORKDIR=$(pwd)/workdir" >> $GITHUB_OUTPUT + - name: Create and activate virtual environment run: | + cd $WORKDIR python -m venv .venv source .venv/bin/activate - name: Install package run: | + cd $WORKDIR source .venv/bin/activate python -m pip install --upgrade pip - pip install . + pip install $GITHUB_WORKSPACE - name: Run post-installation test run: | + cd $WORKDIR source .venv/bin/activate python -c "from hed.models.hed_string import HedString; print('Import test passed.')" -