From c4fe4abe2c04b438e5a1fb6b606a4994b08bf639 Mon Sep 17 00:00:00 2001
From: Nicole Harris
Date: Wed, 24 Sep 2025 07:11:27 +0100
Subject: [PATCH 1/5] Only show wheel filters if there is more than one wheel
---
warehouse/templates/packaging/detail.html | 38 +++++++++++------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/warehouse/templates/packaging/detail.html b/warehouse/templates/packaging/detail.html
index b29903e561b7..fad2de4babcf 100644
--- a/warehouse/templates/packaging/detail.html
+++ b/warehouse/templates/packaging/detail.html
@@ -441,13 +441,13 @@
data-controller="filter-list">
{% trans %}Download files{% endtrans %}
- {% trans href='https://packaging.python.org/tutorials/installing-packages/', title=gettext('External link') %}Download the file for your platform. If you're not sure which to choose, learn more about installing packages .{% endtrans %}
+ {% trans href='https://packaging.python.org/en/latest/discussions/package-formats/#package-formats', title=gettext('External link') %}For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation .{% endtrans %}
{% trans count=sdists|length %}
- Source Distribution
+ Source distribution (sdist)
{% pluralize %}
- Source Distributions
+ Source distributions (sdists)
{% endtrans %}
{% if sdists %}
@@ -457,30 +457,24 @@
-
+
{% trans %}No source distribution files available for this release.{% endtrans %}
{% trans href='https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives', title=gettext('External link') %}See tutorial on
generating distribution archives .{% endtrans %}
{% endif %}
+
{% if bdists %}
+ {% set bdist_count = bdists|length %}
- {% trans count=bdists|length %}
- Built Distribution
+ {% trans count=bdist_count %}
+ Built distribution (wheel)
{% pluralize %}
- Built Distributions
+ Built distributions (wheels)
{% endtrans %}
-
- {% trans %}Filter files by name, interpreter, ABI, and platform.{% endtrans %}
-
-
- {% trans href='https://packaging.python.org/en/latest/specifications/binary-distribution-format/', title=gettext('External link') %}If you're not sure about the file name format, learn more about wheel file names .{% endtrans %}
-
+ {% if bdist_count > 1 %}
-
- {% trans %}The dropdown lists show the available interpreters, ABIs, and platforms.{% endtrans %}
-
{% trans %}Enable javascript to be able to filter the list of wheel files.{% endtrans %}
@@ -499,9 +493,6 @@
{% trans %}Copy{% endtrans %}
-
Date: Thu, 25 Sep 2025 07:13:45 +0100
Subject: [PATCH 2/5] Update display of search and filters
---
warehouse/static/sass/base/_forms.scss | 4 ++
warehouse/static/sass/blocks/_button.scss | 15 ++++
.../static/sass/blocks/_filter-wheels.scss | 56 +++++++++++++++
warehouse/static/sass/blocks/_form-group.scss | 38 +++++++++-
warehouse/static/sass/warehouse.scss | 1 +
warehouse/templates/packaging/detail.html | 71 ++++++++++---------
6 files changed, 151 insertions(+), 34 deletions(-)
create mode 100644 warehouse/static/sass/blocks/_filter-wheels.scss
diff --git a/warehouse/static/sass/base/_forms.scss b/warehouse/static/sass/base/_forms.scss
index ef0d1fb075b1..5a542619f0dc 100644
--- a/warehouse/static/sass/base/_forms.scss
+++ b/warehouse/static/sass/base/_forms.scss
@@ -48,6 +48,10 @@
}
}
+select {
+ height: 40px;
+}
+
input[type="checkbox"] {
&:focus,
&:hover,
diff --git a/warehouse/static/sass/blocks/_button.scss b/warehouse/static/sass/blocks/_button.scss
index a0d3859a3784..e8bbbc8d7383 100644
--- a/warehouse/static/sass/blocks/_button.scss
+++ b/warehouse/static/sass/blocks/_button.scss
@@ -13,6 +13,7 @@
- primary: Makes button bright blue.
- danger: Makes button red.
- warning: Makes button brown.
+ - link: styles button like a link (removes all padding, border, etc.)
- disabled: Styles for when the button cannot be clicked.
- switch-to-desktop: Switch to desktop button found in site footer.
- switch-to-mobile: Switch to mobile button found in site header.
@@ -126,6 +127,20 @@
}
}
+ &--link {
+ padding: 0;
+ background-color: transparent;
+ border: 0;
+ color: $text-color;
+ display: inline-block;
+
+ &:focus,
+ &:hover,
+ &:active {
+ color: $primary-color;
+ }
+ }
+
&[disabled],
&--disabled {
cursor: not-allowed;
diff --git a/warehouse/static/sass/blocks/_filter-wheels.scss b/warehouse/static/sass/blocks/_filter-wheels.scss
new file mode 100644
index 000000000000..c5eff61cff01
--- /dev/null
+++ b/warehouse/static/sass/blocks/_filter-wheels.scss
@@ -0,0 +1,56 @@
+/* SPDX-License-Identifier: Apache-2.0 */
+
+/*
+ Search and filter wheels
+
+
+
+ Search bar here
+
+
+ Filters here
+
+
+*/
+
+.filter-wheels {
+ display: flex;
+ gap: $spacing-unit / 2;
+ justify-content: space-between;
+
+ @media only screen and (max-width: $tablet) {
+ flex-wrap: wrap;
+ }
+
+ &__search {
+ flex-grow: 1;
+
+ .form-group input {
+ height: 40px;
+ }
+
+ @media only screen and (max-width: $tablet) {
+ width: 100%;
+ }
+ }
+
+ &__filters {
+ flex-shrink: 0;
+ flex: 0 1 auto;
+ display: flex;
+ gap: $spacing-unit / 3;
+ align-items: flex-end;
+
+ div {
+ flex: 0 1 auto;
+ }
+
+ @media only screen and (max-width: $tablet) {
+ width: 100%;
+ }
+
+ @media only screen and (max-width: $small-tablet) {
+ display: block;
+ }
+ }
+}
diff --git a/warehouse/static/sass/blocks/_form-group.scss b/warehouse/static/sass/blocks/_form-group.scss
index c7334e82ec9f..d3bfbc76dd56 100644
--- a/warehouse/static/sass/blocks/_form-group.scss
+++ b/warehouse/static/sass/blocks/_form-group.scss
@@ -12,6 +12,10 @@
When a field is not editable, you can use me instead
Some help text here
+
+
+ Modifiers:
+ - flex-width: makes fields inside the group flexible width (instead of 350px wide)
*/
.form-group {
@@ -20,7 +24,7 @@
&__label {
display: block;
- font-weight: bold;
+ font-weight: 600;
}
&__label:not(:first-child) {
@@ -109,6 +113,38 @@
}
}
+ &--flex-width {
+ max-width: unset;
+ :where(
+ input:not([type]),
+ select,
+ textarea,
+ [type="color"],
+ [type="date"],
+ [type="datetime"],
+ [type="datetime-local"],
+ [type="email"],
+ [type="month"],
+ [type="month"],
+ [type="number"],
+ [type="password"],
+ [type="search"],
+ [type="tel"],
+ [type="text"],
+ [type="time"],
+ [type="url"],
+ [type="week"]
+ ).form-group__field,
+ select.form-group__field {
+ width: 100%;
+ max-width: 100%;
+ }
+
+ select.form-group__field {
+ padding-right: $spacing-unit;
+ }
+ }
+
// Specific cases for input validation using `pattern` attribute
/* stylelint-disable-next-line selector-id-pattern -- Form sets name */
diff --git a/warehouse/static/sass/warehouse.scss b/warehouse/static/sass/warehouse.scss
index 32119d746687..f0d9433f38fc 100644
--- a/warehouse/static/sass/warehouse.scss
+++ b/warehouse/static/sass/warehouse.scss
@@ -95,6 +95,7 @@
@import "blocks/project-description";
/*rtl:end:ignore*/
@import "blocks/files";
+@import "blocks/filter-wheels";
@import "blocks/radio-toggle-form";
@import "blocks/release";
@import "blocks/release-timeline";
diff --git a/warehouse/templates/packaging/detail.html b/warehouse/templates/packaging/detail.html
index fad2de4babcf..457e653bc6ed 100644
--- a/warehouse/templates/packaging/detail.html
+++ b/warehouse/templates/packaging/detail.html
@@ -458,7 +458,7 @@
- {% trans %}No source distribution files available for this release.{% endtrans %}
+ {% trans %}No source distribution files available for this release.{% endtrans %}
{% trans href='https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives', title=gettext('External link') %}See tutorial on
generating distribution archives .{% endtrans %}
@@ -479,40 +479,45 @@
{% trans %}Enable javascript to be able to filter the list of wheel files.{% endtrans %}
-
- {% trans %}Copy a direct link to the current filters {% endtrans %}
-
-
+
+
+ {% trans %}Search{% endtrans %}
+
+
+
+
+
{% endif %}
From 70d8f8376e04f8d01265aeaa7629870713b70743 Mon Sep 17 00:00:00 2001
From: Nicole Harris
Date: Sat, 27 Sep 2025 07:43:52 +0100
Subject: [PATCH 3/5] Display files in table
---
warehouse/static/sass/blocks/_table.scss | 19 ++-
.../templates/manage/project/release.html | 2 +-
warehouse/templates/packaging/detail.html | 140 ++++++++++++++----
3 files changed, 131 insertions(+), 30 deletions(-)
diff --git a/warehouse/static/sass/blocks/_table.scss b/warehouse/static/sass/blocks/_table.scss
index de5e4947ceb7..2143ff269c70 100644
--- a/warehouse/static/sass/blocks/_table.scss
+++ b/warehouse/static/sass/blocks/_table.scss
@@ -30,8 +30,9 @@
Modifiers:
- downloads: specific styles for downloads table on project detail page
+ - files: specific styles for files table on project detail page
- releases: specific styles for releases table on manage project page
- - files: specific styles for files table on releases tab
+ - manage-files: specific styles for files table on the releases tab
- history: specific styles for project journals
- hashes: specific styles for the hashes table on an individual file
- collaborators: specific styles for managing a project's collaborators
@@ -58,6 +59,7 @@
tbody tr td:last-child {
display: block;
width: 100%;
+ max-width: 100%;
text-align: left;
border-bottom: 0;
padding: 2px 0;
@@ -175,6 +177,19 @@
}
}
+ &--files {
+ margin-bottom: $half-spacing-unit;
+
+ td.file-name {
+ word-wrap: break-word;
+ max-width: 250px;
+ }
+
+ @media only screen and (max-width: $desktop) {
+ @include mobile-friendly-table;
+ }
+ }
+
&--releases {
word-wrap: break-word;
margin-bottom: $spacing-unit;
@@ -185,7 +200,7 @@
}
}
- &--files,
+ &--manage-files,
&--history {
margin-top: $half-spacing-unit;
diff --git a/warehouse/templates/manage/project/release.html b/warehouse/templates/manage/project/release.html
index 6f3277ed9997..ec37bfbf1c0e 100644
--- a/warehouse/templates/manage/project/release.html
+++ b/warehouse/templates/manage/project/release.html
@@ -32,7 +32,7 @@
{% if files %}
-
+
{% trans version=release.version, project_name=project.name %}Files for release {{ version }} of {{ project_name }}{% endtrans %}
diff --git a/warehouse/templates/packaging/detail.html b/warehouse/templates/packaging/detail.html
index 457e653bc6ed..65ae6880d2d9 100644
--- a/warehouse/templates/packaging/detail.html
+++ b/warehouse/templates/packaging/detail.html
@@ -70,28 +70,117 @@
pip install{{ index_url }} {{ release.project.name }}{{ project_version }}
{%- endif -%}
{%- endmacro -%}
-{%- macro file_table(files) -%}
+
+{%- macro sdists_table(files) -%}
+
+ {% trans name=release.project.name, release=release.version %}Source distribution for {{ name }} {{ version }}{% endtrans %}
+
+ {% trans %}File{% endtrans %}
+ {% trans %}Size{% endtrans %}
+ {% trans %}Type{% endtrans %}
+ {% trans %}Details{% endtrans %}
+
{% for file in files %}
-
-
-
-
-
+
+
+ {% trans %}File{% endtrans %}
+
{{ file.filename }}
- ({{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}
+
+ {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}
+
+
+ {% trans %}Size{% endtrans %}
+ {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}
+
+
+ {% trans %}Type{% endtrans %}
+ {% trans %}Source{% endtrans %}
+
+
+ {% trans %}View details{% endtrans %}
{%- trans -%}view details{%- endtrans -%} )
-
- Uploaded {{ humanize(file.upload_time) }}
- {% for tag in file.pretty_wheel_tags %}{{ tag }}
{% endfor %}
-
+ data-project-tabs-target="tab"
+ data-action="project-tabs#onTabClick">
+ {% trans %}Details{% endtrans %}
+
+
+
+ {% endfor %}
+
+{%- endmacro -%}
+
+{%- macro bdists_table(files) -%}
+
+ {% trans name=release.project.name, release=release.version %}Table of built distributions (wheels) for {{ name }} {{ release }}{% endtrans %}
+
+ {% trans %}File{% endtrans %}
+ {% trans %}Size{% endtrans %}
+ {% trans %}Interpreter{% endtrans %}
+ {% trans %}ABI{% endtrans %}
+ {% trans %}Platform{% endtrans %}
+ {% trans %}Details{% endtrans %}
+
+ {% for file in files %}
+
+
+ {% trans %}File{% endtrans %}
+
+ {{ file.filename }}
+
+ {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}
+
+
+ {% trans %}Size{% endtrans %}
+ {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}
+
+
+ {% trans %}Interpreter{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'interpreters' %}
+ {% for interpreter in value %}
+ {{ interpreter }}
+ {% endfor %}
+ {% endif %}
+ {% endfor %}
+
+
+ {% trans %}ABI{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'abis' %}
+ {% for interpreter in value %}
+ {{ interpreter }}
+ {% endfor %}
+ {% endif %}
+ {% endfor %}
+
+
+ {% trans %}Platform{% endtrans %}
+ {% for key, value in file.wheel_filters.items() %}
+ {% if key == 'platforms' %}
+ {% for interpreter in value %}
+ {{ interpreter }}
+ {% endfor %}
+ {% endif %}
+ {% endfor %}
+
+
+ {% trans %}View details{% endtrans %}
+
+ {% trans %}Details{% endtrans %}
+
+
-
+
{% endfor %}
+
{%- endmacro -%}
+
{% macro filter_select(name, title, selected) %}
{% trans %}{{ title }}{% endtrans %}
{% endfor %}
{% endmacro %}
+
{% block title %}{{ release.project.name }}{% endblock %}
{% block description %}{{ release.summary }}{% endblock %}
{% block additional_rss -%}
@@ -451,16 +541,12 @@
{% endtrans %}
{% if sdists %}
- {{ file_table(sdists) }}
+ {{ sdists_table(sdists) }}
{% else %}
-
-
-
-
-
- {% trans %}No source distribution files available for this release.{% endtrans %}
- {% trans href='https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives', title=gettext('External link') %}See tutorial on
generating distribution archives .{% endtrans %}
-
+
+
+ {% trans %}No source distribution files available for this release.{% endtrans %}
+ {% trans href='https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives', title=gettext('External link') %}See tutorial on
generating distribution archives .{% endtrans %}
{% endif %}
@@ -499,7 +585,7 @@
{% endif %}
- {{ file_table(bdists) }}
+ {{ bdists_table(bdists) }}
{% if bdist_count > 1 %}
From 1b989d4769a6d4d34a73aad6c937b62614c8f8e4 Mon Sep 17 00:00:00 2001
From: Nicole Harris
Date: Mon, 29 Sep 2025 06:28:48 +0100
Subject: [PATCH 4/5] Show filters if more than 3 files are present
---
warehouse/templates/packaging/detail.html | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/warehouse/templates/packaging/detail.html b/warehouse/templates/packaging/detail.html
index 65ae6880d2d9..08bdee893859 100644
--- a/warehouse/templates/packaging/detail.html
+++ b/warehouse/templates/packaging/detail.html
@@ -559,7 +559,7 @@
Built distributions (wheels)
{% endtrans %}
- {% if bdist_count > 1 %}
+ {% if bdist_count > 3 %}
{% trans %}Enable javascript to be able to filter the list of wheel files.{% endtrans %}
@@ -610,7 +610,7 @@
{{ bdists_table(bdists) }}
- {% if bdist_count > 1 %}
+ {% if bdist_count > 3 %}
From a13f39b2c5130548b3678f9348a52fdf8dbc4d09 Mon Sep 17 00:00:00 2001
From: Nicole Harris
Date: Mon, 29 Sep 2025 06:36:29 +0100
Subject: [PATCH 5/5] Adjust table columns to create more room for longer tag
names
---
warehouse/templates/packaging/detail.html | 31 ++++++++++++-----------
1 file changed, 16 insertions(+), 15 deletions(-)
diff --git a/warehouse/templates/packaging/detail.html b/warehouse/templates/packaging/detail.html
index 08bdee893859..240cf36a7324 100644
--- a/warehouse/templates/packaging/detail.html
+++ b/warehouse/templates/packaging/detail.html
@@ -76,6 +76,7 @@
{% trans name=release.project.name, release=release.version %}Source distribution for {{ name }} {{ version }}{% endtrans %}
{% trans %}File{% endtrans %}
+ {% trans %}Uploaded{% endtrans %}
{% trans %}Size{% endtrans %}
{% trans %}Type{% endtrans %}
{% trans %}Details{% endtrans %}
@@ -86,8 +87,10 @@
{% trans %}File{% endtrans %}
{{ file.filename }}
-
- {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}
+
+
+ {% trans %}Uploaded{% endtrans %}
+ {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}
{% trans %}Size{% endtrans %}
@@ -95,7 +98,7 @@
{% trans %}Type{% endtrans %}
- {% trans %}Source{% endtrans %}
+ {% trans %}Source{% endtrans %}
{% trans %}View details{% endtrans %}
@@ -115,7 +118,6 @@
{% trans name=release.project.name, release=release.version %}Table of built distributions (wheels) for {{ name }} {{ release }}{% endtrans %}
{% trans %}File{% endtrans %}
- {% trans %}Size{% endtrans %}
{% trans %}Interpreter{% endtrans %}
{% trans %}ABI{% endtrans %}
{% trans %}Platform{% endtrans %}
@@ -131,18 +133,17 @@
{{ file.filename }}
- {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}
-
-
- {% trans %}Size{% endtrans %}
- {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}
+
+ {{ file.size|filesizeformat() if file.size else 0|filesizeformat() }}.
+ {% trans upload_time=humanize(file.upload_time) %}Uploaded {{ upload_time }}{% endtrans %}.
+
{% trans %}Interpreter{% endtrans %}
{% for key, value in file.wheel_filters.items() %}
{% if key == 'interpreters' %}
{% for interpreter in value %}
- {{ interpreter }}
+ {{ interpreter }}
{% endfor %}
{% endif %}
{% endfor %}
@@ -151,18 +152,18 @@
{% trans %}ABI{% endtrans %}
{% for key, value in file.wheel_filters.items() %}
{% if key == 'abis' %}
- {% for interpreter in value %}
- {{ interpreter }}
+ {% for abi in value %}
+ {{ abi }}
{% endfor %}
- {% endif %}
+ {% endif %}
{% endfor %}
{% trans %}Platform{% endtrans %}
{% for key, value in file.wheel_filters.items() %}
{% if key == 'platforms' %}
- {% for interpreter in value %}
- {{ interpreter }}
+ {% for platform in value %}
+ {{ platform }}
{% endfor %}
{% endif %}
{% endfor %}