conda-forge / django-feedstock

A conda-smithy repository for django.
BSD 3-Clause "New" or "Revised" License
2 stars 24 forks source link

Windows build failure, caused by tzdata depdendecy for noarch staged recipes, when django is a dependency #186

Open rxm7706 opened 4 weeks ago

rxm7706 commented 4 weeks ago

1) This command to handle tzdata dependency ; was working when setup.cfg had the dependencies for django https://github.com/conda-forge/django-feedstock/blob/bde3345c29a55cd7448df195c8387c63bd7d34a2/recipe/meta.yaml#L17

2) With django 5.1 depdencies have moved to pyproject.toml https://github.com/django/django/blob/5.1/pyproject.toml#L12 "tzdata; sys_platform == 'win32'",

3) PR that implemented this Change on django source upstream https://github.com/django/django/commit/4686541691dbe986f58ac87630c3b7a04db4ff93

4) Error on windows build - for new noarch staged recipes depending on django..

(base) %SRC_DIR%>call "%SRC_DIR%\conda_test_env_vars.bat" 

(base) %SRC_DIR%>set "CONDA_SHLVL="   && 

(base) %SRC_DIR%>conda activate "%PREFIX%" 
django 5.1 requires tzdata, which is not installed.
WARNING: Tests failed for wagtail-model-forms-0.4.8-pyhd8ed1ab_0.conda - moving package to C:\bld\broken
Traceback (most recent call last):
  File "C:\Miniforge\lib\site-packages\conda_build\build.py", line 3523, in test
    utils.check_call_env(
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 404, in check_call_env
    return _func_defaulting_env_to_os_environ("call", *popenargs, **kwargs)
  File "C:\Miniforge\lib\site-packages\conda_build\utils.py", line 380, in _func_defaulting_env_to_os_environ
    raise subprocess.CalledProcessError(proc.returncode, _args)
subprocess.CalledProcessError: Command '['C:\\Windows\\system32\\cmd.exe', '/d', '/c', 'C:\\bld\\wagtail-model-forms_1723940984027\\test_tmp\\conda_test_runner.bat']' returned non-zero exit status 1.

5) I think we need to fix the feedstock to use pyproject.toml -- to ignore tzdata

  script:
    # Don't need tzdata (pypi) pkg as the conda python package
    # uses the tzdata (non-pypi) pkg
    - sed -i.bak "/tzdata/d" pyproject.toml

6) I can raise a PR if thats the right way to fix this issue..Using 5)

Failed Staging recipe - https://github.com/conda-forge/staged-recipes/pull/27255

ocefpaf commented 3 weeks ago

I can raise a PR if thats the right way to fix this issue..Using 5)

Yes please but, to avoid a silent regression like this one in the future, let's not use sed. We should be using a patch b/c that is more readable and it will fail if the patch doesn't apply.