Skip to content

Commit a01b85b

Browse files
authored
Merge branch 'main' into testing_gha_runners
2 parents 61cd4bb + 43a5219 commit a01b85b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+2370
-1483
lines changed

dev/environment

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ WAREHOUSE_ENV=development
55
WAREHOUSE_TOKEN=insecuretoken
66
WAREHOUSE_IP_SALT="insecure himalayan pink salt"
77

8+
USERDOCS_DOMAIN="http://localhost:10000"
9+
810
TERMS_NOTIFICATION_BATCH_SIZE=0
911

1012
AWS_ACCESS_KEY_ID=foo

docs/mkdocs-user-docs.yml

+3
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ edit_uri: blob/main/docs/user/
6161

6262
nav:
6363
- "index.md"
64+
- "Project Management":
65+
- "project-management/storage-limits.md"
66+
- "project-management/yanking.md"
6467
- "Organization Accounts":
6568
- "organization-accounts/index.md"
6669
- "organization-accounts/org-acc-faq.md"
29 KB
Loading
51.6 KB
Loading
55.4 KB
Loading

docs/user/attestations/producing-attestations.md

+3-10
Original file line numberDiff line numberDiff line change
@@ -187,18 +187,11 @@ Before uploading attestations to the index, please:
187187
aud: pypi
188188
script:
189189
# Install dependencies
190-
- apt update && apt install -y jq
191-
- python -m pip install -U twine id
190+
- python -m pip install -U twine
192191

193-
# Retrieve the OIDC token from GitLab CI/CD, and exchange it for a PyPI API token
194-
- oidc_token=$(python -m id pypi)
195-
# Replace "https://pypi.org/*" with "https://test.pypi.org/*" if uploading to TestPyPI
196-
- resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\":\"${oidc_token}\"}")
197-
- api_token=$(jq --raw-output '.token' <<< "${resp}")
198-
199-
# Upload to PyPI authenticating via the newly-minted token, including the generated attestations
192+
# Upload to PyPI using Trusted Publishing, including the generated attestations
200193
# Add "--repository testpypi" if uploading to TestPyPI
201-
- twine upload --verbose --attestations -u __token__ -p "${api_token}" python_pkg/dist/*
194+
- twine upload --attestations python_pkg/dist/*
202195
```
203196

204197
Note how, compared with the [Trusted Publishing workflow][GitLab Trusted Publishing], it has the
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
---
2+
title: Storage Limits
3+
---
4+
5+
PyPI imposes storage limits on the size of individually uploaded files,
6+
as well as the total size of all files in a project.
7+
8+
The current default limits are **100.0 MB** for individual files and **10.0 GB**
9+
for the entire project.
10+
11+
You can see your project's current size and storage limits on
12+
the project settings page (`https://pypi.org/manage/project/YOUR-PROJECT/settings/`):
13+
14+
![](/assets/project-size-and-limits.png)
15+
16+
## File size limits
17+
18+
By default, PyPI limits the size of individual files to **100.0 MB**.
19+
If you attempt to upload a file that exceeds this limit, you'll receive
20+
an error like the following:
21+
22+
```console
23+
Uploading sampleproject-1.2.3.tar.gz
24+
HTTPError: 400 Client Error: File too large. Limit for project 'sampleproject' is 100 MB.
25+
```
26+
27+
### Requesting a file size limit increase
28+
29+
!!! note
30+
31+
Note: All users submitting feedback, reporting issues or contributing to
32+
PyPI are expected to follow the
33+
[PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md).
34+
35+
If you can't upload your project's release to PyPI because you're hitting the
36+
upload file size limit, we can sometimes increase your limit. Make sure you've
37+
uploaded at least one release for the project that's under the limit
38+
(a [developmental release version number](https://packaging.python.org/en/latest/specifications/version-specifiers/#developmental-releases) is fine). Then,
39+
[file an issue](https://github.com/pypi/support/issues/new?assignees=&labels=limit+request&template=limit-request-file.yml&title=File+Limit+Request%3A+PROJECT_NAME+-+000+MB) and tell
40+
us:
41+
42+
- A link to your project on PyPI (or TestPyPI)
43+
- The size of your release, in megabytes
44+
- Which index/indexes you need the increase for (PyPI, TestPyPI, or both)
45+
- A brief description of your project, including the reason for the additional size.
46+
47+
## Project size limits
48+
49+
By default, PyPI limits the total size of all files in a project to **10.0 GB**.
50+
If you attempt to upload a file that would exceed this limit, you'll receive
51+
an error like the following:
52+
53+
```console
54+
Uploading sampleproject-1.2.3.tar.gz
55+
HTTPError: 400 Client Error: Project size too large. Limit for project 'sampleproject' total size is 10 GB.
56+
```
57+
58+
### Freeing up storage on an existing project
59+
60+
!!! important
61+
62+
Deleting and [yanking](./yanking.md) are two different actions. Yanking a release or file
63+
does **not** free up storage space.
64+
65+
!!! warning
66+
67+
Deleting releases and files from your project is permanent and cannot be undone
68+
without administrative intervention.
69+
70+
!!! warning
71+
72+
Deletion can be very disruptive for downstream dependencies of your project,
73+
since it breaks installation for
74+
[pinned versions](https://pip.pypa.io/en/stable/topics/repeatable-installs/).
75+
76+
Before performing a deletion, we **strongly** recommend that you
77+
consider the potential impact on your downstreams.
78+
79+
If you're hitting the project size limit, you can free up storage by removing
80+
old releases or individual files from your project. To do this:
81+
82+
1. Navigate to the release management for your project: `https://pypi.org/manage/project/YOUR-PROJECT/releases/`;
83+
2. Click on `Options` next to the release you wish to delete from;
84+
- If you wish to delete the entire release, click `Delete`;
85+
- If you wish to delete individual files from the release, click `Manage`,
86+
then use each file's `Options` menu to delete it.
87+
88+
### Requesting a project size limit increase
89+
90+
!!! note
91+
92+
Note: All users submitting feedback, reporting issues or contributing to
93+
PyPI are expected to follow the
94+
[PSF Code of Conduct](https://github.com/pypa/.github/blob/main/CODE_OF_CONDUCT.md).
95+
96+
If you can't upload your project's release to PyPI because you're hitting the project size limit,
97+
first [remove any unnecessary releases or individual files](#freeing-up-storage-on-an-existing-project)
98+
to lower your overall project size.
99+
100+
If that is not possible, we can sometimes increase your limit. [File an issue](https://github.com/pypi/support/issues/new?assignees=&labels=limit+request&template=limit-request-project.yml&title=Project+Limit+Request%3A+PROJECT_NAME+-+00+GB) and tell us:
101+
102+
- A link to your project on PyPI (or TestPyPI)
103+
- The total size of your project, in gigabytes
104+
- A brief description of your project, including the reason for the additional size.
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: Yanking
3+
---
4+
5+
!!! note
6+
7+
PyPI currently only supports yanking of *entire releases*, not individual files.
8+
9+
PyPI supports *yanking* as a non-destructive alternative to deletion.
10+
11+
A *yanked release* is a release that is always ignored by an installer, unless it
12+
is the only release that matches a [version specifier] (using either `==` or `===`).
13+
See [PEP 592] for more information.
14+
15+
[version specifier]: https://packaging.python.org/en/latest/specifications/version-specifiers/
16+
17+
[PEP 592]: https://peps.python.org/pep-0592/
18+
19+
## When should I yank a release?
20+
21+
Like deletion, yanking should be done sparingly since it can be disruptive to
22+
downstream users of a package.
23+
24+
Maintainers should consider yanking a release when:
25+
26+
- The release is broken or uninstallable.
27+
- The release violates its own compatibility guarantees. For example, `sampleproject 1.0.1`
28+
might be yanked if it's *unintentionally* incompatible with `sampleproject 1.0.0`.
29+
- The release contains a security vulnerability.
30+
31+
## How do I yank a release?
32+
33+
To yank a release, go to the release management page for your project:
34+
`https://pypi.org/manage/project/YOUR-PROJECT/releases/`.
35+
36+
Click on the `Options` button next to the release you wish to yank, then click `Yank`:
37+
38+
![](/assets/release-options-yank.png)
39+
40+
A modal dialogue will appear, asking you to confirm the yank and provide an
41+
optional reason for yanking:
42+
43+
![](/assets/yank-confirm-modal.png)
44+
45+
The reason, if provided, will be displayed on the release page as well
46+
as in the [index APIs](../api/index-api.md) used by installers.
47+
48+
!!! tip
49+
50+
Providing a reason for yanking is **strongly encouraged**, as it can
51+
help downstream users determine how to respond to the yank.

docs/user/trusted-publishers/using-a-publisher.md

+7-15
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,8 @@ below describe the setup process for each supported Trusted Publisher.
384384
[`id_tokens`](https://docs.gitlab.com/ee/ci/yaml/index.html#id_tokens) is used
385385
to request an OIDC token from GitLab with name `PYPI_ID_TOKEN` and audience
386386
`pypi`.
387-
- This OIDC token is extracted from the CI/CD environment using the
388-
[`id`](https://pypi.org/project/id/) package.
389-
- The OIDC token is then sent to PyPI in exchange for a PyPI API token, which
387+
- Twine is called to upload the package with no token specified.
388+
It sends the OIDC token to PyPI in exchange for a PyPI API token, which
390389
is then used to publish the package using `twine`.
391390

392391
```yaml
@@ -411,16 +410,9 @@ below describe the setup process for each supported Trusted Publisher.
411410
aud: pypi
412411
script:
413412
# Install dependencies
414-
- apt update && apt install -y jq
415-
- python -m pip install -U twine id
416-
417-
# Retrieve the OIDC token from GitLab CI/CD, and exchange it for a PyPI API token
418-
- oidc_token=$(python -m id PYPI)
419-
# Replace "https://pypi.org/*" with "https://test.pypi.org/*" if uploading to TestPyPI
420-
- resp=$(curl -X POST https://pypi.org/_/oidc/mint-token -d "{\"token\":\"${oidc_token}\"}")
421-
- api_token=$(jq --raw-output '.token' <<< "${resp}")
422-
423-
# Upload to PyPI authenticating via the newly-minted token
424-
# Add "--repository testpypi" if uploading to TestPyPI
425-
- twine upload -u __token__ -p "${api_token}" python_pkg/dist/*
413+
- python -m pip install -U twine
414+
415+
# Upload to PyPI, add "--repository testpypi" if uploading to TestPyPI
416+
# With no token specified, twine will use Trusted Publishing
417+
- twine upload python_pkg/dist/*
426418
```

package-lock.json

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements/deploy.txt

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ddtrace==3.0.0 \
2929
--hash=sha256:4e6ec651745aa689ee57f37ecf9f0b6b63888570c48af4e1906f9709dcabf4e2 \
3030
--hash=sha256:516d1e85da12e164df7006247577b4a416077a5188662d0bb80fe84d308e097b \
3131
--hash=sha256:56947f44dfae0f87ef5d47836bad9b54ca95e1c95561e77d2abaa03adde6b5c7 \
32+
--hash=sha256:6312e2790a9dbd8ed95f862ab3a82fba0fddad365067582fe744fac47609931b \
3233
--hash=sha256:6742de5a8101e230c5c602417daaf56711b6cf52e561b121898cc51f273fa2c4 \
3334
--hash=sha256:6a648773f555bc5c07e0793f2d1cb617b7650ddbf34b9f619ec5c9cab68bfd10 \
3435
--hash=sha256:6c43196740abe4e138a67334ba8b08d6faabbf334868f39b5fc8a12293266380 \

0 commit comments

Comments
 (0)