0

I am trying to install a conda package I created using GitHub actions, but when trying to install the package on the remote system I want, I am getting a strange error. I am not sure what is missing in the either the yaml file for the GH Action, or the meta.yaml file.

Here is the GH actions yaml

name: Build and Publish
on:
  push:
    tags:
      - '*'
  workflow_dispatch:

jobs:
  build_wheels:
    name: Build wheel for ${{ matrix.python }}-${{ matrix.os}}
    runs-on: ${{ matrix.os}}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest]
        python: ["3.10"]
    steps:
      - name: Checkout repository
        uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: Get Tag
        run: |
          TAG=${{ github.ref_name }}
          echo "PACKAGE_VERSION=${TAG#v}" >> $GITHUB_ENV
        shell: bash -el {0}

      - name: Test tag
        run: echo $PACKAGE_VERSION
        shell: bash -el {0}

      - name: Set up Python
        uses: conda-incubator/setup-miniconda@v2
        with:
          auto-update-conda: true
          python-version: ${{ matrix.python }}
          activate-environment: wheel-env
          channels: simpleitk,conda-forge,defaults

      - name: Install dependencies
        run: |
          conda install anaconda-client wheel setuptools setuptools-git-versioning build conda-build twine
        shell: bash -el {0}

      - name: Build and upload conda package
        run: conda build --token ${{ secrets.ANACONDA_TOKEN_MEDIPT }} ./conda
        shell: bash -el {0}

And here is the conda build meta.yaml

package:
  name: foo
  version: {{ environ["PACKAGE_VERSION"] }}

source:
    path: ../

build:
    number: 0
    script: {{ PYTHON }} -m pip install -vv --no-deps --ignore-installed -e .

requirements:
  build:
    - numpy
    - SimpleITK

  host:
    - python
    - setuptools
    - pip
    - SimpleITK

  run:
    - python >=3.7
    - numpy >=1.20.0
    - SimpleITK >=2.2.0
    - scipy >=1.6.0

The package is built and properly uploaded to Anaconda at the correct channel. However, when trying to install the package with a fresh (and up-to-date) conda environment, I get:

(test_env) user@system:~$ conda install foo -c foo
Collecting package metadata (current_repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: unsuccessful attempt using repodata from current_repodata.json, retrying with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: unsuccessful initial attempt using frozen solve. Retrying with flexible solve.
Solving environment: \
Found conflicts! Looking for incompatible packages.
This can take several minutes.  Press CTRL-C to abort.                                                                                                                                         failed

UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - foo -> python[version='>=3.11,<3.12.0a0|>=3.9,<3.10.0a0|>=3.8,<3.9.0a0|>=3.7,<3.8.0a0']

Your python: python=3.10

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.

The following specifications were found to be incompatible with your system:

  - feature:/linux-64::__glibc==2.27=0
  - feature:|@/linux-64::__glibc==2.27=0

Your installed version is: 2.27
krolic
  • 51
  • 2
  • A couple of things. First, I suggest adding a version specifier to requirements.host.python. Second, if this is a pure python package I suggest adding `noarch: python` in the `build` section. See https://github.com/conda-forge/pyannote.core-feedstock/blob/main/recipe/meta.yaml. – JZimmerman Aug 22 '23 at 21:55
  • Thanks, but those changes, though helpful, did not fix any of the problems. – krolic Aug 23 '23 at 04:42

0 Answers0