-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Adopt usedevelop=False for tests running in CI
#3015
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
Changes from all commits
2482510
f03d9ad
533fde2
93a4532
b35e20c
9d8770b
6312cb5
c38d053
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -466,7 +466,7 @@ def test_setup_requires_honors_fetch_params(self, mock_index, monkeypatch): | |
| with contexts.environment(PYTHONPATH=temp_install_dir): | ||
| cmd = [ | ||
| sys.executable, | ||
| '-m', 'setup', | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test seems to rely on the fact that it runs from the project root (that contains a
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow. That test was really janky, relying on Setuptools' own setup.py (with all its distribution setup) just to ignore it and invoke easy_install. Yes, I believe this change is better.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moreover:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am afraid the only way of preventing this from happening would be either adopting a src-layout or using the The problem with the P.S.: The solution proposed by @webknjaz of separating the CI in 2 stages (build, test) and |
||
| '-c', '__import__("setuptools").setup()', | ||
| 'easy_install', | ||
| '--index-url', mock_index.url, | ||
| '--exclude-scripts', | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -10,10 +10,14 @@ deps = | |
| # Ideally all the dependencies should be set as "extras" | ||
| commands = | ||
| pytest {posargs} | ||
| usedevelop = True | ||
| usedevelop = | ||
| native: False | ||
| !native: True | ||
| extras = testing | ||
| passenv = | ||
| SETUPTOOLS_USE_DISTUTILS | ||
| PY_IGNORE_IMPORTMISMATCH | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Wow, I haven't heard of this thing. Is it documented anywhere?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 😅 digging issues: pytest-dev/pytest#2042
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, looks like my google-fu let me down, thanks for this link! |
||
| PYTEST_ADDOPTS | ||
| windir # required for test_pkg_resources | ||
| # honor git config in pytest-perf | ||
| HOME | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @kloczek, there is a problem with pytest that might be causing the problems you are seeing:
pytest-dev/pytest#2042
This seems to be related to the contents of your log.
I think you can try PY_IGNORE_IMPORTMISMATCH=1 as an env var to see how it goes.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested. Result with
pytest6.2.5 is exactly the same.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The logs seem very different for me 😄, looks like you are making progress!
Can you confirm that you are using the exact same flags used in setuptools own
tox.inifile and /or.github/workflows/main.yml?Can you also confirm that you are running pytest from a directory with all the configuration files present in the repository (
pyproject.toml,pytest.ini,setup.cfg,conftest.py)?