From 80d29ed93d0ee3ea95ea921ae38e59bb86d4f627 Mon Sep 17 00:00:00 2001
From: Patrick Lannigan
Date: Mon, 2 Jan 2017 08:15:40 -0500
Subject: Document use of environment markers in extras_require
---
docs/setuptools.txt | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
(limited to 'docs/setuptools.txt')
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index 2f78b133..94ee09ad 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -769,6 +769,38 @@ so that Package B doesn't have to remove the ``[PDF]`` from its requirement
specifier.
+.. _Platform Specific Dependencies:
+
+
+Declaring platform specific dependencies
+----------------------------------------
+
+Sometimes a project might require a dependency to run on a specific platform.
+This could to a package that back ports a module so that it can be used in
+older python versions. Or it could be a package that is required to run on a
+specific operating system. This will allow a project to work on multiple
+different platforms without installing dependencies that are not required for
+a platform that is installing the project.
+
+For example, here is a project that uses the ``enum`` module and ``pywin32``::
+
+ setup(
+ name="Project",
+ ...
+ extras_require={
+ ':python_version < "3.4"': ["enum34"],
+ ':sys_platform == "win32"': ["pywin32 >= 1.0"]
+ }
+ )
+
+Since the ``enum`` module was added in python 3.4, it should only be installed
+if the python version is earlier. Since ``pywin32`` will only be used on
+windows, it should only be installed when the operating system is Windows.
+Specifying version requirements for the dependencies is supported as normal.
+
+The environmental markers that may be used for testing platform types are
+detailed in PEP 496.
+
Including Data Files
====================
--
cgit v1.2.1
From 78339bc0d77649f47be496879e4a5f768657d229 Mon Sep 17 00:00:00 2001
From: Patrick Lannigan
Date: Mon, 2 Jan 2017 16:40:22 -0500
Subject: Have documentation link to referenced PEP.
---
docs/setuptools.txt | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
(limited to 'docs/setuptools.txt')
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index 94ee09ad..5dd30b13 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -799,7 +799,9 @@ windows, it should only be installed when the operating system is Windows.
Specifying version requirements for the dependencies is supported as normal.
The environmental markers that may be used for testing platform types are
-detailed in PEP 496.
+detailed in `PEP 496`_.
+
+.. _PEP 496: https://www.python.org/dev/peps/pep-0496/
Including Data Files
====================
--
cgit v1.2.1
From 37a48e9a7a5ae5ac770b05b8f1ff52bdceda3cae Mon Sep 17 00:00:00 2001
From: Patrick Lannigan
Date: Mon, 2 Jan 2017 21:21:01 -0500
Subject: Document use of install_requires with corrected PEP
PEP 496 is a draft that was never accepted, so it does not have the
correct information.
---
docs/setuptools.txt | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
(limited to 'docs/setuptools.txt')
diff --git a/docs/setuptools.txt b/docs/setuptools.txt
index 5dd30b13..601628b4 100644
--- a/docs/setuptools.txt
+++ b/docs/setuptools.txt
@@ -787,21 +787,21 @@ For example, here is a project that uses the ``enum`` module and ``pywin32``::
setup(
name="Project",
...
- extras_require={
- ':python_version < "3.4"': ["enum34"],
- ':sys_platform == "win32"': ["pywin32 >= 1.0"]
- }
+ install_requires=[
+ 'enum34;python_version<"3.4"',
+ 'pywin32 >= 1.0;platform_system=="Windows"'
+ ]
)
-Since the ``enum`` module was added in python 3.4, it should only be installed
+Since the ``enum`` module was added in Python 3.4, it should only be installed
if the python version is earlier. Since ``pywin32`` will only be used on
windows, it should only be installed when the operating system is Windows.
Specifying version requirements for the dependencies is supported as normal.
The environmental markers that may be used for testing platform types are
-detailed in `PEP 496`_.
+detailed in `PEP 508`_.
-.. _PEP 496: https://www.python.org/dev/peps/pep-0496/
+.. _PEP 508: https://www.python.org/dev/peps/pep-0508/
Including Data Files
====================
--
cgit v1.2.1