Skip to content

Commit cefe4c2

Browse files
authored
Merge branch 'main' into ai-docs-rewrite
2 parents f996fd6 + 149a003 commit cefe4c2

36 files changed

+845
-313
lines changed

.github/workflows/pypi_upload.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ on:
66
tags:
77
- v[0-9]+.[0-9]+.* # add .* to allow dev releases
88

9-
permissions: {}
9+
permissions:
10+
id-token: write # Required for trusted publishing
11+
contents: write # Required for release creation
1012
jobs:
1113
deploy:
12-
permissions:
13-
contents: write # to create a release (actions/create-release)
1414

1515
name: pipenv PyPI Upload
1616
runs-on: ubuntu-latest
@@ -48,11 +48,20 @@ jobs:
4848
run: |
4949
python -m pipenv run python -m build
5050
51-
# to upload to test pypi, pass repository_url: https://test.pypi.org/legacy/ and use secrets.TEST_PYPI_TOKEN
51+
# Publish to PyPI using token authentication
52+
# Note: To use Trusted Publishers in the future, you need to set up a publisher on PyPI:
53+
# Visit: https://pypi.org/manage/project/pipenv/settings/publishing/
54+
# And add a publisher with:
55+
# - Provider: GitHub
56+
# - Owner: pypa
57+
# - Repository: pipenv
58+
# - Workflow filename: pypi_upload.yml
5259
- name: Publish a Python distribution to PyPI
5360
uses: pypa/gh-action-pypi-publish@release/v1
5461
with:
5562
user: __token__
5663
password: ${{ secrets.PYPI_TOKEN }}
57-
# repository_url: https://test.pypi.org/legacy/
5864
packages-dir: dist/
65+
verbose: true
66+
# Uncomment the following line to publish to Test PyPI instead
67+
# repository-url: https://test.pypi.org/legacy/

CHANGELOG.md

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,118 @@
1+
2025.0.1 (2025-05-02)
2+
=====================
3+
2025.0.2 2025.0.1 (2025-05-02)
4+
==============================
5+
6+
7+
Bug Fixes
8+
---------
9+
10+
- Cleanup unused dependencies when upgrading packages. `#6386 <https://github.com/pypa/pipenv/issues/6386>`_
11+
- Fix for ``UnboundLocalError`` in ``ensure_python`` when ``SESSION_IS_INTERACTIVE=False``, using pyenv, and python version in Pipfile not available. `#6389 <https://github.com/pypa/pipenv/issues/6389>`_
12+
13+
14+
2025.0.1 (2025-04-24)
15+
=====================
16+
Pipenv 2025.0.1 (2025-04-24)
17+
============================
18+
19+
20+
Bug Fixes
21+
---------
22+
23+
- Fix for broken import requirements in ``2025.0.0`` `#6385 <https://github.com/pypa/pipenv/issues/6385>`_
24+
25+
26+
27+
2025.0.0 (2025-04-24)
28+
=====================
29+
Pipenv 2025.0.0 (2025-04-24)
30+
============================
31+
32+
33+
Features & Improvements
34+
-----------------------
35+
36+
- # Refactor pythonfinder for improved efficiency and PEP 514 support
37+
38+
## Summary
39+
This PR completely refactors the pythonfinder module to improve efficiency, reduce logical errors, and fix support for PEP 514 (Python registration in the Windows registry). The refactoring replaces the complex object hierarchy with a more modular, composition-based approach that is easier to maintain and extend.
40+
41+
## Motivation
42+
The original pythonfinder implementation had several issues:
43+
* Complex object wrapping with paths as objects, leading to excessive recursion
44+
* Tight coupling between classes making the code difficult to follow and maintain
45+
* Broken Windows registry support (PEP 514)
46+
* Performance issues due to redundant path scanning and inefficient caching
47+
48+
## Changes
49+
* **Architecture**: Replaced inheritance-heavy design with a composition-based approach using specialized finders
50+
* **Data Model**: Simplified the data model with a clean ``PythonInfo`` dataclass
51+
* **Windows Support**: Implemented proper PEP 514 support for Windows registry
52+
* **Performance**: Improved caching and reduced redundant operations
53+
* **Error Handling**: Added more specific exceptions and better error handling
54+
55+
## Features
56+
The refactored implementation continues to support all required features:
57+
* System and user PATH searches
58+
* pyenv installations
59+
* asdf installations
60+
* Windows registry (PEP 514) - now working correctly `#6360 <https://github.com/pypa/pipenv/issues/6360>`_
61+
- Almost finished with conversion off click echo/secho to rich console outputs. `#6366 <https://github.com/pypa/pipenv/issues/6366>`_
62+
- Make safety an optional dependency via extras
63+
64+
- Removed vendored safety package from pipenv/patched
65+
- Added safety as an optional dependency via pipenv[safety]
66+
- Modified check.py to prompt for safety installation if not present
67+
- Safety installation will not modify user's Pipfile or lockfile `#safety-extras <https://github.com/pypa/pipenv/issues/safety-extras>`_
68+
69+
Bug Fixes
70+
---------
71+
72+
- Fix launching PowerShell on UNC paths `#6322 <https://github.com/pypa/pipenv/issues/6322>`_
73+
- Check if we need to upgrade a package in more than one category. `#6361 <https://github.com/pypa/pipenv/issues/6361>`_
74+
- Fix issue with default constraints not applying to other package categories. `#6364 <https://github.com/pypa/pipenv/issues/6364>`_
75+
- Fix for parsing and using the star specifier in install and update/upgrade commands. `#6378 <https://github.com/pypa/pipenv/issues/6378>`_
76+
- Fixed KeyError when installing packages with invalid Python version specifiers in their metadata. `#6380 <https://github.com/pypa/pipenv/issues/6380>`_
77+
- Fixed an issue with installing local packages that have spaces in their path names. `#6381 <https://github.com/pypa/pipenv/issues/6381>`_
78+
- # Improved virtualenv scripts path resolution
79+
80+
## Summary
81+
82+
This PR refactors the logic for determining virtual environment script paths
83+
by leveraging ``sysconfig``'s built-in mechanisms. By removing
84+
platform-dependent logic, ``pipenv`` now offers enhanced compatibility with
85+
POSIX-like environments, including Cygwin and MinGW. The fix also mitigates
86+
execution inconsistencies in non-native Windows environments, improving
87+
portability across platforms.
88+
89+
## Motivation
90+
91+
The original logic for determining the scripts path was unable to handle the
92+
deviations of MSYS2 MinGW CPython identifying as ``nt`` platform, yet using a
93+
POSIX ``{base}/bin`` path, instead of ``{base}/Scripts``.
94+
95+
## Changes
96+
97+
Removed custom logic for determining virtualenv scripts path in favor of
98+
retrieving the basename of the path string returned by
99+
``sysconfig.get_path('scripts')```. `#6737 <https://github.com/pypa/pipenv/issues/6737>`_
100+
- Update ``check`` command to support the new ``scan`` functionality
101+
---------------------------------------------------------------
102+
103+
The ``check`` command has been deprecated and will be unsupported beyond June 1, 2025.
104+
Instead of adding a separate ``scan`` command, we've updated the ``check`` command to include a ``--scan`` option.
105+
106+
Key changes:
107+
- Added a ``--scan`` option to the ``check`` command to use the new scan functionality
108+
- Added a deprecation warning explaining that in future versions, ``check`` will run the scan command by default
109+
- Better temporary file handling using the ``tempfile`` module to ensure proper cleanup
110+
- More robust error handling
111+
112+
Users are encouraged to start using the ``--scan`` option with the ``check`` command to prepare for the future change.
113+
This option requires users to obtain and configure an API key from https://pyup.io. `#safety-command <https://github.com/pypa/pipenv/issues/safety-command>`_
114+
115+
1116
2024.4.0 (2025-01-22)
2117
=====================
3118
Pipenv 2024.4.0 (2025-01-22)
@@ -16,9 +131,9 @@ Vendored Libraries
16131
------------------
17132

18133
- Remove click.echo from exceptions.py `#6216 <https://github.com/pypa/pipenv/issues/6216>`_
19-
2024.2.0 (2024-11-05)
134+
2024.4.0 (2024-11-05)
20135
=====================
21-
Pipenv 2024.2.0 (2024-11-05)
136+
Pipenv 2024.4.0 (2024-11-05)
22137
============================
23138

24139

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ sphinx-click = "==4.*"
1010
sphinxcontrib-spelling = "==7.*"
1111
click = "==8.0.3"
1212
stdeb = {version="*", sys_platform = "== 'linux'"}
13-
zipp = {version = "==3.6.0", markers = "python_version < '3.10'"}
1413
pre-commit = "==2.*"
1514
atomicwrites = {version = "*", sys_platform = "== 'win32'"}
1615
pytest-cov = "==4.*"
@@ -29,6 +28,7 @@ build = "*"
2928
twine = "*"
3029
semver = "*"
3130
pypiserver = "2.3.2"
31+
zipp = "==3.21.0"
3232

3333
[packages]
3434
pytz = "*"

Pipfile.lock

Lines changed: 6 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ Checks for security vulnerabilities and PEP 508 marker compliance.
263263
```bash
264264
pipenv check [OPTIONS]
265265
```
266+
**Note**: The check command is deprecated and will be unsupported beyond 01 June 2025. In future versions, the check command will run the scan command by default. Use the `--scan` option to run the new scan command now.
266267

267268
#### Options
268269

docs/commands.md

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -304,32 +304,10 @@ $ pipenv check --output json
304304
| `--use-installed` | Use installed packages instead of lockfile |
305305
| `--categories` | Check packages in specified categories |
306306
| `--auto-install` | Automatically install safety if not already installed |
307-
| `--scan` | Use the new scan command instead |
307+
| `--scan` | Enable the newer version of the check command with improved functionality. |
308308

309309
**Note**: The check command is deprecated and will be unsupported beyond June 1, 2024. Use the `scan` command instead.
310310

311-
## scan
312-
313-
The `scan` command is the newer version of `check` with improved functionality for scanning security vulnerabilities.
314-
315-
### Basic Usage
316-
317-
```bash
318-
$ pipenv scan
319-
```
320-
321-
### Examples
322-
323-
Scan with a specific output format:
324-
325-
```bash
326-
$ pipenv scan --output json
327-
```
328-
329-
### Options
330-
331-
Similar to the `check` command, with enhanced functionality.
332-
333311
## run
334312

335313
The `run` command executes a command within the context of the virtual environment.
@@ -394,6 +372,7 @@ The `graph` command displays a dependency graph of your installed packages.
394372
$ pipenv graph
395373
```
396374

375+
397376
### Examples
398377

399378
Show a dependency graph with reverse dependencies:

docs/requirements.txt

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
1-
click==8.0.3
2-
imagesize==1.4.1
3-
Jinja2==3.1.4
4-
MarkupSafe==2.1.2
5-
myst-parser[linkify]==4.0.0
1+
click>=8.1.7
2+
imagesize>=1.4.1
3+
Jinja2>=3.1.4
4+
MarkupSafe>=2.1.5
5+
myst-parser[linkify]>=4.0.0
66
-e .
7-
pytz==2022.7.1
7+
pytz>=2024.1
88
requests>=2.32.0
9-
snowballstemmer==2.2.0
10-
Sphinx==8.1.3
11-
sphinx-click==6.0.0
12-
sphinxcontrib-spelling==8.0.0
13-
sphinxcontrib-websupport==2.0.0
14-
urllib3>=1.26.18
15-
virtualenv>=20.20.0
16-
virtualenv-clone==0.5.7
9+
snowballstemmer>=2.2.0
10+
Sphinx>=8.1.3
11+
sphinx-click>=6.0.0
12+
sphinxcontrib-spelling>=8.0.0
13+
sphinxcontrib-websupport>=2.0.0
14+
urllib3>=2.2.1
15+
virtualenv>=20.25.0
16+
virtualenv-clone>=0.5.7
17+
certifi>=2024.2.2
18+
idna>=3.6

examples/Pipfile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
[[source]]
2-
url = "https://pypi.python.org/simple"
2+
url = "https://pypi.org/simple"
33
verify_ssl = true
44
name = "pypi"
55

66
[packages]
7-
requests = "*"
8-
7+
requests = ">=2.32.0"
8+
urllib3 = ">=2.2.1"
9+
certifi = ">=2024.2.2"
10+
idna = ">=3.6"
11+
charset-normalizer = ">=3.3.2"
912

1013
[dev-packages]
11-
pytest = "*"
14+
pytest = ">=7.4.0"
15+
16+
[requires]
17+
python_version = "3.11"

0 commit comments

Comments
 (0)