Skip to content

Serialization hooks (requires pytest 4.4)#426

Merged
nicoddemus merged 2 commits into
pytest-dev:masterfrom
nicoddemus:serialization-hooks
Apr 2, 2019
Merged

Serialization hooks (requires pytest 4.4)#426
nicoddemus merged 2 commits into
pytest-dev:masterfrom
nicoddemus:serialization-hooks

Conversation

@nicoddemus

Copy link
Copy Markdown
Member

Replaces xdist's own serialization code with pytest's 4.4 serialization hooks.

This also means that the next pytest-xdist release will require pytest>=4.4.

@nicoddemus nicoddemus requested a review from blueyed March 26, 2019 23:33
@nicoddemus nicoddemus force-pushed the serialization-hooks branch from f687434 to 955f93d Compare March 26, 2019 23:47
Comment thread appveyor.yml
Comment thread .travis.yml Outdated
Comment thread setup.py Outdated
@nicoddemus nicoddemus force-pushed the serialization-hooks branch from 955f93d to d1a2787 Compare March 28, 2019 16:45
@nicoddemus nicoddemus force-pushed the serialization-hooks branch from 6b257ae to 89d07a5 Compare April 1, 2019 21:37
@nicoddemus nicoddemus changed the title [WIP] Serialization hooks (requires pytest 4.4) Serialization hooks (requires pytest 4.4) Apr 1, 2019
@nicoddemus

Copy link
Copy Markdown
Member Author

Rebased and ready for review. 👍

@nicoddemus

Copy link
Copy Markdown
Member Author

@blueyed would appreciate a Ness review when you get the chance. 👍

@blueyed blueyed left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Too bad there is no coverage report..

Comment thread changelog/426.feature.rst Outdated
Comment thread changelog/426.feature.rst Outdated
Comment thread changelog/426.feature.rst Outdated
Co-Authored-By: nicoddemus <nicoddemus@gmail.com>
@nicoddemus

Copy link
Copy Markdown
Member Author

Thanks!

@nicoddemus nicoddemus merged commit 04c0265 into pytest-dev:master Apr 2, 2019
@nicoddemus nicoddemus deleted the serialization-hooks branch April 2, 2019 23:09
@alexanderscott

alexanderscott commented Apr 4, 2019

Copy link
Copy Markdown

@nicoddemus could this be published as RC instead of latest release? at least until the required pytest version is stable? requiring pytest>=4.4 in a minor release version of this pytest plugin and publishing it doesn't seem very sensible when 4.4 is still experimental and the change will likely break a lot of things which don't have this package pinned

@nicoddemus

Copy link
Copy Markdown
Member Author

Hi @alexanderscott,

at least until the required pytest version is stable? requiring pytest>=4.4 in a minor release version of this pytest plugin and publishing it doesn't seem very sensible when 4.4 is still experimental and the change will likely break a lot of things which don't have this package pinned

Why do you say 4.4 is still experimental? It is a normal pytest release. What is experimental are the hooks, in the sense that users should use it with caution because we reserve the right to change them later or even remove them completely. Other than that, the hook implementations have been moved quite literally from xdist to the core, so they should be as stable as before, no change there.

About pinning, pytest-xdist 1.28 requires pytest 4.4, so if a user is pinning pytest to 4.3.1 (for example), only pytest-xdist 1.27 should get installed as it is the only version compatible with the pin.

Are you having problems or just a general concern? I appreciate the concern btw.

@alexanderscott

Copy link
Copy Markdown

thanks for the quick reply @nicoddemus . was able to fix my problem but was concerned others may experience similar

About pinning, pytest-xdist 1.28 requires pytest 4.4, so if a user is pinning pytest to 4.3.1 (for example), only pytest-xdist 1.27 should get installed as it is the only version compatible with the pin.

This logic makes sense but isn't what I experienced for some reason. Had several different versions of pytest pinned to microservices (for ex/ 'pytest~= 4.0.0') without pinning pytest-xdist, expecting a compatible version would be sensibly installed. However, builds started failing today with pluggy.manager.PluginValidationError: Plugin 'xdist' could not be loaded: (pytest 4.0.2 (/mnt/jenkins/workspace/tox-phab-pipe/src/.tox/py27-django16/lib/python2.7/site-packages), Requirement.parse('pytest>=4.4.0'))! . Pinning 1.27 fixed the dependency issue.

Might just be an issue specific to my setup (in which case please ignore), but this dependency mismatch hasn't occurred for me before with xdist or any other pytest plugins I have configured previously.

@nicoddemus

Copy link
Copy Markdown
Member Author

Hi @alexanderscott,

Thanks for the description.

Hmm the problem is probably pip's dependency solver, which is long standing issue: pypa/pip#988.

Unfortunately our hands are tied for two reasons: if the dependency solver is not doing it's job correctly, then it wouldn't matter in which version we released this change, it would still not honor the version restrictions even if we released pytest-xdist as 2.0.0 or RC. 😞 The other reason is that we can't really change the release once it is out, the best we can do is make another release pulling back this change, but I fear this might even add more confusion to the mix.

Let's see if more people manifest this problem.

Again, thanks for reaching out, it is important to have this kind of dialog to ensure our expectations are on the same page. 👍

@alexanderscott

Copy link
Copy Markdown

No problem, and thanks for the info and your thorough reply @nicoddemus . Keep up the good work!

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.

3 participants