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 test requirements and pytest command #317

Merged
merged 1 commit into from
Apr 26, 2022

Conversation

woutdenolf
Copy link
Contributor

This might be too specific so let me know if you have suggestions on how to generalize it.

I have several packages that supports this for testing

pip install ewokscore[test]
pytest --pyargs ewokscore

This PR adds a CLI option

grayskull pypi ewokscore --extras-require-test test

It then looks for "test" in extras_require to add requirements to the test section of the recipe.

In addition if "pytest" is in the test requirements it adds the command pytest --pyargs {name} to the test commands.

@marcelotrevisani
Copy link
Member

Cool! Sorry for my delay I have beeing quite buse in the past weeks.
It looks good to me the general idea, I'm onboard with that. Just a few things that would be nice to add in this PR if you don't mind. Can you add a test for it please? it would be really cool if you add it to cover this new feature.
There is one failing test, I added two suggestions to the PR that will cover those cases, if you add any of them should be fine, the second one adding a new exception might be better as your current implementation you are using the try except block
but I am happy with either implementation :)

@woutdenolf
Copy link
Contributor Author

When adding the test I realized it is cleaner to add the new feature to Configuration instead of CLIConfig.

@woutdenolf
Copy link
Contributor Author

Sorry I didn't notice this project was using black. I'll fix that,

@marcelotrevisani
Copy link
Member

there is just one failing test that need to be fixed, after that it should be good to go

@marcelotrevisani marcelotrevisani merged commit b7953ea into conda:main Apr 26, 2022
@marcelotrevisani
Copy link
Member

Cool! Thanks for your contribution! I will cut a new release after that

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