Repository navigation
Make build configuration compatible with PEP621 - #3220
Conversation
|
In the interests of keeping PR scope as small as possible, I may cherry-pick c48f5f1 and apply it before reviewing the rest of this PR. |
justinmayer
left a comment
There was a problem hiding this comment.
Many thanks for working on this, @lioman! In addition to the in-line comments, I have two additional thoughts:
- I see you have chosen to use PDM for the build backend. I have only using Hatchling in combination with PDM, and so I have no experience with PDM's build backend. But I imagine it works just fine and has the ostensible advantage of not needing an additional dependency (i.e., Hatchling). So I am down to try it and see how it goes.
- I have a few mild preferences regarding the order of items in
pyproject.toml, so I will add a commit with some proposed changes. Those changes may also include a couple of the suggested changes I made in my in-line comments.
|
Also, the c48f5f1 commit should be dropped from this PR, as I already added it to |
|
a0dde32 to
f971730
Compare
justinmayer
left a comment
There was a problem hiding this comment.
Hi @lioman. I made some more recommended fixes for some problems I found.
- adapt documentation - add wheel tests to check wheel contents. - adapt pipeline to use pdm - adapt autopub config - add scripts as shortcuts to invoke tasks
c7b5797 to
00d26fc
Compare
justinmayer
left a comment
There was a problem hiding this comment.
Great work, Lioman. We're getting close! I commented on a few areas where I think we can still make improvements.
| "black<20.0,>=19.10b0", | ||
| "ruff>=0.1.3,<1.0.0", | ||
| "tomli;python_version<'3.11'", | ||
| ] |
There was a problem hiding this comment.
- Should we replace the long
devgroup with a more-specific set ofdocs,lint, andtestgroups? (example) - Except for Jinja2, Markdown, Pygments, and Furo, I think we can remove the upper bounds. More often than not, upper bounds cause more problems than they solve. (See example of the Black project dropping upper bounds on dependencies.)
- Given that we are going to use Ruff, I don't think we need
flake8,flake8-import-order, orisortany longer — Ruff contains all the functionality of those tools.
There was a problem hiding this comment.
yes I think so too and thought about it. To keep this PR a bit smaller I propose to do it in an additional PR
There was a problem hiding this comment.
I agree that deferring the separation into development dependency groups makes sense, but I think my comments in (2) and (3) are probably best resolved in the context of this PR, don't you think?
justinmayer
left a comment
There was a problem hiding this comment.
A few more comments. So sorry! I'm sure this is annoying. Thank you for your patience!
| def test_wheel_contents(pytestconfig): | ||
| """ | ||
| This test, should test the contents of the wheel to make sure, | ||
| that everything that is needed is included in the final build |
There was a problem hiding this comment.
I suggest removing the two commas in this sentence, as well as adding a period at the end.
| wheel_file = pytestconfig.getoption("--check-wheel") | ||
| assert wheel_file.endswith(".whl") | ||
| files_list = ZipFile(wheel_file).namelist() | ||
| ## Check is theme files are copiedto wheel |
There was a problem hiding this comment.
Maybe a single # instead of two? Also, there are some errors. I would change the text to:
# Check if theme files are copied to wheel
| ## Check is tool templatesare copiedto wheel | ||
| tools = Path("./pelican/tools/templates") | ||
| for x in tools.iterdir(): | ||
| assert str(x) in files_list |
There was a problem hiding this comment.
I think this comment was copy+pasted and not relevant to what appears below it?
| "black<20.0,>=19.10b0", | ||
| "ruff>=0.1.3,<1.0.0", | ||
| "tomli;python_version<'3.11'", | ||
| ] |
There was a problem hiding this comment.
I agree that deferring the separation into development dependency groups makes sense, but I think my comments in (2) and (3) are probably best resolved in the context of this PR, don't you think?
|
Hey @lioman. As I just mentioned in the chat room, I didn't realize my request to remove the upper bound on dependencies would result in that huge mass-formatting of other files. I think it's best to revert that and go back to what you had before that change (eb052ca, presumably). I am really sorry. |
bbde24f to
eb052ca
Compare
|
@justinmayer removed those commits. I will create an additional PR with those commits and suggest to apply it, just before the release, to minify the friction. |
justinmayer
left a comment
There was a problem hiding this comment.
Many thanks to @lioman for the hard work on (and patience with) this endeavor. Much appreciated! 👏
Pull Request Checklist
Resolves: #3203
This solves the issue by using pdm as a build tool to resolve dependencies and adding
pyproject.tomlwith PEP621 compliant configuration.Todo
pyproject.toml