Add pyproject.toml to Improve CI/CD and Tooling#1108
Add pyproject.toml to Improve CI/CD and Tooling#1108githubnemo merged 19 commits intoskorch-dev:masterfrom
Conversation
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thank you for this fantastic PR, well done cleaning up all these different configs and adopting the new pyproject.toml.
I have a few smaller comments, but overall this looks very close to being finished.
There is a big difference for pylint, going from 809 lines of logs to 1536 on my machine, probably because the no_self_use rule is not disabled. But honestly, I think it's fine since I don't really use it anymore and I suspect others aren't either. We should move to a more modern linter like black or ruff eventually -- with string normalization disabled, skorch should already be quite close to what they expect.
Co-authored-by: Benjamin Bossan <BenjaminBossan@users.noreply.github.com>
BenjaminBossan
left a comment
There was a problem hiding this comment.
Thanks a lot for the last few changes, the PR LGTM.
Before merging this big change, I'd like a second pair of eyes to check the PR, pinging @thomasjpfan @githubnemo
|
Could you please review? cc: @thomasjpfan, @githubnemo |
githubnemo
left a comment
There was a problem hiding this comment.
Thanks @ParagEkbote!
The changes LGTM except for minor comments and some questions regarding the dependency grouping.
Regardless of possible changes in the dependency grouping, let's not forget to update the README with the new instructions, e.g., instead of requirements-dev.txt we now need to install via pip install '.[full]'. This goes for docs/user/installation.rst as well.
Co-authored-by: githubnemo <githubnemo@users.noreply.github.com>
|
Thanks a lot, @ParagEkbote, for the very thorough implementation. |
Due to #1108, pip install -r requirements.txt is no longer working. Also, I took the liberty to bump the Python version used to 3.12.
Due to #1108, pip install -r requirements.txt is no longer working. Also, I took the liberty to bump the Python version used to 3.12.
# Version 1.2.0 This is a smaller release, most changes concern examples and development and thus don't affect users of skorch. ## Changed - Loading of skorch nets using pickle: When unpickling a skorch net, you may come across a PyTorch warning that goes: "FutureWarning: You are using torch.load with weights_only=False [...]"; to avoid this warning, pickle the net again and use the new pickle file (#1092) ## Added - Add Contributing Guidelines for skorch. (#1097) - Add an example of hyper-parameter optimization using [Optuna](https://optuna.org/) [here](https://github.com/skorch-dev/skorch/tree/master/examples/optuna) (#1098) - Add Example for Streaming Dataset(#1105) - Add pyproject.toml to Improve CI/CD and Tooling (#1108) Thanks @raphaelrubrice, @omahs, and @ParagEkbote for their contributions. **Full Changelog**: v1.1.0...v1.2.0 Release commit specific: * Bump verison to 1.2.0 * Update CHANGES.md * Remove workarounds that have been fixed in sklearn Only affects tests
Fixes #1106
As described in the issue, I have chosen to subsume 6 python tooling legacy into a single pyproject.toml file with minimal changes.
Motivation
As described in PEP 639, PEP 518 and PEP 621, the pyproject.toml file is a modern python tooling file which can manage multiple tasks of testing, linting, building of package, codecoverage ,etc. It has key-value configuration format.
Major Changes
Building the source and wheels for the library
This functionality does not have any breaking changes, I've tested it out with the
python -m buildcommand.Linting with pylint and flake8
Linting with flake8 has no breaking changes. pylint has some changes. version 2.6 has deprecated
no-space-checkoption withno_self_usebeing made optional. pylint optionslocally-enabled,super-on-old-classwere deprecated in version 2.14. I've updated it with the relevant rules to make the lint efficient.I've tested out both tools, they are working correctly.
Using classifiers for PyPI
When we publish packages on PyPI, classifers help categorize Python packages. These classifiers provide metadata about the package, such as its development status, intended audience, license, supported Python versions, and more. I've current added a standard set of packages for the library. Changes can be made to them as required.
Testing and Code Coverage
We can run the tests by running the
pytestcommand with no breaking changes. Testing Code coverage has no breaking changes as well. You can check it with thepytest -v --cov=./skorch --cov-report=term-missingcommand.Deprecating Manifest.in, requirements.txt and requirements-dev.txt
The functions of Manifest.in can be done by the .toml file as described in the setuptools docs here. The optional dependencies (prev. requirements-dev.txt) are listed in [project.optional-dependencies] and dependencies (prev requirements.txt) are listed in the project section.
Lastly, I have updated the gh-actions file to reflect these changes as well. I do know that the changes are a bit sweeping, but keeping the CI/CD and Python tooling up to date is quite essential and lead to less headaches as seen in #1081 . Could you please review the changes?
cc: @BenjaminBossan