-
-
Notifications
You must be signed in to change notification settings - Fork 49
✨ Support dynamic version and description for Python parser #275
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
Conversation
|
Hmm, smol-toml, is only available starting from Node.js 18... |
|
Hi @dd 👋 Thank you for your contribution 🙇
Maybe you can start by upgrading to Node.js LTS version? |
|
Alright, I’ll try to update Node.js, hopefully sometime around the weekend! |
|
@frinyvonnick I updated the Node.js version to the latest LTS wherever applicable and added a .nvmrc file for local development and Netlify compatibility. Also set the minimum required Node version to 18 in package.json. Hope I didn’t miss anything! 😊 |
|
Thank you @dd 🙇 I'll do the review as soon as possible 👍 |
|
@dd locally everything is fine but the CI does not pass for some reason. Can you give it a look? I enable it to run on this pull request 😄 |
|
@frinyvonnick Yes, it was my mistake — I've fixed it! 😅 Btw, I also updated the tests to include all the latest LTS Node versions. Before, it was using just one version. Not entirely sure how much it mattered though... |
|
@dd can you update the documentation here https://github.com/frinyvonnick/gitmoji-changelog/blob/master/packages/gitmoji-changelog-documentation/README.md to add a paragraph of explanation about what you did in the python section, please? |
|
Aside from my comments about the documentation and the unused dependency it looks good to me 👍 |
|
Hi, sorry for the long reply. I’ve decided to close this PR because the initial approach (adding support for specific Python project managers) turned out to be too narrow. I’ve also updated the documentation and included all relevant changes from this PR. Please check out the new PR when you have a chance. If possible, I’d also appreciate a review of my other PRs:
Thanks! |
Updated the Python parser:
dynamicfields (versionanddescription);versionis dynamic — it tries to resolve it usinghatch,flit,pdm, orsetuptools_scm;descriptionis dynamic — it reads it from theREADME;I added smol-toml because it supports the TOML 1.0.0 spec, unlike the toml package which only supports up to 0.4.0. That said, I kept
tomlin place for other parsers — though maybe it’s worth replacing it everywhere eventually.Also, for dynamic
versionfields inpyproject.toml, I opted to run an external command to retrieve the version, depending on the build backend. For example:hatch versionfor Hatch,flit infofor Flit, etc. I figured it’s simpler and more robust than trying to parse the version manually from the source files.Also added tests for all of that.
The parser is now more in line with PEP 621 and modern
pyproject.tomlsetups.