Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pyproject.toml #105

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

LucaMarconato
Copy link
Collaborator

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
Copy link
Collaborator Author

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

@LucaMarconato
Copy link
Collaborator Author

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

@thewtex
Copy link
Contributor

thewtex commented Feb 10, 2025

@LucaMarconato 👍 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

@LucaMarconato
Copy link
Collaborator Author

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 (prefix-dev/pixi#3104). I tried also on different machine. I'll wait until the linked pixi bug is addressed and try again.

@LucaMarconato
Copy link
Collaborator Author

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.

@josenimo
Copy link

@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

pixi install -a

with pixi 0.40.2.
@thewtex
Copy link
Contributor

thewtex commented Feb 11, 2025

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

I'll push the updates.

zarr.storage.BaseStore is not available in Zarr Python 3.
Replaces DirectoryStore.
@thewtex thewtex force-pushed the min-version-xarray-dataclasses branch from 18cec5d to 4e71dd4 Compare February 11, 2025 19:20
@thewtex
Copy link
Contributor

thewtex commented Feb 11, 2025

@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
Copy link
Contributor

thewtex commented Feb 11, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants