Skip to content

Commit 1b46347

Browse files
committed
Add --uploaded-prior-to to the user guide
1 parent 3e599c1 commit 1b46347

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

docs/html/user_guide.rst

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,61 @@ e.g. http://example.com/constraints.txt, so that your organization can store and
257257
serve them in a centralized place.
258258

259259

260+
.. _`Filtering by Upload Time`:
261+
262+
263+
Filtering by Upload Time
264+
=========================
265+
266+
The ``--uploaded-prior-to`` option allows you to filter packages by their upload time
267+
to an index, only considering packages that were uploaded before a specified datetime.
268+
This can be useful for creating reproducible builds by ensuring you only install
269+
packages that were available at a known point in time.
270+
271+
.. tab:: Unix/macOS
272+
273+
.. code-block:: shell
274+
275+
python -m pip install --uploaded-prior-to=2025-03-16T00:00:00Z SomePackage
276+
277+
.. tab:: Windows
278+
279+
.. code-block:: shell
280+
281+
py -m pip install --uploaded-prior-to=2025-03-16T00:00:00Z SomePackage
282+
283+
The option accepts ISO 8601 datetime strings in several formats:
284+
285+
* ``2025-03-16`` - Date in local timezone
286+
* ``2025-03-16 12:30:00`` - Datetime in local timezone
287+
* ``2025-03-16T12:30:00Z`` - Datetime in UTC
288+
* ``2025-03-16T12:30:00+05:00`` - Datetime in UTC offset
289+
290+
For consistency across machines, use either UTC format (with 'Z' suffix) or UTC offset
291+
format (with timezone offset like '+05:00'). Local timezone formats may produce different
292+
results on different machines.
293+
294+
.. note::
295+
296+
This option only works with package indexes that provide upload-time metadata
297+
(such as PyPI). When upload-time information is not available, packages are not
298+
filtered and installation continues normally.
299+
300+
You can combine this option with other filtering mechanisms like constraints files:
301+
302+
.. tab:: Unix/macOS
303+
304+
.. code-block:: shell
305+
306+
python -m pip install -c constraints.txt --uploaded-prior-to=2025-03-16 SomePackage
307+
308+
.. tab:: Windows
309+
310+
.. code-block:: shell
311+
312+
py -m pip install -c constraints.txt --uploaded-prior-to=2025-03-16 SomePackage
313+
314+
260315
.. _`Dependency Groups`:
261316

262317

0 commit comments

Comments
 (0)