Skip to content
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

Use in a hatch plugin #109

Open
damonlynch opened this issue Mar 21, 2024 · 3 comments
Open

Use in a hatch plugin #109

damonlynch opened this issue Mar 21, 2024 · 3 comments

Comments

@damonlynch
Copy link

Hello Pavel, warm greetings from New Zealand. Thank you for writing argparse-manpage!

Did you have any thoughts or preferences about making your project work with Hatch? My initial assumption is that it would work best as a build hook plugin, such that the plugin calls argparse-manpage as a commandline application, without knowing anything about its internals. Would you agree?

I have recently released my first Hatch plugin, hatch-gettext. I'm keen to get your project working seamlessly with hatch so I can use it with a project of mine that I recently switched to hatch.

@damonlynch
Copy link
Author

My initial plugin implementation is here.

If you have any comments please let me know. As of now, I have not made a release. However, the code works well enough.

If you would like the Hatch plugin to be part of this project, I'm fine with that. However, I don't know how argparse-manpage could exist on Pypi as a package as it exists currently, and at the same time be available as a Hatch plugin. That might be simply because of my limited understanding of the complexities of Python packages, of course — maybe I'm just confused. So for now, hatch-argparse-manpage is a standalone package, with all the limitations that brings.

@praiskup
Copy link
Owner

Thank you for the report! And sorry for the late reply.

Did you have any thoughts or preferences about making your project work with Hatch?

This is almost the first time I hear about Hatch, to be honest.

My initial assumption is that it would work best as a build hook plugin, such that the plugin calls argparse-manpage as a commandline application, without knowing anything about its internals. Would you agree?

I don't disagree :) sounds good, but /shrug, I'm not able to help with the design.

If you would like the Hatch plugin to be part of this project, I'm fine with that. However, I don't know how argparse-manpage could exist on Pypi as a package as it exists currently, and at the same time be available as a Hatch plugin.

Not sure either. Up to you. It would be nice if the argparse->manpage formatting logic stayed here, so we do not duplicate the efforts. And, if you think it's better to move here - and you want to experiment, feel free to open PR.

Otherwise, congrats on the first hatch plugin; I'm going to monitor what is happening there :)

@damonlynch
Copy link
Author

I made the initial 1.0.0 release late last month.

hatch-argparse-manpage calls argparse-manpage using one of two mechanisms: directly, as a Python object (preferred approach), or indirectly, via a command line call.

To call directly unfortunately I had to write my own code to parse the config specified in the user's pyproject.toml. I simply could not call the logic you already have in argparse-manpage without making changes unique to hatch plug-in requirements. This is a weakness, of course, because if your implementation changes, then so must my code.

See in particular here and here.

If breaking changes are made in future releases of argparse-manpage, I am going to rely on the release version number to differentiate between versions. I am assuming Linux distros will not be applying patches without changing that version number, which I hope is a safe assumption!

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

No branches or pull requests

2 participants