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

Add support for doctest.el #97

Closed
suhail-singh opened this issue Jan 14, 2024 · 16 comments
Closed

Add support for doctest.el #97

suhail-singh opened this issue Jan 14, 2024 · 16 comments
Labels
enhancement New feature or request

Comments

@suhail-singh
Copy link

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
Copy link
Collaborator

doublep commented Jan 14, 2024

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
Copy link
Author

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
Copy link
Collaborator

doublep commented Jan 15, 2024

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
Copy link
Author

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
Copy link
Collaborator

doublep commented Feb 14, 2024

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
Copy link
Author

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
Copy link
Collaborator

doublep commented Feb 15, 2024

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
Copy link
Author

It still would be nice to have some external example.

See the shx package.

@doublep
Copy link
Collaborator

doublep commented Feb 16, 2024

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
Copy link
Author

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

@doublep
Copy link
Collaborator

doublep commented Mar 4, 2024

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
Copy link
Author

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
Copy link

ag91 commented Mar 4, 2024

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 doublep added the enhancement New feature or request label Mar 5, 2024
@doublep
Copy link
Collaborator

doublep commented Mar 6, 2024

@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
Copy link

ag91 commented Mar 6, 2024

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
Copy link
Collaborator

doublep commented May 2, 2024

Done in Eldev 1.10.

@doublep doublep closed this as completed May 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants