-
Notifications
You must be signed in to change notification settings - Fork 6
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
[REF] Migrate from setup.py
to pyproject.toml
(fixes #122)
#123
Conversation
Hi, thanks for setting this up! Please go ahead and introduce I'll have time to review this during the week. @wiseodd could you also take a look? |
Pull Request Test Coverage Report for Build 10221782460Details
💛 - Coveralls |
LGTM so far. One thing I'm confused about is why doesn't this have the same problem as before, i.e. requiring |
@f-dangel Okay, I can look into adding ruff into the project later this month, although I would prefer if it was a separate PR if it's okay with you since the tool is quite opinionated and it might involve discussing lint rules and the such. @wiseodd AFAIU the requirement on packaging was solely for the purpose of checking the version of setuptools. It was previously imported inside of
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit, otherwise looks good to me!
Sounds good. |
I removed the post-install step in |
Thanks! I am adding 'create a new release' to my TODO list for the coming weeks. |
@f-dangel Unfortunately I don't have time to make a PR and test if Ruff can replace all the project's linting needs, but adding it as a dependency and pasting the following into [tool.ruff]
# An extremely fast Python linter, written in Rust.
# https://docs.astral.sh/ruff/
# Additional file patterns to omit from formatting and linting.
extend-exclude = ["docs/rtd"]
# Line length to use when enforcing long-lines violations.
line-length = 97 # = 88 + 10% (B950)
[tool.ruff.lint]
# Rule codes or prefixes to enable, in addition to those specified by `select`.
extend-select = [
"B", # flake8-bugbear
"C", # pylint-convention
"E", # pycodestyle-error
"W", # pycodestyle-warning
"C90", # mccabe
"I", # isort
"DOC", # pydocstyle
# Not implemented: https://github.com/astral-sh/ruff/issues/5713
# "P", # flake8-string-format
# Not implemented: https://github.com/astral-sh/ruff/issues/458
# "DAR", # darglint
]
# Rule codes or prefixes to ignore.
ignore = [
"C408", # unnecessary-collection-call
"E203", # whitespace-before-punctuation
"E231", # missing-whitespace
"W291", # trailing-whitespace
"B905", # zip-without-explicit-strict
]
# Mappings from file pattern to rule codes or prefixes to exclude.
per-file-ignores = { "test/**.py" = ["I001"] }
[tool.ruff.lint.mccabe]
# The maximum McCabe complexity to allow before triggering C901 errors.
max-complexity = 10
[tool.ruff.lint.pydocstyle]
# Whether to use Google-style, NumPy-style conventions, or the PEP 257 defaults
# when analyzing docstring sections.
convention = "google"
|
Hello! I agree with @wiseodd that requiring packaging to be installed during build time makes it difficult to use curvlinops in downstream packages such as laplace-torch, and makes the installation process a little confusing.
I've moved the version check in
setup.py
directly intopyproject.toml
using the new standard for setuptools-based packages:Unfortunately, flake8 and darglint do not yet support
pyproject.toml
but their flags can remain in thesetup.cfg
file until support is added. (Although, I recommend eventually migrating to ruff since it can accomplish both tasks.)Fixes #122.