Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .scripts/run_docker_build.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 33 additions & 14 deletions build-locally.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 11 additions & 12 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,55 +1,54 @@
{% set name = "spatialdata" %}
{% set version = "0.2.5" %}
{% set python_min = "3.9" %}
{% set version = "0.3.0" %}
{% set python_min = "3.10" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.org/packages/source/{{ name[0] }}/{{ name }}/spatialdata-{{ version }}.tar.gz
sha256: 4ed8f30347a524548ce54f5957383dd8165ac27ead1c02c68be322854556d17f
sha256: 9215dd5171ac9ac0eed01a265f43092c8bdb760f0b1e994795fa274c5c638611

build:
noarch: python
script: {{ PYTHON }} -m pip install . -vv
script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation
Copy link
Member

@LucaMarconato LucaMarconato Apr 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jdblischak could you please comment on --no-deps and --no-build-isolation?

I see that they are added here in spatialdata-feedstock and in these downstream repositories:

but not in these downstream repositories:

Also the parameters are not used in these upstream repositories:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CC @giovp

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, pip will install any missing dependencies. However, all dependencies should be specified in the recipe and installed by conda. Using the flag --no-deps is a best practice to ensure all the required dependencies are defined in the recipe. It should be added to any recipe that is missing it

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By default, pip creates a separate build environment, installs the build requirements, and build the package in this separate environment. Thus this completely defeats the purpose of using the conda recipe to specify the build requirements. Any recipe missing --no-build-isolation should have the flag added. It ensures the package is built by the conda packages indicated in the recipe.

Copy link
Member Author

@jdblischak jdblischak Apr 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good habit when creating a new recipe or updating an existing one is to use grayskull, eg:

grayskull pypi --strict-conda-forge spatialdata
grep script spatialdata/meta.yaml
##   script: {{ PYTHON }} -m pip install . -vv --no-deps --no-build-isolation

which is the officially recommended method to generate conda-forge recipes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I will add these parameters to the incoming conda releases.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tag also the other devs that are listed as maintainers of the repos above @melonora @timtreis @thewtex

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick follow-up to add some more nuance. While the official stance is to add --no-deps --no-build-isolation, there is some debate in the community (conda/grayskull#582, conda/grayskull#584). Essentially in most cases the flags are redundant because conda-build/rattler-build set env vars to accomplish this. However, they are required for recipes with multiple outputs and in the past when conda-build has failed to set the env vars.

Personally, I like including the flags even when they are redundant because they make it more transparent to readers of the recipe that these pip behaviors are being enforced.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the extra details!

number: 0

requirements:
host:
- hatch-vcs
- hatchling
- pip
- python {{ python_min }}
- python {{ python_min }},<3.13
run:
- anndata >=0.9.1
- click
- dask-core >=2024.4.1,<2025
- dask-core >=2024.4.1,<=2024.11.2
- dask-image
- datashader
- fsspec <=2023.6
- fsspec
- geopandas >=0.14
- multiscale-spatial-image >=1.0.0,<2.0.0
- multiscale-spatial-image >=2.0.2
- networkx
- numba
- numpy
- ome-zarr >=0.8.4,<0.10.3
- pandas
- pooch
- pyarrow
- python >={{ python_min }}
- python >={{ python_min }},<3.13
- pytorch
- rich
- scikit-image
- scipy
- shapely >=2.0.1
- spatial-image >=1.1.0
- typing-extensions >=4.8.0
- xarray >=2023.12.0,<2024.10.0
- xarray-datatree
- xarray >=2024.10.0
- xarray-schema
- xarray-spatial >=0.3.5
- zarr
- zarr <3

test:
imports:
Expand Down