Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopt '[tool.pytest-enabler]' for configuration (PEP 518) #5

Merged
merged 4 commits into from
Jun 22, 2022

Conversation

abravalheri
Copy link
Contributor

As described in #4, PEP 518 restricts the name of tables in pyproject.toml (currently, with PEP 517/518/621, only [build-system], [project] and [tool.*] are allowed) and specifies that tools should use [tool.<name on PyPI>] for storing their configuration.

This PR fix #4, by deprecating [pytest.enabler] and migrating to [tool.pytest-enabler].

The usage of hyphen (-) is preferred to underscore for the sake of consistency with PEP 517/518/621 (also the official name of the distribution, before normalisation, seems to be pytest-enabler according to setup.cfg).

@RonnyPfannschmidt
Copy link

@jaraco i strongly recommend this

CHANGES.rst Outdated Show resolved Hide resolved
Comment on lines 28 to 33
if "pytest" in defn and "enabler" in defn["pytest"]:
msg = "pytest-enabler configuration should use the `[tool.pytest-enabler]` "
msg += "table in pyproject.toml (`[pytest.enabler]` is now deprecated)."
warnings.warn(msg, DeprecationWarning)
return defn["pytest"]["enabler"]
return defn["tool"]["pytest-enabler"]
Copy link
Owner

Choose a reason for hiding this comment

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

I'd like to see this logic broken out as a compatibility shim that will be removed. I'll do that.

Copy link
Owner

Choose a reason for hiding this comment

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

Done in 746a84d.

tests/test_enabler.py Outdated Show resolved Hide resolved
@jaraco jaraco merged commit c60026f into jaraco:main Jun 22, 2022
@abravalheri
Copy link
Contributor Author

Thank you very much Jason.

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.

Using a top-level table for pytest in pyproject.toml offends PEP 518
3 participants