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

ignore package pytest config #246

Merged
merged 1 commit into from
Jan 20, 2022
Merged

Conversation

minrk
Copy link
Contributor

@minrk minrk commented Jan 20, 2022

Ignore pytest config from pyproject.toml, etc.to avoid conflicts with target package's own pytest config, since we aren't running the package's own tests.

For example, jupyter-server has addopts = --doctest-modules, but check-links now has -p no:doctest, which removes the --doctest-modules option, causing check-links to fail on jupyter-server with:

pytest: error: unrecognized arguments: --doctest-modules

avoids conflicts with base package test config,
since we aren't running the package's tests.

For example, jupyter-server has `addopts = --doctest-modules`, but check-links has `-p no:doctest`,
which removes the `--doctest-modules` option.
@welcome
Copy link

welcome bot commented Jan 20, 2022

Thanks for submitting your first pull request! You are awesome! 🤗

If you haven't done so already, check out Jupyter's Code of Conduct. Also, please make sure you followed the pull request template, as this will help us review your contribution more quickly.
welcome
You can meet the other Jovyans by joining our Discourse forum. There is also a intro thread there where you can stop by and say Hi! 👋

Welcome to the Jupyter community! 🎉

@@ -54,6 +54,9 @@ def check_links(ignore_glob, ignore_links, cache_file, links_expire):
cmd += f"--check-links-cache-name {cache_dir}/check-release-links "
# do not run doctests, since they might depend on other state.
cmd += "-p no:doctest "
# ignore package pytest configuration,
# since we aren't running their tests
cmd += "-c _IGNORE_CONFIG"
Copy link
Contributor Author

@minrk minrk Jan 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a special value for pytest; pytest has no option I could find to skip loading config files, so this is a filename that probably won't exist, so no config will be found.

It could also be done to put the check-links pytest config in a config file in this package, and use that to override the package's config.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think since the config is dynamic we should write out a temporary config file, echo it for debugging, and then use it during each run. This is a reasonable workaround for now, thanks!

@minrk minrk added the enhancement New feature or request label Jan 20, 2022
@blink1073 blink1073 merged commit d84497a into jupyter-server:main Jan 20, 2022
@welcome
Copy link

welcome bot commented Jan 20, 2022

Congrats on your first merged pull request in this project! 🎉
congrats
Thank you for contributing, we are very proud of you! ❤️

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

Successfully merging this pull request may close these issues.

2 participants