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

It is recommended to remove pytest-runnner from setup_requires in setup.py #168

Closed
pzdkn opened this issue Sep 14, 2022 · 4 comments
Closed
Assignees
Labels
state:waiting Waiting for response for reporter type:bug type:regression
Milestone

Comments

@pzdkn
Copy link

pzdkn commented Sep 14, 2022

Due to deprecated features, it is recommended to remove pytest-runner from setup_requires in setup.py (source).

pytest-runner depends on deprecated features of setuptools and relies on features that break security mechanisms in pip. For example 'setup_requires' and 'tests_require' bypass pip --require-hashes. See also pypa/setuptools#1684.

It is recommended that you:

Remove 'pytest-runner' from your setup_requires, preferably removing the setup_requires option.
Remove 'pytest' and any other testing requirements from tests_require, preferably removing the

This also causes a long trace of error when running nbstripout as a pre-commit hook. Relevant error line after running pre-commit run -a with the recommended yaml entry:

subprocess.CalledProcessError: Command '['/Users/<user_folder>/.cache/pre-commit/repoid22b5j6/py_env-python3.9/bin/python', '-m', 'pip', '--disable-pip-version-check', 'wheel', '--no-deps', '-w', '/var/folders/ln/kgmmx8kn4g50tg08r0hx91800000gn/T/tmpnm00h86e', '--quiet', 'pytest-runner']' returned non-zero exit status 2.

Removing pytest-runner from setup.py solves the issue.

@kynan
Copy link
Owner

kynan commented Sep 17, 2022

Thanks for reporting this! What's the minimum test case for me to reproduce this?

@kynan kynan added this to the 0.7.0 milestone Sep 17, 2022
@kynan kynan added type:bug state:waiting Waiting for response for reporter type:regression labels Sep 17, 2022
@kynan kynan self-assigned this Sep 17, 2022
@pzdkn
Copy link
Author

pzdkn commented Sep 19, 2022

You could try adding

  - repo: https://github.com/kynan/nbstripout
    rev: 0.6.0
    hooks:
      - id: nbstripout
        additional_dependencies: ["--index-url=https://pypi.org/simple/"]

to .pre-commit-config.yaml and run pre-commit run -a. However, it possibly could also be tied to our infrastructure setup. I think the deprecation warning is already a good reason to change.

@kynan
Copy link
Owner

kynan commented Sep 21, 2022

Unfortunately it's not that easy: pytest-runner is needed to make python setup.py test correctly invoke pytest, which is currently used for CI via GitHub Actions. I first need to figure out how to refactor the CI.

@kynan
Copy link
Owner

kynan commented Sep 24, 2022

Turns out this wasn't too hard after all :) Fixed in master, will be released in 0.6.1

@kynan kynan closed this as completed Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:waiting Waiting for response for reporter type:bug type:regression
Projects
None yet
Development

No branches or pull requests

2 participants