Merge branch 'main' into named-categories

This commit is contained in:
Matt Davis
2022-10-05 23:30:54 -04:00
12 changed files with 153 additions and 28 deletions
+18
View File
@@ -1,3 +1,21 @@
2022.10.4 (2022-10-04)
======================
Pipenv 2022.10.4 (2022-10-04)
=============================
Bug Fixes
---------
- Use ``--creator=venv`` when creating virtual environments to avoid issue with sysconfig ``posix_prefix`` on some systems. `#5075 <https://github.com/pypa/pipenv/issues/5075>`_
- Prefer to use the lockfile sources if available during the install phase. `#5380 <https://github.com/pypa/pipenv/issues/5380>`_
Vendored Libraries
------------------
- Drop vendored six - we no longer depend on this library, as we migrated from pipfile to plette. `#5187 <https://github.com/pypa/pipenv/issues/5187>`_
2022.9.24 (2022-09-24)
======================
Pipenv 2022.9.24 (2022-09-24)
+70 -21
View File
@@ -247,7 +247,7 @@ Anaconda uses Conda to manage packages. To reuse Condainstalled Python packag
Sometimes, you would want to generate a requirements file based on your current
environment, for example to include tooling that only supports requirements.txt.
You can convert a ``Pipfile`` and ``Pipfile.lock`` into a ``requirements.txt``
You can convert a ``Pipfile.lock`` into a ``requirements.txt``
file very easily.
Let's take this ``Pipfile``::
@@ -255,44 +255,91 @@ Let's take this ``Pipfile``::
[[source]]
url = "https://pypi.python.org/simple"
verify_ssl = true
name = "pypi"
[packages]
requests = {version="*"}
requests = {version="==2.18.4"}
[dev-packages]
pytest = {version="*"}
pytest = {version="==3.2.3"}
And generate a set of requirements out of it with only the default dependencies::
Which generates a ``Pipfile.lock`` upon completion of running ``pipenv lock``` similar to::
{
"_meta": {
"hash": {
"sha256": "4b81df812babd4e54ba5a4086714d7d303c1c3f00d725c76e38dd58cbd360f4e"
},
"pipfile-spec": 6,
"requires": {},
"sources": [
{
"name": "pypi",
"url": "https://pypi.python.org/simple",
"verify_ssl": true
}
]
},
"default": {
... snipped ...
"requests": {
"hashes": [
"sha256:6a1b267aa90cac58ac3a765d067950e7dbbf75b1da07e895d1f594193a40a38b",
"sha256:9c443e7324ba5b85070c4a818ade28bfabedf16ea10206da1132edaa6dda237e"
],
"index": "pypi",
"version": "==2.18.4"
},
... snipped ...
},
"develop": {
... snipped ...
"pytest": {
"hashes": [
"sha256:27fa6617efc2869d3e969a3e75ec060375bfb28831ade8b5cdd68da3a741dc3c",
"sha256:81a25f36a97da3313e1125fce9e7bbbba565bc7fec3c5beb14c262ddab238ac1"
],
"index": "pypi",
"version": "==3.2.3"
}
... snipped ...
}
Given the ``Pipfile.lock`` exists, you may generate a set of requirements out of it with the default dependencies::
$ pipenv requirements
-i https://pypi.org/simple
-i https://pypi.python.org/simple
certifi==2022.9.24 ; python_version >= '3.6'
chardet==3.0.4
requests==2.18.4
certifi==2017.7.27.1
idna==2.6
requests==2.18.4
urllib3==1.22
As with other commands, passing ``--dev`` will include both the default and
development dependencies::
$ pipenv requirements --dev
-i https://pypi.org/simple
chardet==3.0.4
requests==2.18.4
certifi==2017.7.27.1
idna==2.6
urllib3==1.22
py==1.4.34
-i https://pypi.python.org/simple
colorama==0.4.5 ; sys_platform == 'win32'
py==1.11.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
pytest==3.2.3
setuptools==65.4.1 ; python_version >= '3.7'
certifi==2022.9.24 ; python_version >= '3.6'
chardet==3.0.4
idna==2.6
requests==2.18.4
urllib3==1.22
If you wish to generate a requirements file with only the
development requirements you can do that too, using the ``--dev-only``
flag::
$ pipenv requirements --dev-only
-i https://pypi.org/simple
py==1.4.34
-i https://pypi.python.org/simple
colorama==0.4.5 ; sys_platform == 'win32'
py==1.11.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
pytest==3.2.3
setuptools==65.4.1 ; python_version >= '3.7'
Adding the ``--hash`` flag adds package hashes to the output for extra security.
Adding the ``--exclude-markers`` flag excludes the markers from the output.
@@ -303,16 +350,18 @@ used to write them to a file::
$ pipenv requirements > requirements.txt
$ pipenv requirements --dev-only > dev-requirements.txt
$ cat requirements.txt
-i https://pypi.org/simple
-i https://pypi.python.org/simple
certifi==2022.9.24 ; python_version >= '3.6'
chardet==3.0.4
requests==2.18.4
certifi==2017.7.27.1
idna==2.6
requests==2.18.4
urllib3==1.22
$ cat dev-requirements.txt
-i https://pypi.org/simple
py==1.4.34
-i https://pypi.python.org/simple
colorama==0.4.5 ; sys_platform == 'win32'
py==1.11.0 ; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
pytest==3.2.3
setuptools==65.4.1 ; python_version >= '3.7'
☤ Detection of Security Vulnerabilities
---------------------------------------
-1
View File
@@ -1 +0,0 @@
Use ``--creator=venv`` when creating virtual environments to avoid issue with sysconfig ``posix_prefix`` on some systems.
-1
View File
@@ -1 +0,0 @@
Drop vendored six - we no longer depend on this library, as we migrated from pipfile to plette.
+1
View File
@@ -0,0 +1 @@
New pipfiles show python_full_version under [requires] if specified. Previously creating a new pipenv project would only specify in the Pipfile the major and minor version, i.e. "python_version = 3.7". Now if you create a new project with a fully named python version it will record both in the Pipfile. So: "python_version = 3.7" and "python_full_version = 3.7.2"
-1
View File
@@ -1 +0,0 @@
Prefer to use the lockfile sources if available during the install phase.
+1
View File
@@ -0,0 +1 @@
Silence majority of pytest.mark warnings by registering custom marks. Can view a list of custom marks by running ``pipenv run pytest --markers``
+1 -1
View File
@@ -2,4 +2,4 @@
# // ) ) / / // ) ) //___) ) // ) ) || / /
# //___/ / / / //___/ / // // / / || / /
# // / / // ((____ // / / ||/ /
__version__ = "2022.9.25.dev0"
__version__ = "2022.10.5.dev0"
+15 -1
View File
@@ -27,7 +27,7 @@ level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
..
.TH "PIPENV" "1" "Sep 24, 2022" "2022.9.24" "pipenv"
.TH "PIPENV" "1" "Oct 04, 2022" "2022.10.4" "pipenv"
.SH NAME
pipenv \- pipenv Documentation
\fI\%\fP\fI\%\fP\fI\%\fP
@@ -453,6 +453,20 @@ You might want to set \fBexport PIPENV_VENV_IN_PROJECT=1\fP in your .bashrc/.zsh
.sp
Congratulations, you now know how to install and use Python packages! ✨ 🍰 ✨
.SS Release and Version History
.SS 2022.10.4 (2022\-10\-04)
.SS Pipenv 2022.10.4 (2022\-10\-04)
.SS Bug Fixes
.INDENT 0.0
.IP \(bu 2
Use \fB\-\-creator=venv\fP when creating virtual environments to avoid issue with sysconfig \fBposix_prefix\fP on some systems. \fI\%#5075\fP
.IP \(bu 2
Prefer to use the lockfile sources if available during the install phase. \fI\%#5380\fP
.UNINDENT
.SS Vendored Libraries
.INDENT 0.0
.IP \(bu 2
Drop vendored six \- we no longer depend on this library, as we migrated from pipfile to plette. \fI\%#5187\fP
.UNINDENT
.SS 2022.9.24 (2022\-09\-24)
.SS Pipenv 2022.9.24 (2022\-09\-24)
.SS Bug Fixes
+3 -1
View File
@@ -692,8 +692,10 @@ class Project:
else:
required_python = self.which("python")
version = python_version(required_python) or self.s.PIPENV_DEFAULT_PYTHON_VERSION
if version and len(version.split(".")) > 2:
if version:
data["requires"] = {"python_version": ".".join(version.split(".")[:2])}
if python and version and len(version.split(".")) > 2:
data["requires"].update({"python_full_version": version})
self.write_toml(data)
@classmethod
+27
View File
@@ -74,6 +74,33 @@ filterwarnings = [
"ignore::DeprecationWarning",
"ignore::PendingDeprecationWarning",
]
# These are not all the custom markers, but most of the ones with repeat uses
# `pipenv run pytest --markers` will list all markers inlcuding these
markers = [
"install: tests having to do with `pipenv install`",
"needs_internet: integration tests that require internet to pass",
"basic: basic pipenv tests grouping",
"dev: tests having to do with dev and dev packages",
"system: related or interacting with the os",
"utils: grouping of pipenv utility functions",
"cli: test grouping that relate to command line like `pipenv --flag args`",
"requirements: tests that save and alter pip requirements",
"run: tests that run or execute python through pipenv",
"script: grouping of tests that execute scripts",
"keep_outdated: when an activity is supposed to keep something out of date",
"lock: tests that interact with pipenv lock",
"markers: pipenv environment markers",
"vcs: tests integration with pipenv and vertsion control systems",
"project: tests with the project object",
"sync: related to `pipenv sync`",
"rrule: relating to rrules (as in recurring time)",
"tzoffset: timezone offset",
"gettz: tests with gettz (get timezone) from dateutil lib",
"tzstr: timezone string",
"extras",
"extended",
"ext: extra non-categorized tests",
]
[tool.towncrier]
package = "pipenv"
+17 -1
View File
@@ -1,4 +1,4 @@
import os
import os, sys
from pathlib import Path
from tempfile import TemporaryDirectory
@@ -372,6 +372,22 @@ def test_install_creates_pipfile(pipenv_instance_pypi):
c = p.pipenv("install")
assert c.returncode == 0
assert os.path.isfile(p.pipfile_path)
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
assert p.pipfile["requires"] == {'python_version': python_version}
@pytest.mark.basic
@pytest.mark.install
def test_create_pipfile_requires_python_full_version(pipenv_instance_pypi):
with pipenv_instance_pypi(chdir=True) as p:
python_version = str(sys.version_info.major) + "." + str(sys.version_info.minor)
python_full_version = python_version + "." + str(sys.version_info.micro)
c = p.pipenv(f"--python {python_full_version}")
assert c.returncode == 0
assert p.pipfile["requires"] == {
'python_full_version': python_full_version,
'python_version': python_version
}
@pytest.mark.basic