Skip to content

Commit a8d3f77

Browse files
Merge branch 'master' of https://github.com/pypa/warehouse into rename-color-variables
2 parents d10e95f + 16b0d22 commit a8d3f77

File tree

11 files changed

+69
-16
lines changed

11 files changed

+69
-16
lines changed

docs/api-reference/legacy.rst

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,7 @@ The Simple API implements the HTML-based package index API as specified in `PEP
1414

1515
.. http:get:: /simple/
1616
17-
All of the projects that have been registered. All responses *MUST* have
18-
a ``<meta name="api-version" value="2" />`` tag where the only valid
19-
value is ``2``.
17+
All of the projects that have been registered.
2018

2119
**Example request**:
2220

@@ -38,7 +36,6 @@ The Simple API implements the HTML-based package index API as specified in `PEP
3836
<html>
3937
<head>
4038
<title>Simple Index</title>
41-
<meta name="api-version" value="2" />
4239
</head>
4340
<body>
4441
<!-- More projects... -->
@@ -55,10 +52,8 @@ The Simple API implements the HTML-based package index API as specified in `PEP
5552
.. http:get:: /simple/<project>/
5653
5754
Get all of the URLS for the ``project``. The project is matched case
58-
insensitively with the ``_`` and ``-`` characters considered equal. All
59-
responses *MUST* have a ``<meta name="api-version" value="2" />`` tag where
60-
the only valid value is ``2``. The URLs returned by this API are classified
61-
by their ``rel`` attribute.
55+
insensitively with the ``_`` and ``-`` characters considered equal. The URLs
56+
returned by this API are classified by their ``rel`` attribute.
6257

6358
============ =============================================================
6459
rel name value
@@ -105,7 +100,6 @@ The Simple API implements the HTML-based package index API as specified in `PEP
105100
<html>
106101
<head>
107102
<title>Links for warehouse</title>
108-
<meta name="api-version" value="2" />
109103
</head>
110104
<body>
111105
<h1>Links for warehouse</h1>

warehouse/static/images/testing.png

2.33 KB
Loading

warehouse/static/sass/blocks/_author-profile.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858

5959
&__info {
6060
padding-top: $spacing-unit;
61+
margin-bottom: $spacing-unit;
6162
}
6263

6364
&__name {

warehouse/static/sass/blocks/_site-header.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,15 @@
1818
<header class="site-header">
1919
<a class="site-header__logo"></a>
2020
</header>
21+
22+
Modifiers:
23+
- test-pypi: Adds a 'testing' image in the bg for test PyPI
2124
*/
2225

2326
.site-header {
2427
background-color: $header-background-color;
28+
background-repeat: repeat;
29+
background-position: 0 50%;
2530
border-bottom: 1px solid $header-border-color;
2631

2732
&__logo {
@@ -33,4 +38,8 @@
3338
max-width: 50px;
3439
}
3540
}
41+
42+
&--test-pypi {
43+
background-image: url("../images/testing.png");
44+
}
3645
}

warehouse/templates/accounts/login.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,15 @@
1616
{% block title %}Log In{% endblock %}
1717

1818
{% block content %}
19+
{% if testPyPI %}
20+
{% set title = "TestPyPI" %}
21+
{% else %}
22+
{% set title = "PyPI" %}
23+
{% endif %}
24+
1925
<section class="horizontal-section">
2026
<div class="site-container">
21-
<h1 class="page-title">Log In to PyPI</h1>
27+
<h1 class="page-title">Log In to {{ title }}</h1>
2228

2329
<form method="POST" action="{{ request.current_route_path() }}">
2430
<input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">

warehouse/templates/accounts/profile.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ <h1 class="author-profile__name">{{ user.name }}</h1>
3535
{% csi request.route_path("includes.edit-profile-button", username=user.username) %}
3636
{% endcsi %}
3737
</div>
38+
39+
<div class="sidebar-section">
40+
<h3 class="sidebar-section__title">Statistics</h3>
41+
<p>View statistics for your projects via <a href="https://libraries.io/">Libraries.io</a>, or by using <a href="https://packaging.python.org/guides/analyzing-pypi-package-downloads/">Google BigQuery</a>.</p>
42+
</div>
3843
</div>
3944
</div>
4045

warehouse/templates/accounts/register.html

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,15 @@
1717
{% block title %}Register{% endblock %}
1818

1919
{% block content %}
20+
{% if testPyPI %}
21+
{% set title = "TestPyPI" %}
22+
{% else %}
23+
{% set title = "PyPI" %}
24+
{% endif %}
25+
2026
<section class="horizontal-section">
2127
<div class="site-container">
22-
<h1 class="page-title">Create an account on PyPI</h1>
28+
<h1 class="page-title">Create an account on {{ title }}</h1>
2329

2430
<form method="POST" action="{{ request.current_route_path() }}" data-controller="password password-match">
2531
<input name="csrf_token" type="hidden" value="{{ request.session.get_csrf_token() }}">

warehouse/templates/base.html

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@
4242
<meta name="defaultLanguage" content="en">
4343
<meta name="availableLanguages" content="en">
4444

45-
<title>{% block title_base %}{% block title %}{% endblock %}{% if self.title() %} · {% endif %}{{ request.registry.settings['site.name'] }}{% endblock %}</title>
45+
{% if request.registry.settings.get("warehouse.domain") == "test.pypi.org" %}
46+
{% set testPyPI = true %}
47+
{% endif %}
48+
49+
<title>{% if testPyPI %}Test{% endif %}{% block title_base %}{% block title %}{% endblock %}{% if self.title() %} · {% endif %}{{ request.registry.settings['site.name'] }}{% endblock %}</title>
4650
<meta name="description" content="{% block description %}The Python Package Index (PyPI) is a repository of software for the Python programming language.{% endblock %}">
4751

4852
<link rel="stylesheet" href="{{ request.static_path('warehouse:static/dist/css/warehouse.css') }}">
@@ -88,6 +92,7 @@
8892

8993
<body>
9094
{% block body %}
95+
9196
<a href="#content" class="skip-to-content">Skip to main content</a>
9297

9398
<section class="stick-to-top js-stick-to-top">
@@ -102,6 +107,15 @@
102107
<span class="notification-bar__message">You are using an unsupported browser, please upgrade to a newer version.</span>
103108
</div>
104109
<![endif]-->
110+
{% if testPyPI %}
111+
<div class="notification-bar notification-bar--warning">
112+
<span class="notification-bar__icon">
113+
<i class="fa fa-exclamation-triangle" aria-hidden="true"></i>
114+
<span class="sr-only">Warning:</span>
115+
</span>
116+
<span class="notification-bar__message">You are using testPyPI - a separate instance of the Python Package Index that allows you to try distribution tools and processes without affecting the real index.</span>
117+
</div>
118+
{% endif %}
105119
</section>
106120

107121
{% block flash_messages %}
@@ -119,7 +133,7 @@
119133
<span class="notification-bar__message">Help us improve Python packaging - <a href="https://donate.pypi.org">Donate today!</a></span>
120134
</div>
121135

122-
<header class="site-header">
136+
<header class="site-header {% if testPyPI %}site-header--test-pypi{% endif %}">
123137
<div class="site-container">
124138
<div class="split-layout">
125139
{% block brand %}

warehouse/templates/index.html

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,14 +34,19 @@ <h3 class="package-snippet__title">
3434
</div>
3535
{% endblock %}
3636

37-
3837
{% block mobile_search %}{% endblock %}
3938

40-
4139
{% block content %}
40+
41+
{% if testPyPI %}
42+
{% set banner = "Test Python package publishing with the Test Python Package Index" %}
43+
{% else %}
44+
{% set banner = "Find, install and publish Python packages with the Python Package Index" %}
45+
{% endif %}
46+
4247
<section class="banner">
4348
<div class="homepage-banner">
44-
<h1 class="homepage-banner__title">Find, install and publish Python packages with the Python Package Index</h1>
49+
<h1 class="homepage-banner__title">{{ banner }}</h1>
4550

4651
<form class="search-form search-form--large search-form--fullwidth" action="{{ request.route_path('search') }}">
4752
<label for="search" class="sr-only">Search PyPI</label>

warehouse/templates/packaging/detail.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ <h3 class="sidebar-section__title">Maintainers</h3>
193193
{% endfor %}
194194
</div>
195195

196+
<div class="sidebar-section">
197+
<h3 class="sidebar-section__title">Statistics</h3>
198+
<p>View statistics for this project via <a href="https://libraries.io/pypi/{{ release.project.name }}">Libraries.io</a>, or by using <a href="https://packaging.python.org/guides/analyzing-pypi-package-downloads/">Google BigQuery</a>.</p>
199+
</div>
200+
196201
{% if release.classifiers %}
197202
<div class="sidebar-section classifiers">
198203
<h3>Classifiers</h3>

warehouse/templates/pages/help.html

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
{% macro availability() %}Can I depend on PyPI being available?{% endmacro %}
4444
{% macro beta() %}What does beta mean?{% endmacro %}
4545
{% macro contributing() %}How can I contribute to PyPI?{% endmacro %}
46+
{% macro upcoming_changes() %}How do I keep up with upcoming changes to PyPI?{% endmacro %}
4647
{% block title %}Help{% endblock %}
4748

4849
{% block content %}
@@ -94,6 +95,7 @@ <h2><a href="#about">About</a></h2>
9495
<li><a href="#availability">{{ availability() }}</a></li>
9596
<li><a href="#beta">{{ beta() }}</a></li>
9697
<li><a href="#contributing">{{ contributing() }}</a></li>
98+
<li><a href="#upcoming-changes">{{ upcoming_changes() }}</a></li>
9799
</ul>
98100
</section>
99101

@@ -333,6 +335,12 @@ <h3 id="contributing">{{ contributing() }}</h3>
333335
<em>Stay updated</em>: You can also follow the ongoing development of the project on the <a href="https://mail.python.org/mailman/listinfo/distutils-sig">Distutils-sig mailing list</a> and the <a href="https://groups.google.com/forum/#!forum/pypa-dev" target="_blank" rel="noopener">PyPA Dev message group</a>.
334336
</p>
335337
{{ code_of_conduct() }}
338+
339+
<h3 id="upcoming-changes">{{ upcoming_changes() }}</h3>
340+
<p>
341+
Changes to PyPI are generally announced on both the <a href="https://mail.python.org/mm3/mailman3/lists/pypi-announce.python.org/" target="_blank" rel="noopener">pypi-announce mailing list</a> and the <a href="https://pyfound.blogspot.com/search/label/pypi" target="_blank" rel="noopener">PSF blog</a> under the label "pypi". The PSF blog also has <a href="https://pyfound.blogspot.com/feeds/posts/default/-/pypi" target="_blank" rel="noopener">Atom</a> and
342+
<a href="https://pyfound.blogspot.com/feeds/posts/default/-/pypi?alt=rss" target="_blank" rel="noopener">RSS</a> feeds for the "pypi" label.
343+
</p>
336344
</section>
337345
</div>
338346
</section>

0 commit comments

Comments
 (0)