Repository: sherpa/sherpa
Pull request #2249: Update project.toml for PEP 639
Author: login: hamogu
Labels: name: priority:blocker
name: area:build
name: note: easy review
description: Indicates PR requires simple review
Created: 2025-03-24T17:02:02Z | Merged: 2025-03-28T16:21:48Z

## Summary
Address setuptools deprecation of lower-kebab-case for names of options


## Details
 no more details.

fixes #2247
fixes #1452 

Linked issue #2247: python deprecations in build settings
From #2246 we can see that `uv` complains about (amongst other things):

```
      /home/user/.cache/uv/builds-v0/.tmp0YpTOk/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:82: SetuptoolsDeprecationWarning: `project.license`
      as a TOML table is deprecated
      !!

              ********************************************************************************
              Please use a simple string containing a SPDX expression for `project.license`. You can also use `project.license-files`.

              By 2026-Feb-18, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************

```

```
      /home/user/.cache/uv/builds-v0/.tmp0YpTOk/lib/python3.12/site-packages/setuptools/config/_apply_pyprojecttoml.py:61: SetuptoolsDeprecationWarning: License classifiers
      are deprecated.
      !!

              ********************************************************************************
              Please consider removing the following classifiers in favor of a SPDX license expression:

              License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)

              See https://packaging.python.org/en/latest/guides/writing-pyproject-toml/#license for details.
              ********************************************************************************
```

Yes, we have just re-worked things to use the "latest" standards for building Python, but the "standards" keep on improving...

Diff:
diff --git a/.github/scripts/setup_xspec.sh b/.github/scripts/setup_xspec.sh
index c92006a86e..8064364e41 100755
--- a/.github/scripts/setup_xspec.sh
+++ b/.github/scripts/setup_xspec.sh
@@ -31,16 +31,16 @@ esac
 echo "* configuring XSPEC"
 
 # Change build configuration
-sed -i.orig "s|#with-xspec=True|with-xspec=True|" setup.cfg
+sed -i.orig "s|#with_xspec=True|with_xspec=True|" setup.cfg
 sed -i.orig "s|#xspec_lib_dirs = None|xspec_lib_dirs=${xspec_library_path}|" setup.cfg
 sed -i.orig "s|#xspec_include_dirs = None|xspec_include_dirs=${xspec_include_path}|" setup.cfg
 sed -i.orig "s|#xspec_version = .*|xspec_version = ${xspec_version_string}|" setup.cfg
 
 # Xspec ~12.10.1n now requires fftw. This disables the fftw build from extern
 sed -i.orig "s|#fftw=local|fftw=local|" setup.cfg
-sed -i.orig "s|#fftw-include_dirs=build/include|fftw-include_dirs=${CONDA_PREFIX}/include|" setup.cfg
-sed -i.orig "s|#fftw-lib-dirs=build/lib|fftw-lib-dirs=${CONDA_PREFIX}/lib|" setup.cfg
-sed -i.orig "s|#fftw-libraries=fftw3|fftw-libraries=fftw3|" setup.cfg
+sed -i.orig "s|#fftw_include_dirs=build/include|fftw_include_dirs=${CONDA_PREFIX}/include|" setup.cfg
+sed -i.orig "s|#fftw_lib_dirs=build/lib|fftw_lib_dirs=${CONDA_PREFIX}/lib|" setup.cfg
+sed -i.orig "s|#fftw_libraries=fftw3|fftw_libraries=fftw3|" setup.cfg
 
 echo "* START setup.cfg"
 cat setup.cfg
diff --git a/.github/workflows/ci-conda-workflow.yml b/.github/workflows/ci-conda-workflow.yml
index ffdf89f6e6..37072adf76 100644
--- a/.github/workflows/ci-conda-workflow.yml
+++ b/.github/workflows/ci-conda-workflow.yml
@@ -261,4 +261,4 @@ jobs:
         token: ${{ secrets.CODECOV_TOKEN }}
         files: ${{ github.workspace }}/coverage.xml
         verbose: true
-      
+
diff --git a/docs/developer/index.rst b/docs/developer/index.rst
index 8f0adb7565..2ff2e4b16e 100644
--- a/docs/developer/index.rst
+++ b/docs/developer/index.rst
@@ -226,26 +226,26 @@ should be updated to match the output above::
 
     configure=None
 
-    disable-group=True
-    disable-stk=True
+    disable_group=True
+    disable_stk=True
 
     fftw=local
-    fftw-include_dirs=${ASCDS_INSTALL}/include
-    fftw-lib-dirs=${ASCDS_INSTALL}/lib
-    fftw-libraries=fftw3
+    fftw_include_dirs=${ASCDS_INSTALL}/include
+    fftw_lib_dirs=${ASCDS_INSTALL}/lib
+    fftw_libraries=fftw3
 
     region=local
     region-include_dirs=${ASCDS_INSTALL}/include
-    region-lib-dirs=${ASCDS_INSTALL}/lib
-    region-libraries=region ascdm
-    region-use-cxc-parser=True
+    region_lib_dirs=${ASCDS_INSTALL}/lib
+    region_libraries=region ascdm
+    region_use_cxc_parser=True
 
     wcs=local
-    wcs-include-dirs=${ASCDS_INSTALL}/include
-    wcs-lib-dirs=${ASCDS_INSTALL}/lib
-    wcs-libraries=wcs
+    wcs_include_dirs=${ASCDS_INSTALL}/include
+    wcs_lib_dirs=${ASCDS_INSTALL}/lib
+    wcs_libraries=wcs
 
-    with-xspec=True
+    with_xspec=True
     xspec_version = 12.12.0
     xspec_lib_dirs = ${ASCDS_INSTALL}/lib
     xspec_include_dirs = ${ASCDS_INSTALL}/include
diff --git a/docs/install.rst b/docs/install.rst
index e73971453b..1e93d520fc 100644
--- a/docs/install.rst
+++ b/docs/install.rst
@@ -196,9 +196,9 @@ the ``fftw`` options in the ``sherpa_config`` section of the
 ``setup.cfg`` file. The options to change are::
 
     fftw=local
-    fftw-include_dirs=/usr/local/include
-    fftw-lib-dirs=/use/local/lib
-    fftw-libraries=fftw3
+    fftw_include_dirs=/usr/local/include
+    fftw_lib_dirs=/use/local/lib
+    fftw_libraries=fftw3
 
 The ``fftw`` option must be set to ``local`` and then the remaining
 options changed to match the location of the local installation.
@@ -213,7 +213,7 @@ Sherpa can be built to use the Astronomy models provided by
 made to the ``xspec_config`` section of the ``setup.cfg`` file. The
 available options (with default values) are::
 
-    with-xspec = False
+    with_xspec = False
     xspec_version = 12.12.0
     xspec_lib_dirs = None
     xspec_include_dirs = None
@@ -228,7 +228,7 @@ available options (with default values) are::
     gfortran_libraries =
 
 To build the :py:mod:`sherpa.astro.xspec` module, the
-``with-xspec`` option must be set to ``True`` **and** the
+``with_xspec`` option must be set to ``True`` **and** the
 ``xspec_version`` option set to the correct version string (the XSPEC
 patch level must not be included), and then the
 remaining options depend on the version of XSPEC and whether
@@ -241,7 +241,7 @@ match the contents of the XSPEC installation.
 
 1. If the full XSPEC 12.14.1 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.14.1
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
@@ -254,7 +254,7 @@ match the contents of the XSPEC installation.
 
 2. If the full XSPEC 12.14.0 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.14.0
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
@@ -267,7 +267,7 @@ match the contents of the XSPEC installation.
 
 3. If the full XSPEC 12.13.1 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.13.1
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
@@ -280,7 +280,7 @@ match the contents of the XSPEC installation.
 
 4. If the full XSPEC 12.13.0 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.13.0
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
@@ -290,7 +290,7 @@ match the contents of the XSPEC installation.
 
 5. If the full XSPEC 12.12.1 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.12.1
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
@@ -300,7 +300,7 @@ match the contents of the XSPEC installation.
 
 6. If the full XSPEC 12.12.0 system has been built then use::
 
-       with-xspec = True
+       with_xspec = True
        xspec_version = 12.12.0
        xspec_lib_dirs = $HEADAS/lib
        xspec_include_dirs = $HEADAS/include
diff --git a/helpers/sherpa_config.py b/helpers/sherpa_config.py
index d95489b399..dba27f8454 100644
--- a/helpers/sherpa_config.py
+++ b/helpers/sherpa_config.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2014 - 2016, 2020, 2022, 2024
+#  Copyright (C) 2014-2016, 2020, 2022, 2024-2025
 #  Smithsonian Astrophysical Observatory
 #
 #
@@ -33,25 +33,25 @@ class sherpa_config(Command):
     description = "Configure Sherpa build options. If in doubt, ignore this command and stick to defaults. See setup.cfg for more information."
     user_options = [
                     ('fftw', None, "Whether Sherpa should build the embedded fftw3 library, which is the default behavior: set to 'local' to make Sherpa link against existing libraries on the system.)"),
-                    ('fftw-include-dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
-                    ('fftw-lib-dirs', None, "Where the fftw3 libraries are located, if fftw is 'local'"),
-                    ('fftw-libraries', None, "Name of the libraries that should be linked as fftw3"),
+                    ('fftw_include_dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
+                    ('fftw_lib_dirs', None, "Where the fftw3 libraries are located, if fftw is 'local'"),
+                    ('fftw_libraries', None, "Name of the libraries that should be linked as fftw3"),
                     ('region', None, "Whether Sherpa should build the embedded region library, which is the default behavior: set to 'local' to make Sherpa link against existing libraries on the system.)"),
-                    ('region-include-dirs', None, "Where the region headers are located, if region is 'local'"),
-                    ('region-lib-dirs', None, "Where the region libraries are located, if region is 'local'"),
-                    ('region-libraries', None, "Name of the libraries that should be linked as region"),
-                    ('region-use-cxc-parser', None, "If set to True than use the CXC Data Model library to parse region files"),
+                    ('region_include_dirs', None, "Where the region headers are located, if region is 'local'"),
+                    ('region_lib_dirs', None, "Where the region libraries are located, if region is 'local'"),
+                    ('region_libraries', None, "Name of the libraries that should be linked as region"),
+                    ('region_use_cxc_parser', None, "If set to True than use the CXC Data Model library to parse region files"),
                     ('wcs', None, "Whether Sherpa should build the embedded wcs library, which is the default behavior: set to 'local' to make Sherpa link against existing libraries on the system.)"),
-                    ('wcs-include-dirs', None, "Where the wcs subroutines headers are located"),
-                    ('wcs-lib-dirs', None, "Where the wcs subroutines libraries are located"),
-                    ('wcs-libraries', None, "Name of the libraries that should be linked as wcs"),
-                    ('group-location', None, "Location of the group  python module"),
-                    ('disable-group', None, "Disable the group module install"),
-                    ('stk-location', None, "Location of the stack library python module"),
-                    ('disable-stk', None, "Disable the stack library module install"),
-                    ('install-dir', None, "Directory where external dependencies must be installed (--prefix)"),
+                    ('wcs_include_dirs', None, "Where the wcs subroutines headers are located"),
+                    ('wcs_lib_dirs', None, "Where the wcs subroutines libraries are located"),
+                    ('wcs_libraries', None, "Name of the libraries that should be linked as wcs"),
+                    ('group_location', None, "Location of the group  python module"),
+                    ('disable_group', None, "Disable the group module install"),
+                    ('stk_location', None, "Location of the stack library python module"),
+                    ('disable_stk', None, "Disable the stack library module install"),
+                    ('install_dir', None, "Directory where external dependencies must be installed (--prefix)"),
                     ('configure', None, "Additional configure flags for the external dependencies"),
-                    ('group-cflags', None, "Additional cflags for building the grouping library"),
+                    ('group_cflags', None, "Additional cflags for building the grouping library"),
                     ]
 
     def initialize_options(self):
diff --git a/helpers/xspec_config.py b/helpers/xspec_config.py
index 150feb50f7..711356820f 100644
--- a/helpers/xspec_config.py
+++ b/helpers/xspec_config.py
@@ -1,5 +1,5 @@
 #
-#  Copyright (C) 2014 - 2018, 2020 - 2024
+#  Copyright (C) 2014-2018, 2020-2025
 #  Smithsonian Astrophysical Observatory
 #
 #
@@ -79,18 +79,18 @@ def get_version(version):
 class xspec_config(Command):
     description = "Configure XSPEC Models external module (optional) "
     user_options = [
-                    ('with-xspec', None, "Whether sherpa must build the XSPEC module (default False)"),
-                    ('xspec-version', None, "the XSPEC version (default 12.12.0)"),
-                    ('xspec-lib-dirs', None, "Where the xspec libraries are located, if with-xspec is True"),
-                    ('xspec-libraries', None, "Name of the libraries that should be linked for xspec"),
-                    ('cfitsio-lib-dirs', None, "Where the cfitsio libraries are located, if with-xspec is True"),
-                    ('cfitsio-libraries', None, "Name of the libraries that should be linked for cfitsio"),
-                    ('ccfits-lib-dirs', None, "Where the CCfits libraries are located, if with-xspec is True"),
-                    ('ccfits-libraries', None, "Name of the libraries that should be linked for CCfits"),
-                    ('wcslib-lib-dirs', None, "Where the WCSLIB libraries are located, if with-xspec is True"),
-                    ('wcslib-libraries', None, "Name of the libraries that should be linked for WCSLIB"),
-                    ('gfortran-lib-dirs', None, "Where the gfortran libraries are located, if with-xspec is True"),
-                    ('gfortran-libraries', None, "Name of the libraries that should be linked for gfortran"),
+                    ('with_xspec', None, "Whether sherpa must build the XSPEC module (default False)"),
+                    ('xspec_version', None, "the XSPEC version (default 12.12.0)"),
+                    ('xspec_lib_dirs', None, "Where the xspec libraries are located, if with_xspec is True"),
+                    ('xspec_libraries', None, "Name of the libraries that should be linked for xspec"),
+                    ('cfitsio_lib_dirs', None, "Where the cfitsio libraries are located, if with_xspec is True"),
+                    ('cfitsio_libraries', None, "Name of the libraries that should be linked for cfitsio"),
+                    ('ccfits_lib_dirs', None, "Where the CCfits libraries are located, if with_xspec is True"),
+                    ('ccfits_libraries', None, "Name of the libraries that should be linked for CCfits"),
+                    ('wcslib_lib_dirs', None, "Where the WCSLIB libraries are located, if with_xspec is True"),
+                    ('wcslib_libraries', None, "Name of the libraries that should be linked for WCSLIB"),
+                    ('gfortran_lib_dirs', None, "Where the gfortran libraries are located, if with_xspec is True"),
+                    ('gfortran_libraries', None, "Name of the libraries that should be linked for gfortran"),
                     ]
 
     def initialize_options(self):
diff --git a/pyproject.toml b/pyproject.toml
index 86a5c9f1c4..66be9a4275 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -14,6 +14,7 @@ description = "Modeling and fitting package for scientific data analysis"
 readme = {file = "README.md", content-type = "text/markdown"}
 license = {file = "LICENSE"}
 
+
 authors = [
   { name = "Smithsonian Astrophysical Observatory / Chandra X-Ray Center", email = "cxchelp@cfa.harvard.edu" }
 ]
diff --git a/scripts/use_ciao_config b/scripts/use_ciao_config
index b90414d3f6..252d4060f7 100755
--- a/scripts/use_ciao_config
+++ b/scripts/use_ciao_config
@@ -72,28 +72,28 @@ echo "Updating $cfg"
 sed -i="" "s|#install_dir=build|install_dir=${CONDA_PREFIX}|" $cfg
 sed -i="" "s|#configure=None|configure=None|" $cfg
 
-sed -i="" "s|#disable-group=True|disable-group=True|" $cfg
-sed -i="" "s|#disable-stk=True|disable-stk=True|" $cfg
+sed -i="" "s|#disable_group=True|disable_group=True|" $cfg
+sed -i="" "s|#disable_stk=True|disable_stk=True|" $cfg
 
 sed -i="" "s|#region=local|region=local|" $cfg
 sed -i="" "s|#region-include_dirs=build/include|region-include_dirs=${CONDA_PREFIX}/include|" $cfg
-sed -i="" "s|#region-lib-dirs=build/lib|region-lib-dirs=${CONDA_PREFIX}/lib|" $cfg
-sed -i="" "s|#region-libraries=region|region-libraries=region ascdm|" $cfg
-sed -i="" "s|#region-use-cxc-parser=False|region-use-cxc-parser=True|" $cfg
+sed -i="" "s|#region_lib_dirs=build/lib|region_lib_dirs=${CONDA_PREFIX}/lib|" $cfg
+sed -i="" "s|#region_libraries=region|region_libraries=region ascdm|" $cfg
+sed -i="" "s|#region_use_cxc_parser=False|region_use_cxc_parser=True|" $cfg
 
 sed -i="" "s|#wcs=local|wcs=local|" $cfg
 # Historically the setup file has used the wrong form here
 # so support both 'include-dirs' and 'include_dirs'.
 sed -i="" "s|#wcs-include.dirs=build/include|wcs-include_dirs=${CONDA_PREFIX}/include|" $cfg
-sed -i="" "s|#wcs-lib-dirs=build/lib|wcs-lib-dirs=${CONDA_PREFIX}/lib|" $cfg
-sed -i="" "s|#wcs-libraries=wcs|wcs-libraries=wcs|" $cfg
+sed -i="" "s|#wcs_lib_dirs=build/lib|wcs_lib_dirs=${CONDA_PREFIX}/lib|" $cfg
+sed -i="" "s|#wcs_libraries=wcs|wcs_libraries=wcs|" $cfg
 
 sed -i="" "s|#fftw=local|fftw=local|" $cfg
-sed -i="" "s|#fftw-include_dirs=build/include|fftw-include_dirs=${CONDA_PREFIX}/include|" $cfg
-sed -i="" "s|#fftw-lib-dirs=build/lib|fftw-lib-dirs=${CONDA_PREFIX}/lib|" $cfg
-sed -i="" "s|#fftw-libraries=fftw3|fftw-libraries=fftw3|" $cfg
+sed -i="" "s|#fftw_include_dirs=build/include|fftw_include_dirs=${CONDA_PREFIX}/include|" $cfg
+sed -i="" "s|#fftw_lib_dirs=build/lib|fftw_lib_dirs=${CONDA_PREFIX}/lib|" $cfg
+sed -i="" "s|#fftw_libraries=fftw3|fftw_libraries=fftw3|" $cfg
 
-sed -i="" "s|#with-xspec=True|with-xspec=True|" $cfg
+sed -i="" "s|#with_xspec=True|with_xspec=True|" $cfg
 sed -i="" "s|#xspec_include_dirs = None|xspec_include_dirs=${CONDA_PREFIX}/include|" $cfg
 sed -i="" "s|#xspec_lib_dirs = None|xspec_lib_dirs=${CONDA_PREFIX}/lib|" $cfg
 sed -i="" "s|#xspec_version = .*|xspec_version = ${xspec_version}|" $cfg
diff --git a/setup.cfg b/setup.cfg
index ded86acfb0..3b7b6f440f 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -8,15 +8,15 @@
 #configure=None
 
 # GROUP Python module
-#disable-group=True
-#group-location=build/lib/python2.7/site-packages/group.so
+#disable_group=True
+#group_location=build/lib/python2.7/site-packages/group.so
 
 # Additional flags to be passed to libgrp build
-#group-cflags=
+#group_cflags=
 
 # File Stack Python module
-#disable-stk=True
-#stk-location=build/lib/python2.7/site-packages/stk.so
+#disable_stk=True
+#stk_location=build/lib/python2.7/site-packages/stk.so
 
 # FFTW Library
 # Uncomment to use a local installation
@@ -26,9 +26,9 @@
 # change the default location of libraries and the name
 # of the library to be linked (usually fftw3)
 # (include multiple values by separating them with spaces)
-#fftw-include_dirs=build/include
-#fftw-lib-dirs=build/lib
-#fftw-libraries=fftw3
+#fftw_include_dirs=build/include
+#fftw_lib_dirs=build/lib
+#fftw_libraries=fftw3
 
 # Region Library
 # Uncomment to use a local installation
@@ -39,24 +39,24 @@
 # of the library to be linked (usually region)
 # (include multiple values by separating them with spaces)
 #region-include_dirs=build/include
-#region-lib-dirs=build/lib
-#region-libraries=region
+#region_lib_dirs=build/lib
+#region_libraries=region
 #
 # Should the CXC Data Model parser be used? This enables FITS region
 # files but requires the CXC Data Model code is available. If set
-# then ascdm should be added to region-libraries and ensure
-# that ascdm.h/ascdm.so are added to the region-include-dirs
-# and region-lib-dirs directories.
-#region-use-cxc-parser=False
+# then ascdm should be added to region_libraries and ensure
+# that ascdm.h/ascdm.so are added to the region_include_dirs
+# and region_lib_dirs directories.
+#region_use_cxc_parser=False
 
 # WCS Subroutines
 # Uncomment to use a local installation
 #wcs=local
 
 # Uncomment and change default location if needed
-#wcs-include-dirs=build/include
-#wcs-lib-dirs=build/lib
-#wcs-libraries=wcs
+#wcs_include_dirs=build/include
+#wcs_lib_dirs=build/lib
+#wcs_libraries=wcs
 
 
 [build_sphinx]
@@ -66,9 +66,9 @@ source-dir = docs
 # XSPEC Models
 [xspec_config]
 # Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+#with_xspec=True
 
-# If with-xspec is True, make sure to point Sherpa to right
+# If with_xspec is True, make sure to point Sherpa to right
 # XSPEC-related libraries and to indicate the XSPEC version.
 #
 # The xspec_include_dirs and xspec_lib_dirs items should be set


Reviews:
user: login: hamogu
body: Alternatively, we could pin setuptools to < 77.0.0 or find some other way to not fail the CI
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:03:46Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:10:36Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:11:48Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:37:29Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:41:20Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:42:13Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T17:58:34Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T18:21:14Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-24T19:13:25Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T17:04:04Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T17:08:46Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T17:13:23Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T19:30:28Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T19:30:57Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T19:33:09Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-25T19:46:02Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T03:46:33Z
user: login: hamogu
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T15:07:22Z
user: login: DougBurke
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T15:14:35Z
user: login: DougBurke
body: LGTM (assuming the CI runs are green). We will eventually have to deal with the setuptools version 78 changes, but not now!

Thanks for dealing with this as my patience for changes in setuptools is currently sitting somewhere on the complex plane!
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-03-27T15:16:39Z

Review comments:
diff_hunk: @@ -12,15 +12,15 @@ dynamic = ["version"]
 name = "sherpa"
 description = "Modeling and fitting package for scientific data analysis"
 readme = {file = "README.md", content-type = "text/markdown"}
-license = {file = "LICENSE"}
+license = "GPL-3.0-or-later"
+license-files = ["LICENSE", "extern/fftw-3.3.10/COPYING"]
+
 
 authors = [
   { name = "Smithsonian Astrophysical Observatory / Chandra X-Ray Center", email = "cxchelp@cfa.harvard.edu" }
 ]
 
 classifiers = [
-  "Intended Audience :: Science/Research",
path: pyproject.toml
user: login: DougBurke
body: Why did you remove this classifier?
created_at: 2025-03-24T17:10:36Z
author_association: CONTRIBUTOR
diff_hunk: @@ -12,15 +12,15 @@ dynamic = ["version"]
 name = "sherpa"
 description = "Modeling and fitting package for scientific data analysis"
 readme = {file = "README.md", content-type = "text/markdown"}
-license = {file = "LICENSE"}
+license = "GPL-3.0-or-later"
+license-files = ["LICENSE", "extern/fftw-3.3.10/COPYING"]
+
 
 authors = [
   { name = "Smithsonian Astrophysical Observatory / Chandra X-Ray Center", email = "cxchelp@cfa.harvard.edu" }
 ]
 
 classifiers = [
-  "Intended Audience :: Science/Research",
path: pyproject.toml
user: login: hamogu
body: Ah, no.
created_at: 2025-03-24T17:11:48Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: DougBurke
body: So, we have `helpers/xspec_config.py` which handles this section, and in it it calls `initialize_options` which is meant to set its `with_xspec` attribute False, but maybe the `user_options` attribute needs updating?

I have never found the documentation to be clear on what is meant to happen in these classes with configuration and set up ... It may be an issue somewhere completely different!

https://github.com/sherpa/sherpa/blob/80ad0889c1df31c943e8a5c7f6f7ee7274486598/helpers/xspec_config.py#L79-L141
created_at: 2025-03-24T17:37:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: hamogu
body: I'm just experimenting. I have no idea why is stopped working, so I thought "Let's try if they suddenly added a requirement to set the defaults in the setup.cfg file". Could have been, but it's not the case. I figured it faster to try though than to find the docs for that. (and faster on CI then to get matching versions of setuptools etc locally, if I on'y need to try once. That's not the case....)
created_at: 2025-03-24T17:41:20Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: hamogu
body: So, now I wonder if the translation `-` -> `_` has changed. If it's not that, then it's something deeper that I won't try to understand and hope somebody else does.
created_at: 2025-03-24T17:42:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: hamogu
body: Jackpot: After renaming `with-xspec` it goes past that line and now fails on `error: error in setup.cfg: command 'sherpa_config' has no such option 'fftw-include_dirs'`.
It'll be annoying to rename all options in all places (and why on earth is that required now?) but at least it has minimal user impact.
created_at: 2025-03-24T17:58:34Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: DougBurke
body: I'll just point to #1452 when I noted some confusion on my part. This has some fall-out as things like `scripts/use_ciao_config` may need updating, as would the documentation.

https://setuptools.pypa.io/en/stable/history.html#v78-0-0 says that the use of "-" has been removed, with some note about deprecations but that appears to be for other things than this. Oh joy.
created_at: 2025-03-24T18:21:14Z
author_association: CONTRIBUTOR
diff_hunk: @@ -65,8 +65,8 @@ source-dir = docs
 
 # XSPEC Models
 [xspec_config]
-# Uncomment (set to True) to build XSPEC extension
-#with-xspec=True
+# Set to True to build XSPEC extension
+with-xspec=False
path: setup.cfg
user: login: hamogu
body: > I'll just point to https://github.com/sherpa/sherpa/issues/1452 when I noted some confusion on my part. This has some fall-out as things like scripts/use_ciao_config may need updating, as would the documentation.

That's what "search and replace" is for. ;-)
created_at: 2025-03-24T19:13:25Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,7 +38,7 @@ jobs:
             test-data: submodule
             matplotlib-version: 3
             bokeh-version: 3
-            xspec-version: 12.14.0i
+            xspec_version: 12.14.0i
path: .github/workflows/ci-conda-workflow.yml
user: login: DougBurke
body: There's no reason for changing this (note that `bokeh-version` and `matplotlib-version` above have not been changed).
created_at: 2025-03-25T17:04:04Z
author_association: CONTRIBUTOR
diff_hunk: @@ -33,25 +33,25 @@ class sherpa_config(Command):
     description = "Configure Sherpa build options. If in doubt, ignore this command and stick to defaults. See setup.cfg for more information."
     user_options = [
                     ('fftw', None, "Whether Sherpa should build the embedded fftw3 library, which is the default behavior: set to 'local' to make Sherpa link against existing libraries on the system.)"),
-                    ('fftw-include-dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
-                    ('fftw-lib-dirs', None, "Where the fftw3 libraries are located, if fftw is 'local'"),
-                    ('fftw-libraries', None, "Name of the libraries that should be linked as fftw3"),
+                    ('fftw_include_dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
path: helpers/sherpa_config.py
user: login: DougBurke
body: So, it appears that this change is only an issue for the `setup.cfg` file, and not here, so it is technicaly not necessary, **but**

- I can't find any obvious documentation in `setuptools` that talks about this change (the best I saw was "go and read about it at https://setuptools.pypa.io/en/latest/deprecated/index.html" which at the moment has nothing obvious about this change
- I have been confused about this before - e.g. #1452 - so making all things consistent is probably a good idea
created_at: 2025-03-25T17:08:45Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools >= 77.0.0",  # minimum for PEP 639 which changes the license file format in project.toml
path: pyproject.toml
user: login: DougBurke
body: Given that version 77.0.0 was only released on March 19 2025 I think this is perhaps too much of a change. I would *hope* that we can use earlier versions even with these changes (perhaps leaving in the license classifier below so that users of older setuptools do not lose information)?

Although maybe the older versions will fall over with the `license` setting? I am too tired / annoyed about all this to go and look.
created_at: 2025-03-25T17:13:22Z
author_association: CONTRIBUTOR
diff_hunk: @@ -33,25 +33,25 @@ class sherpa_config(Command):
     description = "Configure Sherpa build options. If in doubt, ignore this command and stick to defaults. See setup.cfg for more information."
     user_options = [
                     ('fftw', None, "Whether Sherpa should build the embedded fftw3 library, which is the default behavior: set to 'local' to make Sherpa link against existing libraries on the system.)"),
-                    ('fftw-include-dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
-                    ('fftw-lib-dirs', None, "Where the fftw3 libraries are located, if fftw is 'local'"),
-                    ('fftw-libraries', None, "Name of the libraries that should be linked as fftw3"),
+                    ('fftw_include_dirs', None, "Where the fftw3 headers are located, if fftw is 'local'"),
path: helpers/sherpa_config.py
user: login: hamogu
body: Yes, I don't think it's required, but I decided that - if we do changes already - then that's a good opportunity to be more consistent. The Inconsistency has caused confusion in the past.
created_at: 2025-03-25T19:30:28Z
author_association: CONTRIBUTOR
diff_hunk: @@ -38,7 +38,7 @@ jobs:
             test-data: submodule
             matplotlib-version: 3
             bokeh-version: 3
-            xspec-version: 12.14.0i
+            xspec_version: 12.14.0i
path: .github/workflows/ci-conda-workflow.yml
user: login: hamogu
body: too much replace all. Will fix.
created_at: 2025-03-25T19:30:57Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools >= 77.0.0",  # minimum for PEP 639 which changes the license file format in project.toml
path: pyproject.toml
user: login: hamogu
body: I'm going to experiment what the minimum version is, now that I've identified all that we need to do to be compatible with the *newest* version. Expect to see a few CI runs, because that way I'll see that it works for linux, too, and for all the different setups that we use.
created_at: 2025-03-25T19:33:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools >= 77.0.0",  # minimum for PEP 639 which changes the license file format in project.toml
path: pyproject.toml
user: login: hamogu
body: The change in the license format done here was introduced in 77.0 and is not compatible with previous versions. I'll need to revert that and pin to "<77.0.0" and then we can have a follow-up at some later point and change that.
created_at: 2025-03-25T19:46:02Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools == 77.0.1",  # minimum for PEP 660 editable installs
path: pyproject.toml
user: login: DougBurke
body: Did you still mean to bump the minimum required version?
created_at: 2025-03-27T03:46:33Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools == 77.0.1",  # minimum for PEP 660 editable installs
path: pyproject.toml
user: login: hamogu
body: No, that's an error in a rebase. Will fix. Thanks for catching and sorry that this sloppily slipped through. Pushed fix.
created_at: 2025-03-27T15:07:21Z
author_association: CONTRIBUTOR
diff_hunk: @@ -1,6 +1,6 @@
 [build-system]
 requires = [
-  "setuptools >= 64.0.0",  # minimum for PEP 660 editable install
+  "setuptools == 77.0.1",  # minimum for PEP 660 editable installs
path: pyproject.toml
user: login: DougBurke
body: No probs.
created_at: 2025-03-27T15:14:35Z
author_association: CONTRIBUTOR

PR comments:
user: login: DougBurke
created_at: 2025-03-24T17:14:12Z
body: Looking at the CI build failure, I wonder if there's some other changes in setuptools that are causing problems (in this case how the XSPEC config settings are set [*]). We should probably discuss whether we want to go to meson (e.g. #1948) or some other build backend.

[*] or it's just a blip in building Sherpa ...
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-24T17:14:49Z
body: But something else must have changed in the setup (or the more recent version of setup tools that the CI is apparently picking up)
```
  error: error in setup.cfg: command 'xspec_config' has no such option 'with-xspec'
  error: subprocess-exited-with-error
```

That is not related to the license file, but that's something else.
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-24T17:17:41Z
body: In the near term, we could also pin a max version of setuptools instead. That would allow us to continue developing other PRs while we figure this out. Going to mason isn't going to happen this week. (Even if the PR is ready, it will need more detailed investigation by DS, I believe).

Or maybe there is an easy solution of the `command 'xspec_config' has no such option 'with-xspec'` error.
author_association: CONTRIBUTOR
user: login: codecov[bot]
created_at: 2025-03-24T19:42:06Z
body: ## [Codecov](https://app.codecov.io/gh/sherpa/sherpa/pull/2249?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 87.66%. Comparing base [(`d5e5477`)](https://app.codecov.io/gh/sherpa/sherpa/commit/d5e54777c80244b8803dcc77ef10de57d653ca72?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa) to head [(`cacc19d`)](https://app.codecov.io/gh/sherpa/sherpa/commit/cacc19d6c07d463cfc3b77896f78991787d47b99?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa).
> Report is 129 commits behind head on main.

<details><summary>Additional details and impacted files</summary>


[![Impacted file tree graph](https://app.codecov.io/gh/sherpa/sherpa/pull/2249/graphs/tree.svg?width=650&height=150&src=pr&token=9aWhIDJHGx&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa)](https://app.codecov.io/gh/sherpa/sherpa/pull/2249?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa)

```diff
@@            Coverage Diff             @@
##             main    #2249      +/-   ##
==========================================
+ Coverage   87.53%   87.66%   +0.13%     
==========================================
  Files          84       84              
  Lines       29974    30028      +54     
  Branches     3837     3831       -6     
==========================================
+ Hits        26238    26325      +87     
+ Misses       3626     3593      -33     
  Partials      110      110              
```

[see 9 files with indirect coverage changes](https://app.codecov.io/gh/sherpa/sherpa/pull/2249/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa)

------

[Continue to review full report in Codecov by Sentry](https://app.codecov.io/gh/sherpa/sherpa/pull/2249?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://app.codecov.io/gh/sherpa/sherpa/pull/2249?dropdown=coverage&src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa). Last update [d5e5477...cacc19d](https://app.codecov.io/gh/sherpa/sherpa/pull/2249?dropdown=coverage&src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=sherpa).

</details>
<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>
author_association: NONE
user: login: DougBurke
created_at: 2025-03-25T02:18:35Z
body: And they've reverted the setuptools change: https://setuptools.pypa.io/en/stable/history.html#v78-0-2
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-25T02:23:09Z
body: It's still deprecated though, "All packages with deprecated configurations are advised to move before 2026." That's essentially right after the 4.18 release, meaning that for 4.18 we either take this change or risk people running into trouble if they accidentally get a newer version of setuptools in 2026. (Or we just rely on them to blow past that date, too.)
author_association: CONTRIBUTOR
user: login: DougBurke
created_at: 2025-03-25T02:27:44Z
body: There's also the fact that even with 78.0.2 our build still appears to fail because of (at least in my PR, which does not contain any change from this PR)

```
error: error in setup.cfg: command 'sherpa_config' has no such option 'fftw-include_dirs'
```

All I meant about the reverted change was that it would hopefully give us time to fix it without haste, but apparently not.
author_association: CONTRIBUTOR
user: login: DougBurke
created_at: 2025-03-25T13:25:38Z
body: I hacked up https://github.com/sherpa/sherpa/pull/2022/commits/db77f74a46eb2d6e9ac811bc75820769e6ff79c5 to get one of my PRs going.
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-25T20:14:41Z
body: I reversed the changes to the license and license file keys, which were driving that "setuptools >= 77.0.0" requirement.
author_association: CONTRIBUTOR
user: login: DougBurke
created_at: 2025-03-26T12:02:51Z
body: Can we squash these (just so that the history is not so noisy)?
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-26T20:59:37Z
body: squashed.
author_association: CONTRIBUTOR
user: login: DougBurke
created_at: 2025-03-28T14:00:10Z
body: @hamogu _ I think the Details/Summary comments are somewhat out of date now, with the recent changes. Can they be updated or am I just confused?
author_association: CONTRIBUTOR
user: login: hamogu
created_at: 2025-03-28T14:02:55Z
body: updated summary. No more details needed.
author_association: CONTRIBUTOR