Skip to content

Conversation

rmjarvis
Copy link
Member

@rmjarvis rmjarvis commented Sep 5, 2025

This PR includes a number of fixes to our testing system, with the primary goal of not pinning setuptools<72 anymore. There are a couple of security advisories about using an old setuptools version, so these should be resolved by removing the pin. (1, 2)

  • The most important change for removing the pin is that setuptools removed the test command, which we used for running the C++ tests. So now we do that with an environment variable instead. GALSIM_RUN_TESTS=1 python setup.py build
  • Recent pytest versions have stopped running setup() before any tests in the module. We only did this in run_examples.py, which was a holdover from when we used to use nosetests, where this was the right way to have a setup function. It wasn't causing an error to have the setup() function, but it wasn't actually being run. Now declaring it as a pytest.fixture makes it run at the start of the module scope, which is what we want for this.
  • Our test functions are all designed to be run from the tests directory, rather than the root directory. If you run pytest from the root directory, the directory names didn't match up properly, so it gave a bunch of errors about missing files. Another pytest fixture can be used to make sure all tests are run with tests as the working directory. So now running pytest in the GalSim root directory works just fine.
  • Fixed an error that started with numpy 2.3 related to the **= operator on numpy arrays.

@rmjarvis rmjarvis linked an issue Sep 5, 2025 that may be closed by this pull request
@rmjarvis rmjarvis requested a review from jmeyers314 October 6, 2025 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pin on setuptools<72
1 participant