Comments (14)
The absence of a py2 wheel will just cause the source tarball to be downloaded, no? and then it will fail later on; the key metadata is the python-requires field.
from mock.
Seems like a duplicate of #478. Mock 4.0.0 is python 3.6+ only and drops support for python 2.7.
from mock.
Mock is no longer compatible with Python 2.
Please see the documentation and the release metadata.
I'd suggest upgrading your installation tools so that they respect the metadata in pypi, and get off Python 2 as soon as possible.
from mock.
Totally understand that you are dropping Python 2. However, the 4.0.0 wheel package is published for mock-py2.py3-none-any.whl
. I think you should publish that for py3
only. Again, going forward with py3
only, totally understandable. But by publishing v4 like this you also cause a lot of unnecessary breakage... Can you reconsider this ticket please? I'd suggest unpublishing 4.0.0 for py2/py3, and then republishing as 4.0.1 for py3 only.
from mock.
Yep, that's fair.
from mock.
I've pulled the bad .whl's from pypi and #485 should fix things going forwards.
from mock.
https://pypi.org/project/mock/4.0.1/ is now out.
from mock.
Thanks!
from mock.
I would direct my honourable(s) colleague to the release metadata I link to above ;-)
python-requires
is correct, and has been for all releases I've done, but having a universal wheel up there is wrong, and I'm sure some tools would erroneously download it.
If tooling downloads the source tarball and ignores the python-requires
, well, that's on the tool...
from mock.
Well, what I was referring to was the near-exact same discussion on the PR on testtools from earlier in the week :0. In that the py3 tag doesn't declare python3 compatibility for all python3, python-requires has to be consulted to determine which releases are relevant, and similarly py2 tag; and really the universal wheel semantics are about deterministic builds.
But shrug :). Ce la vie, I accept your point about broken tools, and mock has a much larger user base than testtools.
from mock.
This issue broke production-related task in our case. As we are still on py2 and did not pin mock
, after installation it just broke. I guess that pip
should not just find the incompatible version.
Just IMO, but things should not break like this even if support is ended for py2.
from mock.
@sshishov - I removed the problematic wheels a month ago. What problem(s) are you still seeing?
from mock.
@cjw296 on our server I can see this still:
(venv)root@1aaf6a2862c7:/home/user# python -V
Python 2.7.6
(venv)root@1aaf6a2862c7:/home/user# pip -V
pip 1.5.4 from /home/user/venv/local/lib/python2.7/site-packages (python 2.7)
(venv)root@1aaf6a2862c7:/home/user# pip install mock==0
Downloading/unpacking mock==0
Could not find a version that satisfies the requirement mock==0 (from versions: 0.5.0, 0.6.0, 0.6.0, 0.7.0b1, 0.7.0b1, 0.7.0b2, 0.7.0b2, 0.7.0b3, 0.7.0b3, 0.7.0b4, 0.7.0b4, 0.7.0rc1, 0.7.0rc1, 0.7.0, 0.7.0, 0.7.1, 0.7.1, 0.7.2, 0.7.2, 0.8.0, 0.8.0, 1.0b1, 1.0b1, 1.0.0, 1.0.0, 1.0.1, 1.0.1, 1.1.0, 1.1.0, 1.1.1, 1.1.2, 1.1.2, 1.1.3, 1.1.3, 1.1.4, 1.1.4, 1.2.0, 1.2.0, 1.3.0, 1.3.0, 2.0.0, 2.0.0, 3.0.0, 3.0.0, 3.0.1, 3.0.1, 3.0.2, 3.0.2, 3.0.3, 3.0.3, 3.0.4, 3.0.4, 3.0.5, 3.0.5, 4.0.0b1, 4.0.0, 4.0.1)
Cleaning up...
No distributions matching the version for mock==0
As you can see, for python2 versions 4.x.x are available and therefore they are installed in case of not pinned versions.
What can be the reason? Outdated pip
, outdated something else?
UPDATE: after updating pip
version, the package disappeared. Sorry for disturbing.
(venv)root@1aaf6a2862c7:/home/user# pip -V
pip 20.0.2 from /home/user/venv/local/lib/python2.7/site-packages/pip (python 2.7)
(venv)root@1aaf6a2862c7:/home/user# pip install moc
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. A future version of pip will drop support for Python 2.7. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
ERROR: Could not find a version that satisfies the requirement mock==0 (from versions: 0.5.0, 0.6.0, 0.7.0b1, 0.7.0b2, 0.7.0b3, 0.7.0b4, 0.7.0rc1, 0.7.0, 0.7.1, 0.7.2, 0.8.0, 1.0b1, 1.0.0, 1.0.1, 1.1.0, 1.1.1, 1.1.2, 1.1.3, 1.1.4, 1.2.0, 1.3.0, 2.0.0, 3.0.0, 3.0.1, 3.0.2, 3.0.3, 3.0.4, 3.0.5)
ERROR: No matching distribution found for mock==0
from mock.
pip 1.5.4 is really ancient, so yeah, that'll be your problem ;-)
from mock.
Related Issues (20)
- should we mark as deprecated? HOT 3
- Add assert_not_called_with HOT 1
- Version 4.0 release HOT 3
- Syntax Error in 4.0.0 HOT 3
- Mock 4.0.0 "missing X positional argument" on instantiation of objects inherited from mock.MagicMock HOT 7
- Please add contribution guidelines HOT 1
- Should the backports follow upstream releases? instead of alpha/beta/rcs. HOT 3
- egg_info for package mock produced metadata for project name unknown HOT 5
- 4.0.x: 'ValueError: Sentinels must not start with _' and others HOT 7
- Can we get mock supported in python 3.8 HOT 2
- Can no longer patch flask.g HOT 9
- spec_set/autospec/spec seems to not be reading attributes defined in class body HOT 2
- mock throws ValueError when spec_arg is an ndarray HOT 4
- Question on release 4.0.3 HOT 2
- Test test_bool_not_called_when_passing_spec_arg() fails (mixup unittest.mock vs mock?) HOT 4
- 4.0.3: pytest is failing HOT 5
- AsyncMock stubs for mypy in Python 3.7 HOT 5
- Error when inspecting the signature of AsyncMock() HOT 6
- Unclear error mocking a class and asserting called with HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock.