emacs-eldev / eldev

Elisp development tool
https://emacs-eldev.github.io/eldev/
GNU General Public License v3.0
226 stars 17 forks source link

Add support for doctest.el #97

Closed suhail-singh closed 3 months ago

suhail-singh commented 7 months ago

doctest.el brings Python doctest functionality to Elisp.

The original repository hasn't been update in some years and has some issues with non-interactive usage. However, this has been addressed in this fork.

Could support for doctest be added to eldev? The idea would be for eldev to load source files and evaluate doctest in it.

doublep commented 7 months ago

Eldev currently works with tools only if those are standard Emacs packages. There was some request to add support for fetching directly from repositories (#91), but it is not implemented yet. So, a first step would be to make doctest.el available on a package archive, e.g. MELPA.

After that I could look into adding support for it into Eldev.

suhail-singh commented 7 months ago

Understood. Thank you for the prompt response. I'm in discussion with the author of the updated fork. I'll report back after the package is available on MELPA or equivalent.

In the meanwhile, are there any other constraints that a testing library ought to satisfy so it may be integrated with eldev?

doublep commented 7 months ago

Probably no. As far as I understand, this framework doesn't have dedicated test files, but instead runs tests sort-of embedded in the normal source code [documentation]. This is different compared to all other currently supported frameworks (3), but it's up to Eldev to cope with such differences.

Ideally, the framework should have native support for all Eldev-standard options (just run eldev help test to see them: need selectors plus functionality for all the options). The best way is if the framework doesn't try to be monolitic or parse command line itself, but instead lets "upper level" set parameters as it wants. However, even if this is not present, I either implement the options in integration code (if easy enough) or just declare unsupported for given framework.

suhail-singh commented 6 months ago

So, a first step would be to make doctest.el available on a package archive, e.g. MELPA.

Doctest is now on MELPA: https://melpa.org/#/doctest

doublep commented 6 months ago

Thank you. Can you point me to some project that uses doctests? As I understand, source code won't contained (require 'doctest), right?

suhail-singh commented 6 months ago

Can you point me to some project that uses doctests?

The doctest project itself would be the canonical example.

As I understand, source code won't contained (require 'doctest), right?

Yes. This is because doctest would only be a build-time dependency (for the check/test phase).

doublep commented 6 months ago

It still would be nice to have some external example. doctest has the subtle difference that feature doctest is always available for it.

Though I guess I can do without one too.

suhail-singh commented 6 months ago

It still would be nice to have some external example.

See the shx package.

doublep commented 6 months ago

I plan to submit a few improvement PRs against doctest package first, because currently it's fairly difficult to use it in a higher-level tool (e.g. Eldev) at all. So it might take some time.

suhail-singh commented 6 months ago

Appreciate your effort regarding this and thank you for the heads up.

doublep commented 5 months ago

Since you are interested in this package and the current maintainer doesn't seem to be responsive, it might speed things up if you yourself can become a maintainer and can review my PRs. I hope the current maintainer would allow that as it doesn't look like doing anything with the project.

I currently submitted only a trivial oneliner, don't want to do anything until at least that is accepted.

suhail-singh commented 5 months ago

I currently submitted only a trivial oneliner, don't want to do anything until at least that is accepted.

That's understandable.

@ag91 would you be comfortable adding me as a (co-)maintainer to doctest? I'm happy to review (and merge) the current open PRs as well as the upcoming ones that @doublep has planned. Thoughts?

ag91 commented 5 months ago

ah sorry about that, I have a problem going with notifications: I didn't receive an email about those open PRs but I did receive one for your direct mention. I am actively using GitHub, so I don't think I need yet help maintaining the project (but thanks @suhail-singh , I will keep you in mind if things get busy on my side). Please @doublep I am happy to review your next PRs: keep them coming and sorry for the delayed feedbac (I will look into what is going wrong with my github notifications)

doublep commented 5 months ago

@ag91: Understood. Is there any particular reason why issue tracking is disabled in your repository? I have some issues with doctest that I don't immediately know how to fix, so cannot create a PR, yet also have nowhere to report...

ag91 commented 5 months ago

it seems that by default forking a repo disables issues: fixed that. I didn't notice because this was the first time I had to take charge of a repo that wasn't mine originally.

doublep commented 3 months ago

Done in Eldev 1.10.