Skip to content

Conversation

@dd
Copy link

@dd dd commented Apr 5, 2025

Updated the Python parser:

  • now supports dynamic fields (version and description);
  • if version is dynamic — it tries to resolve it using hatch, flit, pdm, or setuptools_scm;
  • if description is dynamic — it reads it from the README;

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 toml in place for other parsers — though maybe it’s worth replacing it everywhere eventually.

Also, for dynamic version fields in pyproject.toml, I opted to run an external command to retrieve the version, depending on the build backend. For example: hatch version for Hatch, flit info for 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.toml setups.

@dd
Copy link
Author

dd commented Apr 5, 2025

Hmm, smol-toml, is only available starting from Node.js 18...
How much of a problem would that be? Node 12 does seem quite outdated at this point.

@frinyvonnick
Copy link
Owner

Hi @dd 👋 Thank you for your contribution 🙇

Hmm, smol-toml, is only available starting from Node.js 18... How much of a problem would that be? Node 12 does seem quite outdated at this point.

Maybe you can start by upgrading to Node.js LTS version?

@dd
Copy link
Author

dd commented Apr 10, 2025

Alright, I’ll try to update Node.js, hopefully sometime around the weekend!

@dd
Copy link
Author

dd commented Apr 22, 2025

@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! 😊

@frinyvonnick
Copy link
Owner

Thank you @dd 🙇 I'll do the review as soon as possible 👍

@frinyvonnick
Copy link
Owner

@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 😄

@dd
Copy link
Author

dd commented Apr 28, 2025

@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...

@frinyvonnick
Copy link
Owner

@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?

@frinyvonnick
Copy link
Owner

Aside from my comments about the documentation and the unused dependency it looks good to me 👍

@dd
Copy link
Author

dd commented Aug 10, 2025

@frinyvonnick

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.
In the new PR, there’s no dependency on any particular package manager - instead, you can use the --version-command option to specify a command that returns the project version. This is more flexible and, I believe, the better approach.

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!

@dd dd closed this Aug 10, 2025
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.

2 participants