spacetelescope / jwst

Python library for science observations from the James Webb Space Telescope
https://jwst-pipeline.readthedocs.io/en/latest/
Other
561 stars 167 forks source link

Pin numpy<2.0 in 1.14.0 release branch, to allow RTD to build #8566

Closed jhunkeler closed 3 months ago

jhunkeler commented 3 months ago

This should rectify the following RTD build error on stable (aka 1.14.0):

 python -m sphinx -T -W --keep-going -b html -d _build/doctrees -D language=en . $READTHEDOCS_OUTPUT/html
Running Sphinx v7.3.7
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://numpy.org/devdocs/objects.inv...
loading intersphinx inventory from http://scipy.github.io/devdocs/objects.inv...
loading intersphinx inventory from http://matplotlib.org/objects.inv...
loading intersphinx inventory from https://gwcs.readthedocs.io/en/stable/objects.inv...
loading intersphinx inventory from https://stdatamodels.readthedocs.io/en/latest/objects.inv...
loading intersphinx inventory from https://stcal.readthedocs.io/en/latest/objects.inv...
intersphinx inventory has moved: http://matplotlib.org/objects.inv -> https://matplotlib.org/stable/objects.inv
[autosummary] generating autosummary for: getting_started/contributing.rst, getting_started/install.rst, getting_started/quickstart.rst, index.rst, jwst/align_refs/description.rst, jwst/align_refs/index.rst, jwst/ami_analyze/ami_test.rst, jwst/ami_analyze/description.rst, jwst/ami_analyze/index.rst, jwst/ami_average/description.rst, ..., jwst/wfs_combine/main.rst, jwst/wfs_combine/reference_files.rst, jwst/wfss_contam/arguments.rst, jwst/wfss_contam/description.rst, jwst/wfss_contam/index.rst, jwst/wfss_contam/reference_files.rst, jwst/white_light/arguments.rst, jwst/white_light/description.rst, jwst/white_light/index.rst, jwst/white_light/reference_files.rst

A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/__main__.py", line 7, in <module>
    raise SystemExit(main(sys.argv[1:]))
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/cmd/build.py", line 384, in main
    return build_main(argv)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/application.py", line 268, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/application.py", line 339, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodsumm.py", line 289, in process_automodsumm_generation
    lines = automodsumm_to_autosummary_lines(sfn, app)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodsumm.py", line 362, in automodsumm_to_autosummary_lines
    filestr = automodapi.automodapi_replace(fr.read(), app, True, docname, False)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodapi.py", line 309, in automodapi_replace
    ispkg, hascls, hasfuncs, hasother, toskip = _mod_info(
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodapi.py", line 424, in _mod_info
    for localnm, fqnm, obj in zip(*find_mod_objs(modname, onlylocals=onlylocals)):
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/utils.py", line 74, in find_mod_objs
    __import__(modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/__init__.py", line 8, in <module>
    from .tweakreg_step import TweakRegStep
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/tweakreg_step.py", line 23, in <module>
    from . import astrometric_utils as amutils
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/astrometric_utils.py", line 10, in <module>
    from ..resample import resample_utils
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/__init__.py", line 1, in <module>
    from .resample_step import ResampleStep
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/resample_step.py", line 14, in <module>
    from . import resample
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/resample.py", line 7, in <module>
    from drizzle import cdrizzle
Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/numpy/core/_multiarray_umath.py", line 44, in __getattr__
    raise ImportError(msg)
ImportError: 
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.0.0 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.

If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/events.py", line 97, in emit
    results.append(listener.handler(self.app, *args))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodsumm.py", line 289, in process_automodsumm_generation
    lines = automodsumm_to_autosummary_lines(sfn, app)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodsumm.py", line 362, in automodsumm_to_autosummary_lines
    filestr = automodapi.automodapi_replace(fr.read(), app, True, docname, False)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodapi.py", line 309, in automodapi_replace
    ispkg, hascls, hasfuncs, hasother, toskip = _mod_info(
                                                ^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/automodapi.py", line 424, in _mod_info
    for localnm, fqnm, obj in zip(*find_mod_objs(modname, onlylocals=onlylocals)):
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx_automodapi/utils.py", line 74, in find_mod_objs
    __import__(modname)
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/__init__.py", line 8, in <module>
    from .tweakreg_step import TweakRegStep
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/tweakreg_step.py", line 23, in <module>
    from . import astrometric_utils as amutils
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/tweakreg/astrometric_utils.py", line 10, in <module>
    from ..resample import resample_utils
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/__init__.py", line 1, in <module>
    from .resample_step import ResampleStep
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/resample_step.py", line 14, in <module>
    from . import resample
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/jwst/resample/resample.py", line 7, in <module>
    from drizzle import cdrizzle
ImportError: numpy.core.multiarray failed to import

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/cmd/build.py", line 332, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/application.py", line 268, in __init__
    self._init_builder()
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/application.py", line 339, in _init_builder
    self.events.emit('builder-inited')
  File "/home/docs/checkouts/readthedocs.org/user_builds/jwst-pipeline/conda/stable/lib/python3.11/site-packages/sphinx/events.py", line 108, in emit
    raise ExtensionError(
sphinx.errors.ExtensionError: Handler <function process_automodsumm_generation at 0x7f6c044963e0> for event 'builder-inited' threw an exception (exception: numpy.core.multiarray failed to import)

Extension error (sphinx_automodapi.automodsumm):
Handler <function process_automodsumm_generation at 0x7f6c044963e0> for event 'builder-inited' threw an exception (exception: numpy.core.multiarray failed to import) 

Pinning numpy<2 locally does not produce any errors:

$ pip install -e '.[docs]'
$ pip freeze | grep numpy=
numpy==1.26.4
$ cd docs
$  python -m sphinx -T -W --keep-going -b html -d _build/doctrees -D language=en . output/html
Running Sphinx v7.3.7
making output directory... done
loading intersphinx inventory from https://docs.python.org/3/objects.inv...
loading intersphinx inventory from https://numpy.org/devdocs/objects.inv...
loading intersphinx inventory from http://scipy.github.io/devdocs/objects.inv...
loading intersphinx inventory from http://matplotlib.org/objects.inv...
loading intersphinx inventory from https://gwcs.readthedocs.io/en/stable/objects.inv...
loading intersphinx inventory from https://stdatamodels.readthedocs.io/en/latest/objects.inv...
loading intersphinx inventory from https://stcal.readthedocs.io/en/latest/objects.inv...
intersphinx inventory has moved: http://matplotlib.org/objects.inv -> https://matplotlib.org/stable/objects.inv
[autosummary] generating autosummary for: getting_started/contributing.rst, getting_started/install.rst, getting_started/quickstart.rst, index.rst, jwst/align_refs/description.rst, jwst/align_refs/index.rst, jwst/ami_analyze/ami_test.rst, jwst/ami_analyze/description.rst, jwst/ami_analyze/index.rst, jwst/ami_average/description.rst, ..., jwst/wfs_combine/main.rst, jwst/wfs_combine/reference_files.rst, jwst/wfss_contam/arguments.rst, jwst/wfss_contam/description.rst, jwst/wfss_contam/index.rst, jwst/wfss_contam/reference_files.rst, jwst/white_light/arguments.rst, jwst/white_light/description.rst, jwst/white_light/index.rst, jwst/white_light/reference_files.rst
[automodsumm] jwst/resample/resample_utils.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/pixel_replace/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/assign_mtwcs/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/lastframe/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/background_step/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/saturation/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/superbias/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/imprint/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/ramp_fitting/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/rules_level3.rst: found 19 automodsumm entries to generate
[automodsumm] jwst/source_catalog/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/asn_from_list.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/skymatch/skystatistics.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/outlier_detection/outlier_detection_ifu.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/pipeline/index.rst: found 10 automodsumm entries to generate
[automodsumm] jwst/persistence/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/flatfield/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/dq_init/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/wavecorr/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/fringe/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/rscd/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/association_api.rst: found 17 automodsumm entries to generate
[automodsumm] jwst/srctype/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/mrs_imatch/mrs_imatch_step.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/pathloss/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/guider_cds/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/ipc/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/gain_scale/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/dark_current/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/ami_analyze/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/stpipe/index.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/align_refs/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/skymatch/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/tweakreg/utils.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/klip/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/nsclean/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/firstframe/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/master_background/index.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/msaflagopen/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/hlsp/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/tweakreg/tweakreg_catalog.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/resample/index.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/reset/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/lib/engdb.rst: found 5 automodsumm entries to generate
[automodsumm] jwst/stack_refs/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/outlier_detection/outlier_detection.rst: found 3 automodsumm entries to generate
[automodsumm] jwst/wfss_contam/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/straylight/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/lib_constraint.rst: found 4 automodsumm entries to generate
[automodsumm] jwst/skymatch/skymatch.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/spectral_leak/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/model_blender/blender_api.rst: found 7 automodsumm entries to generate
[automodsumm] jwst/lib/set_telescope_pointing.rst: found 12 automodsumm entries to generate
[automodsumm] jwst/extract_1d/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/ami_normalize/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/skymatch/skyimage.rst: found 5 automodsumm entries to generate
[automodsumm] jwst/jump/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/refpix/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/asn_make_pool.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/combine_1d/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/group_scale/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/assign_wcs/index.rst: found 6 automodsumm entries to generate
[automodsumm] jwst/outlier_detection/index.rst: found 3 automodsumm entries to generate
[automodsumm] jwst/wfs_combine/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/rules_level2.rst: found 19 automodsumm entries to generate
[automodsumm] jwst/tweakreg/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/emicorr/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/skymatch/region.rst: found 3 automodsumm entries to generate
[automodsumm] jwst/barshadow/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/skymatch/skymatch_step.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/outlier_detection/outlier_detection_step.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/outlier_detection/outlier_detection_spec.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/white_light/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/model_blender/blender_rules.rst: found 18 automodsumm entries to generate
[automodsumm] jwst/photom/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/charge_migration/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/exp_to_source/index.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/linearity/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/resample/resample.rst: found 2 automodsumm entries to generate
[automodsumm] jwst/associations/asn_gather.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/tweakreg/tweakreg_step.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/associations/lib_dmsbase.rst: found 4 automodsumm entries to generate
[automodsumm] jwst/resample/resample_step.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/tso_photometry/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/cube_build/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/mrs_imatch/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/ami_average/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/extract_2d/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/residual_fringe/index.rst: found 1 automodsumm entries to generate
[automodsumm] jwst/tweakreg/astrometric_utils.rst: found 4 automodsumm entries to generate
building [mo]: targets for 0 po files that are out of date
writing output... 
building [html]: targets for 350 source files that are out of date
updating environment: [new config] 570 added, 0 changed, 0 removed
reading sources... [100%] jwst/white_light/reference_files
looking for now-outdated files... none found
pickling environment... done
checking consistency... done
preparing documents... done
copying assets... copying static files... done
copying extra files... done
done
writing output... [100%] jwst/white_light/reference_files
generating indices... genindex py-modindex done
highlighting module code... [100%] jwst.white_light.white_light_step
writing additional pages... search done
copying images... [100%] jwst/spectral_leak/Example_Spectral_Leak_Corrected.png
dumping search index in English (code: en)... done
dumping object inventory... done
build succeeded.

The HTML pages are in output/html.
braingram commented 3 months ago

This is duplicate of https://github.com/spacetelescope/jwst/pull/8565

hbushouse commented 3 months ago

Because this is a duplicate of #8565 I'll close this one and we'll merge the other.

jhunkeler commented 3 months ago

Sorry, I should have explained my motives here. This PR targeted the release branch in order to fix the RTD build without affecting development. I thought perhaps we wanted to keep master open to numpy 2.x related errors because it was released yesterday and there's no going back, so to speak.

braingram commented 3 months ago

Thanks @jhunkeler I missed that this is targeting the release branch. Is the plan to make a 1.14.1 with the pin?

braingram commented 3 months ago

I think at this point we have to pin numpy on main since our dependencies do not have compatible builds. Otherwise we can't run the test suite and evaluate PRs. Ideally we can remove the 2.0 pin from main before the next release but I think that depends largely on if opencv makes a release or if we can remove it as a dependency.

I'm open to ideas, let me know if it's helpful to chat about this.

jhunkeler commented 3 months ago

I wasn't planning on making a 1.14.1 release because 1.14.0's requirements-sdp.txt already pins numpy to 1.26.4. It's just that RTD doesn't use the requirements files (only pip install -e .[docs]).

hbushouse commented 3 months ago

I also missed the fact that this is targeting the release branch, not master. Reopening.

braingram commented 3 months ago

If this is only for the docs would the rtd_environment dependencies be a good spot: https://github.com/spacetelescope/jwst/blob/380dc5eb082c6c5d4e024a9337999f69cd5b8443/docs/rtd_environment.yaml#L5

jhunkeler commented 3 months ago

I started with the rtd_environment.yaml but abandoned the approach. The pip installation command would likely upgrade the package to numpy 2.x anyway.

python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir .[docs]

I haven't tested the theory locally though.

jhunkeler commented 3 months ago

I agree. My scope is a little too narrow... Making a 1.14.1 release is the best option we have to avoid disruption to any workflows in the wild.

jhunkeler commented 3 months ago

re: https://github.com/spacetelescope/jwst/pull/8566#issuecomment-2173611997 Adding numpy to the yaml configuration does work. The major downside will be remembering to keep this aligned with whatever is pinned by pyroject.toml and the requirements-*.txt files.

docs/rtd_readthedocs.yaml

name: rtd311
channels:
 - conda-forge
 - defaults
dependencies:
 - python=3.11
 - pip
 - graphviz
 - sphinx_rtd_theme>1.2.0
 - pip:
   - numpy<2
$ mamba env create -f docs/rtd_environment.yaml
$ mamba activate rtd311
$ python -m pip install --upgrade --upgrade-strategy only-if-needed --no-cache-dir '.[docs]'
$ pip freeze | grep numpy=
numpy==1.26.4
$ cd docs
$ python -m sphinx -T -W --keep-going -b html -d _build/doctrees -D language=en . output/html
# ...
build succeeded.

The HTML pages are in output/html.
hbushouse commented 3 months ago

So does this PR need modification yet, in order to implement the change in rtd_readthedocs instead of pyproject.toml? And do we also still need to create a 1.14.1 release with numpy pinned to <2.0 to protect pip installers?

braingram commented 3 months ago

Adding numpy to the yaml configuration does work. The major downside will be remembering to keep this aligned with whatever is pinned by pyroject.toml and the requirements-*.txt files.

Thanks for looking into it. Given this and your other comments adding the pin to the pyproject.toml sounds good to me.

So does this PR need modification yet, in order to implement the change in rtd_readthedocs instead of pyproject.toml? And do we also still need to create a 1.14.1 release with numpy pinned to <2.0 to protect pip installers?

This PR looks good to me the way it is. A patch release will be needed with the pin to protect pip installers (I tested this locally).

I'm not sure what the procedure for a patch release would be. Specifically:

zacharyburnett commented 3 months ago

since 1.14.1 would be a PyPI-only release, I don't think it needs to be included in the metadata on main (the table of DMS builds in README.md, CITATION.cff, etc.) but we'll need to remember to use the next version number for the next release

drlaw1558 commented 3 months ago

It may not be a DMS build, but nonetheless the table in README.md is a go-to place for finding the version history. I'd suggest doing the same thing as with 1.13.4 and 1.12.4 and adding an entry with a note "PyPI-only release for external users"

zacharyburnett commented 3 months ago

It may not be a DMS build, but nonetheless the table in README.md is a go-to place for finding the version history. I'd suggest doing the same thing as with 1.13.4 and 1.12.4 and adding an entry with a note "PyPI-only release for external users"

sure thing, here: https://github.com/spacetelescope/jwst/pull/8617