multiscale-spatial-image icon indicating copy to clipboard operation
multiscale-spatial-image copied to clipboard

Update pyproject.toml

Open LucaMarconato opened this issue 11 months ago • 10 comments

When trying to solve a conda env for multiscale-spatial-image I got the following error:

Solving environment (_test_env): ...working... failed
WARNING: failed to get package records, retrying.  exception was: Unsatisfiable dependencies for platform linux-64: {MatchSpec("spatial-image==0.3.0=pyhd8ed1ab_0"), MatchSpec("xarray-dataclasses[version='>=1.1.0']")}
Encountered problems while solving:
  - package spatial-image-0.3.0-pyhd8ed1ab_0 requires xarray-dataclasses >=1.1.0, but none of the providers can be installed

Could not solve for environment specs
The following packages are incompatible
├─ spatial-image >=0.2.1 * is installable and it requires
│  └─ xarray-dataclasses >=1.1.0 * with the potential options
│     ├─ xarray-dataclasses [1.6.0|1.7.0] would require
│     │  └─ xarray >=2022.3,<2023.0 *, which can be installed;
│     └─ xarray-dataclasses 1.7.0 would require
│        └─ xarray >=2022.3,<2024.0 *, which can be installed;
└─ xarray >=2024.10.0 * is not installable because it conflicts with any installable versions previously reported.
Reloading output folder: ...working... done
Solving environment (_test_env): ...working... failed
Reloading output folder: ...working... done
##[warning]Free memory is lower than 5%; Currently used: 98.51%
##[warning]Free memory is lower than 5%; Currently used: 98.51%
Solving environment (_test_env): ...working... failed
Reloading output folder: ...working... done
Solving environment (_test_env): ...working... failed
ERROR: Failed to get package records, max retries exceeded.

We can see indeed from the requirements of xarray-dataclasses==1.7.0 that the package is not compatible with xarray==2024.10.0.

Instead, we see that xarray-dataclasses==1.8.0 should not lead to this constraint. For this reason, this PR sets the minimum version of xarray-dataclasses to 1.8.0. I will mark this PR as ready for review as soon as I manage to obtain a valid conda-forge build.

LucaMarconato avatar Feb 10 '25 16:02 LucaMarconato

The red CI status seems to be unrelated to this PR.

LucaMarconato avatar Feb 10 '25 16:02 LucaMarconato

xarray-dataclasses>=1.8.0 is not available in conda-forge: https://github.com/conda-forge/xarray-dataclasses-feedstock/pull/3. Until it is available we can merge this PR, but we cannot merge https://github.com/conda-forge/multiscale-spatial-image-feedstock/pull/5.

LucaMarconato avatar Feb 10 '25 16:02 LucaMarconato

@LucaMarconato :+1: thanks.

To address the CI, which helps keep better track of dependencies for reproducibility / maintenance:

rm -rf pixi.lock .pixi
pixi install -a
git add .pixi.lock

thewtex avatar Feb 10 '25 20:02 thewtex

Thanks @thewtex for the explanation. I tried it but unfortunately pixi 0.39.5 gets stuck at updating lock-file. I tried updating to the latest version of pixi but I encounter another bug (https://github.com/prefix-dev/pixi/issues/3104). I tried also on different machine. I'll wait until the linked pixi bug is addressed and try again.

LucaMarconato avatar Feb 11 '25 00:02 LucaMarconato

I could use pixi 0.41.1 after removing project.home-page from pyproject.toml. Unfortunately pixi install -a gets stuck on updating lock-file. I wonder if it's a problem of pixi, of the environment or of my machine.

LucaMarconato avatar Feb 11 '25 10:02 LucaMarconato

@LucaMarconato just to add this for context: pixi 0.39.2 I ran pixi install -a with the pyproject.toml and got this:

❯ pixi install -a
  × failed to solve the pypi requirements of 'default' 'linux-64'
  ├─▶ Failed to build `multiscale-spatial-image @ file:///Users/jnimoca/Jose_BI/test_luca`
  ╰─▶ Build backend failed to determine metadata through `prepare_metadata_for_build_editable` (exit status: 1)
      
      [stderr]
      Traceback (most recent call last):
        File "<string>", line 14, in <module>
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/build.py", line 133, in
      prepare_metadata_for_build_editable
          directory = os.path.join(metadata_directory, f'{builder.artifact_project_id}.dist-info')
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/builders/wheel.py", line 815, in
      artifact_project_id
          self.project_id
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/builders/plugin/interface.py", line 374, in
      project_id
          self.__project_id = f'{self.normalize_file_name_component(self.metadata.core.name)}-{self.metadata.version}'
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/metadata/core.py", line 149, in version
          self._version = self._get_version()
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/metadata/core.py", line 248, in _get_version
          version = self.hatch.version.cached
        File "/Users/jnimoca/Library/Caches/rattler/cache/uv-cache/builds-v0/.tmpBAHDuP/lib/python3.10/site-packages/hatchling/metadata/core.py", line 1456, in cached
          raise type(e)(message) from None
      OSError: Error getting the version from source `regex`: file does not exist: multiscale_spatial_image/__about__.py

josenimo avatar Feb 11 '25 13:02 josenimo

Hmm, the update worked locally for me on Linux with Pixi 0.40.2 and 0.41.1.

I'll push the updates.

thewtex avatar Feb 11 '25 17:02 thewtex

@LucaMarconato sorry I did not look at your original comment more carefully.

xarray has integrated xarray-dataclasses in xarray>=2024.10.0. Indeed, we removed the dependency intentionally in #94 and release version 2 of this package accordingly.

thewtex avatar Feb 11 '25 19:02 thewtex

@LucaMarconato one approach would remove the xarray-dataclasses dependency from spatial-image.

thewtex avatar Feb 11 '25 19:02 thewtex

xarray has integrated xarray-dataclasses in xarray>=2024.10.0. Indeed, we removed the dependency intentionally in https://github.com/spatial-image/multiscale-spatial-image/pull/94 and release version 2 of this package accordingly.

Ah, I meant xarray-datatree instead of xarray-dataclasses.

It does seem to be a challenge to get these xarray versions not to conflict.

This should be addressed in #108

thewtex avatar Feb 25 '25 01:02 thewtex

Addressed via #108

thewtex avatar Aug 06 '25 16:08 thewtex