Skip to content

Migrate .coveragerc to pyproject.toml#6221

Closed
vitorbborges wants to merge 8 commits intooptuna:masterfrom
vitorbborges:fix-issue-#6173
Closed

Migrate .coveragerc to pyproject.toml#6221
vitorbborges wants to merge 8 commits intooptuna:masterfrom
vitorbborges:fix-issue-#6173

Conversation

@vitorbborges
Copy link
Copy Markdown
Contributor

@vitorbborges vitorbborges commented Jul 29, 2025

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.cfg to pyproject.toml. Notice that flake8 still does not support pyproject.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 ruff
Also, removed .coveragerc and MANIFEST.in while fixing the coverage.yml to run properly with pyproject.toml.

@c-bata c-bata self-assigned this Jul 30, 2025
@c-bata c-bata added the other Issue/PR that does not fit into any other label. label Jul 30, 2025
Copy link
Copy Markdown
Member

@c-bata c-bata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Comment on lines -1 to -2
graft tests
global-exclude *~ *.py[cod] *.so
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you remove these comments?

Suggested change
# pytest configuration (already present)

pyproject.toml Outdated
"black",
"blackdoc",
"flake8",
"flake8-pyproject",
Copy link
Copy Markdown
Member

@c-bata c-bata Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'd prefer not to add additional dependency just to remove setup.cfg.

Suggested change
"flake8-pyproject",

@nabenabe0928 nabenabe0928 changed the title Fix issue #6173 "migrating config files to pyproject.toml" Migrate config files to pyproject.toml Aug 1, 2025
@nabenabe0928 nabenabe0928 changed the title Migrate config files to pyproject.toml Migrate .coveragerc to pyproject.toml Aug 1, 2025
@github-actions
Copy link
Copy Markdown
Contributor

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label Aug 10, 2025
@vitorbborges vitorbborges requested a review from c-bata August 18, 2025 18:08
@github-actions github-actions bot removed the stale Exempt from stale bot labeling. label Aug 18, 2025
"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.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks that this PR contains unrelated changes. Could you fix them?

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has not seen any recent activity.

@github-actions github-actions bot added the stale Exempt from stale bot labeling. label Aug 27, 2025
@github-actions
Copy link
Copy Markdown
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

other Issue/PR that does not fit into any other label. stale Exempt from stale bot labeling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants