Closed kaheicanaan closed 2 years ago
It is affected by the pytest-asyncio
in [packages] section. It should also be moved into dev-packages
@kaheicanaan as a side note, the idea behind the Pipfile and Pipfile.lock split is that you don't have to specify the exact dependency version in Pipfile (like in your example), instead you can specify any (good choice for Pytest or mock) or specify which "generation" of a package is required (major, maybe major .minor).
PS. Please disregard my comment if you only specified exact versions in Pipfile only to demonstrate what the issue is.
@kaheicanaan I just did a sanity check of this issue using pipenv==2021.11.23
. I think @frostming above has the right idea, when pytest-asyncio
is in the [packages]
section, it takes precedence and calls out a newer version of pytest which gets installed as the packages section. It seems package dependencies are first class, rendered separately from the dev dependencies when appear to be applied second and will not overwrite requirements already set by the graph in the packages.
It does says in the docs As with other commands, passing --dev will include both the default and development dependencies
https://pipenv.pypa.io/en/latest/advanced/#generating-a-requirements-txt
Closing this issue for now, since it seems intentional or by design that dev-packages are treated secondarily to packages.
Be sure to check the existing issues (both open and closed!), and make sure you are running the latest version of Pipenv.
Check the diagnose documentation for common issues before posting! We may close your issue if it is very similar to one of them. Please be considerate, or be on your way.
Make sure to mention your debugging experience if the documented solution failed.
Issue description
Incorrect version is installed when I move some packages from [packages] to [dev-packages].
Environment:
Expected result
Expect
pytest==4.2.1
.Actual result
pytest==6.2.1
Steps to replicate
pipenv install -dev
with followingPipfile
[packages] msgpack = "==0.6.1" pyzmq = "==18.0.1" aiomysql = "==0.0.20" pendulum = "==1.2.0" voluptuous = "==0.11.7" tornado = "==6.0.3" mock = "==3.0.5" pytest-asyncio = "==0.10.0"
[dev-packages] pytest = "==4.2.1" pytest-mock = "==1.11.1"
[requires] python_version = "3.7"
[[source]] url = "https://pypi.org/simple" verify_ssl = true name = "pypi"
[packages] msgpack = "==0.6.1" pyzmq = "==18.0.1" aiomysql = "==0.0.20" pendulum = "==1.2.0" voluptuous = "==0.11.7" tornado = "==6.0.3" mock = "==3.0.5" pytest-asyncio = "==0.10.0" pytest = "==4.2.1" pytest-mock = "==1.11.1"
[requires] python_version = "3.7"
{'implementation_name': 'cpython', 'implementation_version': '3.9.1', 'os_name': 'posix', 'platform_machine': 'x86_64', 'platform_python_implementation': 'CPython', 'platform_release': '20.2.0', 'platform_system': 'Darwin', 'platform_version': 'Darwin Kernel Version 20.2.0: Wed Dec 2 20:39:59 PST ' '2020; root:xnu-7195.60.75~1/RELEASE_X86_64', 'python_full_version': '3.9.1', 'python_version': '3.9', 'sys_platform': 'darwin'}
Contents of
Pipfile.lock
('/Users/kaheing/Repositories/temperature_alert_service/Pipfile.lock'):