diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a51409b8e5..7dde80b3fd 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 != '' @@ -216,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 diff --git a/INSTALL.rst b/INSTALL.rst index f47342ebae..b77765a5e0 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/conda_requirements.txt b/conda_requirements.txt index 5e87ca011e..62911a1f13 100644 --- a/conda_requirements.txt +++ b/conda_requirements.txt @@ -1,10 +1,8 @@ # The requirements packages that can be installed with # conda install -y -c conda-forge --file conda_requirements.txt -setuptools>=38 +python>=3.9 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 @@ -13,3 +11,9 @@ LSSTDESC.Coord>=1.2 # Not technically required, but useful. 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 diff --git a/docs/install.rst b/docs/install.rst index 908f93a304..8e0e932224 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 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 9cb685a76f..b1ad5565e3 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 + pip install -e . diff --git a/docs/install_pip.rst b/docs/install_pip.rst index 9e2e25122b..737887a2ad 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 7671906dc0..65e6193f83 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 -# by either `pip install galsim` or `python setup.py install`. 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. # diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index cc9a22fe01..0000000000 --- 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/setup.py b/setup.py index 929ffce9ea..530840ed35 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) diff --git a/test_requirements.txt b/test_requirements.txt deleted file mode 100644 index fc676b1bfd..0000000000 --- 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