Skip to content

Package python-ldap with pyproject.toml #589

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

droideck
Copy link
Contributor

No description provided.

@droideck droideck added the wip label Jul 13, 2025
@droideck
Copy link
Contributor Author

droideck commented Aug 1, 2025

@hroncok hi! When/if you have time, could you please take a look if all is good with the pyproject.toml transformation?

Notably, it has C extensions that are handled in setup.py for now.
I've tried to make it work with pyproject.toml but I faced this issue - pypa/setuptools#4810

@droideck droideck requested review from tiran and mistotebe August 1, 2025 01:39
@droideck droideck marked this pull request as ready for review August 1, 2025 01:39
@droideck droideck removed the wip label Aug 1, 2025
@spaceone
Copy link
Contributor

spaceone commented Aug 8, 2025

you added black formatter configuration. It would be nice to switch to ruff which is black compatible but way more fast and better configurable.

@hroncok
Copy link
Contributor

hroncok commented Aug 11, 2025

I would also suggest not mixing unrelated changes, but converting this to pyproject.toml as is and only then add more stuff (like ruff).

@droideck
Copy link
Contributor Author

I would also suggest not mixing unrelated changes, but converting this to pyproject.toml as is and only then add more stuff (like ruff).

I totally agree! It's better to be done in a separate PR.

@droideck droideck requested a review from hroncok August 12, 2025 05:14
tox.ini Outdated
Comment on lines 36 to 40
[testenv:py313]
# Python 3.13 headers are incompatible with declaration-after-statement
setenv =
CFLAGS=-Wno-int-in-bool-context -Werror -std=c99

Copy link
Contributor

Choose a reason for hiding this comment

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

For example this addition is not related.

Comment on lines +108 to +137
[tool.coverage.run]
branch = true
source = [
"ldap",
"ldif",
"ldapurl",
"slapdtest",
]

[tool.coverage.paths]
source = [
"Lib/",
".tox/*/lib/python*/site-packages/",
]

[tool.coverage.report]
ignore_errors = false
precision = 1
exclude_lines = [
"pragma: no cover",
"raise NotImplementedError",
"if 0:",
"if __name__ == .__main__.:",
"if PY2",
"if not PY2",
]

[tool.coverage.html]
directory = "build/htmlcov"
title = "python-ldap coverage report"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is not related and should be done in a separate commit at least.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's just a move of a coverage tool to pyproject.toml. I'd rather do it as part of this PR.

pyproject.toml Outdated
Comment on lines 74 to 92
[tool.black]
line-length = 88
target-version = ['py36', 'py37', 'py38', 'py39', 'py310', 'py311', 'py312', 'py313']
extend-exclude = '''
/(
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| Modules
)/
'''

Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, I'm fine doing it separately, too.

pyproject.toml Outdated
line_length=88
known_first_party=['ldap', '_ldap', 'ldapurl', 'ldif', 'slapdtest']
sections=['FUTURE', 'STDLIB', 'THIRDPARTY', 'FIRSTPARTY', 'LOCALFOLDER']
profile = "black"
Copy link
Contributor

Choose a reason for hiding this comment

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

Unrelated.

pyproject.toml Outdated
Comment on lines 100 to 106
[tool.pytest.ini_options]
testpaths = ["Tests"]
python_files = ["t_*.py"]
filterwarnings = [
"error",
"ignore::ldap.LDAPBytesWarning",
]
Copy link
Contributor

Choose a reason for hiding this comment

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

This is also seemingly unrelated.

@mistotebe
Copy link
Contributor

I support the changes in general. As @hroncok pointed out, it's worth doing it one commit at a time (e.g. cleanup if needed, then switch to pyproject.toml as 1:1, then any changes to 3.13 if we really need to do them right now)

The doc updates look quite useful, so personally I'd accept them as part of the cleanup set but others' opinions might differ. Adding ruff or other modernisation (noxfile.py?) sounds like a new PR though.

@droideck droideck requested a review from hroncok August 12, 2025 17:17
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.

4 participants