MNT, CI: Update pyproject.toml to include [dependency-groups] - #127
Conversation
… simplify the process of restoring this version of the code. * Introduces two new dependency-groups in the pyproject.toml file: testing and linting * Removed [project.optional-dependencies] from pyproject.toml: none are needed * Removed the .github/constraints/deps.txt file * Updated .yml files with new install instructions
I forgot to install the project and its dependencies.
tylerjereddy
left a comment
There was a problem hiding this comment.
Thanks, I added some quick review comments, but I'll let Seth do the main review here.
…nse to #127 (comment) and updated the .yml files accordingly. Changes are untested, but I included this commit for easy retreval during testing.
…ant. Not sure why SciPy has it. I also removed some packages in the linting group that belonged purely in the doc group.
sdtemple
left a comment
There was a problem hiding this comment.
I verified that your commands run Mac OS and on selene (different but same OS from your darwin run).
It would be nice to confirm that the CI failures are from #117. The CI is set by default to fail-fast, whereas with in the .yml file I think we can keep it running for a bit:
strategy:
fail-fast: false # <--- This is the key line
This might not be the desired long term '.yml' file strategy, though. I forked the branch and added this fail-fast: false to the ci.yml file. I also changed on pushes to be "*". I confirmed via this that the base CI failure is from the partial fit test.
Note: this happens for both Windows OS and Ubuntu OS. We might only have been noticing it for Linux because that's what the cluster uses and it is the first crash (temporally) in the CI run.
|
Just a suggestion--usually best to only review things that changed in the diff vs. stuff that was already there before re: #127 (comment) for example. |
…espectively. Added a version number for pytest (9.1.1) to match the version used by numpy.
|
In your first comment, you mention using If this is necessary, you might want to add that in |
|
I couldn't respond directly, so this is a response to #127 (comment). When I first posted the MR, I was getting low pip versions (I think something like 24.0) on darwin and chicoma. Since pip only added the --group option in version 25.1, the optional builds were not working. For some reason, pip is now up to date there. I think I may have accidentally upgraded pip globally? |
|
@tylerjereddy |
I see, so your example code for testing the changes is more about the global pip required to install the package, and not related to needing such a version specified in our |
|
This PR is being opened from a branch that was pushed to the main repo instead of from your fork. Please don't do that, as noted in gh-108. I'll proceed with doing a round of review here, but if you open another PR from a branch that isn't on your fork, I'll just close it next time. |
Probably not, we're all regular users on I read over the diff here and it seems "ok" now, thanks both. I've added this PR to the It is a bit annoying that CI isn't passing re: gh-117. We need to get that fixed up soon one way or another. That has been plaguing the project for ~3 months now. |
Fixes #123.
[project.optional-dependencies]list is removed frompyproject.toml[dependency-groups]list is added topyproject.toml.ymlfiles (exceptwheel.ymlanddependabot.yml) to account for the updated workflow.With this update, there are three commands that can be used to build the project from source:
The first command installs the project as normal. The second installs the dependencies needed to run the test suite. The last installs all dependencies needed to lint (
ruff checkandnumpydoc lint).When running, make sure pip is up to date. Installation of the testing or linting group will fail if the version of pip is 25.0 or lower. In particular, I found that the default version of pip on darwin and chicoma was too low for this to work, but everything does work when I update pip using
pip install --upgrade pipfirst. I am not sure if this will cause the CI pipeline to fail. If it does, I will add another commit adding the above incantation to the relevant.ymlfiles.I did not modify
wheel.yml. To my understanding,wheel.ymlis intended to test the build as seen by users of the code. Users should not be able to directly install the testing/linting versions of the package.AI Statement: I did not use AI to write any of the code on this branch. I did consult AI extensively with questions about pip installations and builds. I also used AI for debugging purposes.
Testing the update
I have little experience working with installation, so I figured I would include an outline of how I tested my changes to help reviewers. I ran the code below on my laptop and on darwin (I could not secure a chicoma node). For the unit tests, I first ran the code as described below, but then once I confirmed all tests were collected and a few tests had run, I stopped the testing. I then used
python -m pytest -n 8to verify the tests separately (remember topip install pytest-xdistfirst).Return to the root directory.