Migrate .coveragerc to pyproject.toml#6221
Migrate .coveragerc to pyproject.toml#6221vitorbborges wants to merge 8 commits intooptuna:masterfrom
.coveragerc to pyproject.toml#6221Conversation
c-bata
left a comment
There was a problem hiding this comment.
Thank you for your pull request. I left some comments. Could you please revert the changes related to MANIFEST.in and flake8 for the reasons I mentioned?
| graft tests | ||
| global-exclude *~ *.py[cod] *.so |
There was a problem hiding this comment.
As far as I know, these files cannot be excluded from the sdist package without MANIFEST.in.
There is a line of thought (to which I personally subscribe), that considers sdist as a “development snapshot” on steroids; i.e., it contains everything needed for a developer to build, test and perform all normal maintenance tasks, plus Python-specific packaging metadata. Distribution re-packagers usually that approach and encourage devs to leave docs and test files in the sdists (see discussion in https://discuss.python.org/t/should-sdists-include-docs-and-tests/14578).
pypa/setuptools#3260
pyproject.toml
Outdated
| force_sort_within_sections = 'True' | ||
| order_by_type = 'False' | ||
|
|
||
| # pytest configuration (already present) |
There was a problem hiding this comment.
Could you remove these comments?
| # pytest configuration (already present) |
pyproject.toml
Outdated
| "black", | ||
| "blackdoc", | ||
| "flake8", | ||
| "flake8-pyproject", |
There was a problem hiding this comment.
We'd prefer not to add additional dependency just to remove setup.cfg.
| "flake8-pyproject", |
pyproject.toml
pyproject.toml.coveragerc to pyproject.toml
|
This pull request has not seen any recent activity. |
| "scikit-learn>=0.24.2", # optuna/importance. | ||
| "scipy", # optuna/_gp. | ||
| "torch; python_version<='3.12'", # TODO(gen740): Remove this line when 'torch', a dependency of 'optuna/_gp', supports Python 3.13 | ||
| "torch", # optuna/_gp. |
There was a problem hiding this comment.
It looks that this PR contains unrelated changes. Could you fix them?
|
This pull request has not seen any recent activity. |
|
This pull request was closed automatically because it had not seen any recent activity. If you want to discuss it, you can reopen it freely. |
Motivation
Noticed this simple issue #6173 hanging for more than a month and went ahead and fixed it.
Description of the changes
Migrated flake8 config from
setup.cfgtopyproject.toml. Notice that flake8 still does not supportpyproject.toml, thus, the inclusion of the flake8-pyproject in the[checking]dependencies. A modern alternative to avoid this dependency inclusion is moving the code styler to ruffAlso, removed
.coveragercandMANIFEST.inwhile fixing thecoverage.ymlto run properly withpyproject.toml.