From a7475bf6edbf3f6f25e925ccd93ffca7e072da30 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Tue, 20 Oct 2026 13:48:37 -0400 Subject: [PATCH 1/8] remove requirements files in favor of dependency extras (`pip install .[test]`) --- .github/workflows/ci.yml | 24 +++++++----------------- conda_requirements.txt | 15 --------------- requirements.txt | 12 ------------ test_requirements.txt | 6 ------ 4 files changed, 7 insertions(+), 50 deletions(-) delete mode 100644 conda_requirements.txt delete mode 100644 requirements.txt delete mode 100644 test_requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a51409b8e5d..0160438ad8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -148,25 +148,15 @@ jobs: fi ln -s $HOME/des_data examples/des/ - - name: Install basic dependencies + - name: Install additional test dependencies run: | - python -m pip install -U pip + pip install coverage - # Do these three first to clarify potential conflicts - pip install -U numpy - pip install -U setuptools - pip install -U wheel + # only needed for `run_slow` and `slow` + pip install matplotlib - # Standard dependencies - pip install -U -r requirements.txt - - # Extra packages needed for testing - pip install -U -r test_requirements.txt - pip install -U coverage - - pip install -U matplotlib - - pip install -U astroplan + # only needed for `test_dcr_angles()` + pip install astroplan # Starlink doesn't seem to work anymore. Even with numpy 1.x, I'm getting # "ModuleNotFoundError: No module named 'numpy'" when building the wheel. @@ -194,7 +184,7 @@ jobs: run: | # The prefix is required for recent MacOS, because of System Integrity Protection. # It's not necessary on Linux, but is harmless enough. - FFTW_DIR=$FFTW_DIR pip install -vvv . + FFTW_DIR=$FFTW_DIR pip install -vvv .[test] - name: Check download_cosmos only if it changed. (And only on 1 runner) if: matrix.py == 3.12 && github.base_ref != '' diff --git a/conda_requirements.txt b/conda_requirements.txt deleted file mode 100644 index 5e87ca011e7..00000000000 --- a/conda_requirements.txt +++ /dev/null @@ -1,15 +0,0 @@ -# The requirements packages that can be installed with -# conda install -y -c conda-forge --file conda_requirements.txt -setuptools>=38 -numpy>=1.17 -astropy>=2.0 -pybind11>=2.2 -pip>=9.0 -#gcc>=4.8 # Rarely necessary anymore. Uncomment if your compiler is too old to compile c++11. -fftw>=3.3 -eigen>=3.3 -LSSTDESC.Coord>=1.2 - -# Not technically required, but useful. -pyyaml>=3.12 -pandas>=0.20 diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cc9a22fe013..00000000000 --- a/requirements.txt +++ /dev/null @@ -1,12 +0,0 @@ -# I didn't try to figure out which versions of these are really required. These are the -# current versions at the time of writing this (Jan, 2018), and they are known to work. - -# These are in conda_requirements.txt. If using that, you may prefer to do -# conda install -c conda-forge --file conda_requirements.txt -# prior to running pip install -r requirements.txt -setuptools>=38 -numpy>=1.17 -astropy>=2.0 -pybind11>=2.2 -pip>=18.0 -LSSTDESC.Coord>=1.2 diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index fc676b1bfdd..00000000000 --- a/test_requirements.txt +++ /dev/null @@ -1,6 +0,0 @@ -pyyaml>=3.12 -pytest>=3.4 -pytest-xdist>=1.19 -pytest-timeout>=1.2 -scipy>=1.0 -matplotlib From e91de8b89bd437d85ff225b0e116913c6c274466 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 22 Oct 2026 08:28:02 -0400 Subject: [PATCH 2/8] find occurences in docs --- INSTALL.rst | 1 - docs/install.rst | 13 +++---------- docs/install_conda.rst | 10 ++-------- docs/install_pip.rst | 32 ++++++-------------------------- examples/demo1.yaml | 2 +- 5 files changed, 12 insertions(+), 46 deletions(-) diff --git a/INSTALL.rst b/INSTALL.rst index f47342ebaed..b77765a5e09 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -33,7 +33,6 @@ you can do:: git clone git@github.com:GalSim-developers/GalSim.git cd GalSim - pip install -r requirements.txt pip install . (again possibly with either sudo or --user). diff --git a/docs/install.rst b/docs/install.rst index 908f93a304d..225f6d3885b 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -40,25 +40,18 @@ Running tests The simplest way to run our test suite by typing:: - python setup.py test + pip install .[test] + pytest -n auto This should run all the Python-layer tests with pytest and also compile and run the C++ test suite. -There are a number of packages that are used by the tests, but which are not -required for GalSim installation and running. These should be installed -automatically by the above command, but you can install them manually via:: - - pip install -r test_requirements.txt - -(As usually, you may need to add either ``sudo`` or ``--user``.) - By default, the tests will run in parallel using the pytest plugins ``pytest-xdist`` and ``pytest-timeout`` (to manage how much time each test is allowed to run). If you want to run the Python tests in serial instead, you can do this via:: - python setup.py test -j1 + pytest You can also use this to modify how many jobs will be spawned for running the tests. diff --git a/docs/install_conda.rst b/docs/install_conda.rst index 9cb685a76f0..167ddfa520a 100644 --- a/docs/install_conda.rst +++ b/docs/install_conda.rst @@ -7,17 +7,11 @@ so you can use that as follows:: conda install -c conda-forge galsim -Also, if you prefer to use the defaults channel, then (at least as of this -writing), it had all the items in conda_requirements.txt, except for pybind11. -So if you have conda-forge in your list of channels, but it comes after -defaults, then that should still work and pybind11 will be the only one that -will need the conda-forge channel. - If you want to install from source (e.g. to work on a development branch), but use conda for the dependencies, you can do:: git clone git@github.com:GalSim-developers/GalSim.git cd GalSim - conda install --file conda_requirements.txt - python setup.py install + conda install astropy LSSTDESC.Coord + pip install -e . diff --git a/docs/install_pip.rst b/docs/install_pip.rst index 9e2e25122b8..737887a2ade 100644 --- a/docs/install_pip.rst +++ b/docs/install_pip.rst @@ -28,8 +28,7 @@ you can do:: git clone git@github.com:GalSim-developers/GalSim.git cd GalSim - pip install -r requirements.txt - python setup.py install + pip install -e . (again possibly with either sudo or --user). @@ -44,7 +43,7 @@ about how to do this. Eigen is also not pip installable, but it is a header-only library, so it doesn't require any installation. Therefore, if you don't have it it locally in a place where -setup.py can find it, a version of Eigen will be downloaded directly. +``pip`` can find it, a version of Eigen will be downloaded directly. See `Installing Eigen` for more details. Finally, while GalSim is officially a Python package, there are some users who @@ -66,9 +65,7 @@ other recent (especially later) versions will also work: There are a few others modules are not technically required, but we let pip install them along with GalSim, because they either add useful functionality -or efficiency to GalSim. These are listed in the requirements.txt file that -pip uses to determine what else to install. But if you install with -``python setup.py install``, then these will not be installed. +or efficiency to GalSim. - Starlink (3.10.0) (Improved WCS functionality) - PyYaml (3.12) (Reads YAML config files) @@ -76,20 +73,7 @@ pip uses to determine what else to install. But if you install with If you want to install these yourself, the quickest way is to do:: - pip install -r requirements.txt - -If you want more control about which version you get or otherwise want to install -each package individually, you can do:: - - pip install numpy - pip install future - pip install astropy - pip install pybind11 - pip install LSSTDESC.Coord - - pip install starlink-pyast - pip install pyyaml - pip install pandas + pip install starlink-pyast pyyaml pandas In all cases, you may need to precede the above commands with ``sudo`` or add ``--user`` to the end as you normally do when pip installing on your system. @@ -157,14 +141,10 @@ any extra work on your part. If it is in a non-standard location, and you do not want to add this path to your LD_LIBRARY_PATH (or you are on a modern Mac that hides such system variables from setup.py), then you can instead set the FFTW_DIR environment -variable to tell GalSim where to look when running pip or setup.py:: +variable to tell GalSim where to look when running pip:: FFTW_DIR=/path/to/fftw/lib pip install galsim -or:: - - FFTW_DIR=/path/to/fftw/lib python setup.py install - For instance, if libfftw3.so is located in /opt/cray/pe/lib64, you could use that with:: @@ -379,7 +359,7 @@ location in the ``include`` directory. These files precisely specify the available C++-layer API for a given release. The compiled library file for linking user C++ code is not installed by the default -pip or setup.py installation procedure. The relevant functions are included +pip installation procedure. The relevant functions are included in the Python module file, called ``_galsim.so``, but this file is often not usable for linking your own C++ code. diff --git a/examples/demo1.yaml b/examples/demo1.yaml index 7671906dc05..bc6c35c7c4c 100644 --- a/examples/demo1.yaml +++ b/examples/demo1.yaml @@ -28,7 +28,7 @@ # writing the corresponding python code. # # The executable that reads these YAML files is called galsim, which should be installed -# by either `pip install galsim` or `python setup.py install`. If you used the latter, +# with `pip install galsim`. If you used the latter, # the output should end with a line something along the lines of: # # scripts installed into /usr/local/bin From da5e65fdfaa98f04e307a60f4e01be35d8aad55f Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Wed, 28 Oct 2026 09:27:49 -0400 Subject: [PATCH 3/8] install setuptools for setup.py call --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0160438ad8a..7dde80b3fd4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -206,6 +206,8 @@ jobs: - name: Check shared library if: matrix.py == 3.12 run: | + python -m pip install setuptools + # On a few systems (arbitrarily py3.12, where we also check mac and clang), # check the shared library creation and link. GALSIM_BUILD_SHARED=1 python setup.py build From 814ac51a4ffe5f9a6e8d04094d217710a571a761 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 12 Nov 2026 08:34:16 -0500 Subject: [PATCH 4/8] restore conda environment file --- conda_requirements.txt | 14 ++++++++++++++ docs/install_conda.rst | 2 +- 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 conda_requirements.txt diff --git a/conda_requirements.txt b/conda_requirements.txt new file mode 100644 index 00000000000..d8b8422ab75 --- /dev/null +++ b/conda_requirements.txt @@ -0,0 +1,14 @@ +# The requirements packages that can be installed with +# conda install -y -c conda-forge --file conda_requirements.txt +python>=3.9 +numpy>=1.17 +astropy>=2.0 +#gcc>=4.8 # Rarely necessary anymore. Uncomment if your compiler is too old to compile c++11. +fftw>=3.3 +eigen>=3.3 +LSSTDESC.Coord>=1.2 + +# Not technically required, but useful. +pyyaml>=3.12 +pandas>=0.20 + diff --git a/docs/install_conda.rst b/docs/install_conda.rst index 167ddfa520a..b1ad5565e3d 100644 --- a/docs/install_conda.rst +++ b/docs/install_conda.rst @@ -12,6 +12,6 @@ but use conda for the dependencies, you can do:: git clone git@github.com:GalSim-developers/GalSim.git cd GalSim - conda install astropy LSSTDESC.Coord + conda install --file conda_requirements.txt pip install -e . From ced0064c194c9219b5c63c421ee7eabb8c5d4fcb Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 12 Nov 2026 08:39:55 -0500 Subject: [PATCH 5/8] apply review suggestion --- examples/demo1.yaml | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/examples/demo1.yaml b/examples/demo1.yaml index bc6c35c7c4c..65e6193f836 100644 --- a/examples/demo1.yaml +++ b/examples/demo1.yaml @@ -28,14 +28,7 @@ # writing the corresponding python code. # # The executable that reads these YAML files is called galsim, which should be installed -# with `pip install galsim`. If you used the latter, -# the output should end with a line something along the lines of: -# -# scripts installed into /usr/local/bin -# -# telling you which directory they were installed in. If that directory is not in your -# path, then there should also be a message telling you to add it to your $PATH -# environment variable. If you used `pip install galsim --user`, then it was probably +# with `pip install galsim`. If you used `pip install --user galsim`, then it was probably # installed into a directory called .local/bin in your home directory. You can have # pip tell you where it is installing things by adding the `-v` option. # From 4192a6bd55cd1b785b81d80e486bd72d4e869053 Mon Sep 17 00:00:00 2001 From: Zach Burnett Date: Thu, 12 Nov 2026 08:41:31 -0500 Subject: [PATCH 6/8] remove `-n auto` from docs default suggestion --- docs/install.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index 225f6d3885b..8e0e9322244 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -41,7 +41,7 @@ Running tests The simplest way to run our test suite by typing:: pip install .[test] - pytest -n auto + pytest This should run all the Python-layer tests with pytest and also compile and run the C++ test suite. From 99c0bd94a1de87238f9652766cac606ce2a592d0 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Thu, 12 Nov 2026 10:38:20 -0500 Subject: [PATCH 7/8] remove `setup_requires` from `setup.py` as it is not used by `pip`, and update `build-system.requires` to explicitly include `numpy` --- setup.py | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.py b/setup.py index 929ffce9eab..530840ed355 100644 --- a/setup.py +++ b/setup.py @@ -1312,7 +1312,6 @@ def run(self): undef_macros = undef_macros, extra_link_args = ["-lfftw3"]) - # If Eigen doesn't exist in the normal places, download it. find_eigen_dir(output=True) From 07e2b87158fec75575904b3f241c40e29b951fe6 Mon Sep 17 00:00:00 2001 From: zacharyburnett Date: Fri, 13 Nov 2026 09:06:54 -0500 Subject: [PATCH 8/8] restore unused build dependencies to `conda_requirements.txt` with comment --- conda_requirements.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/conda_requirements.txt b/conda_requirements.txt index d8b8422ab75..62911a1f136 100644 --- a/conda_requirements.txt +++ b/conda_requirements.txt @@ -12,3 +12,8 @@ LSSTDESC.Coord>=1.2 pyyaml>=3.12 pandas>=0.20 +# the following are ONLY used to build the package, +# and ONLY if you pass `--no-build-isolation` to `pip install` +# (or `--no-isolation` to `python -m build`) +setuptools>=38 +pybind11>=2.2