diff options
author | Saniya Maheshwari <saniya.mah@gmail.com> | 2022-05-31 16:44:16 +0530 |
---|---|---|
committer | Saniya Maheshwari <saniya.mah@gmail.com> | 2022-05-31 16:44:16 +0530 |
commit | f0e4c8fd3d9b404d31c35a052ac08579f87c1714 (patch) | |
tree | b72ba0fb5c242088e97736c41201333983c4b0f4 /docs | |
parent | bb9e256b19dede3984ddb71416a4023832aec34d (diff) | |
download | python-setuptools-git-f0e4c8fd3d9b404d31c35a052ac08579f87c1714.tar.gz |
Added `packages`, `package_dir` and `where` options in all examples
For consistency.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/userguide/datafiles.rst | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/docs/userguide/datafiles.rst b/docs/userguide/datafiles.rst index 81210dd5..462b860b 100644 --- a/docs/userguide/datafiles.rst +++ b/docs/userguide/datafiles.rst @@ -30,15 +30,23 @@ and you supply this configuration: [options] # ... + packages = find: + package_dir = + = src include_package_data = True + [options.packages.find] + where = src + .. tab:: setup.py .. code-block:: python - from setuptools import setup + from setuptools import setup, find_packages setup( # ..., + packages=find_packages(where="src"), + package_dir={"": "src"}, include_package_data=True ) @@ -52,6 +60,9 @@ and you supply this configuration: # NOT have to specify this line. include-package-data = true + [tool.setuptools.packages.find] + where = ["src"] + then all the ``.txt`` and ``.rst`` files will be automatically installed with your package, provided: @@ -87,7 +98,15 @@ data files: .. code-block:: ini + [options] # ... + packages = find: + package_dir = + = src + + [options.packages.find] + where = src + [options.package_data] mypkg = *.txt @@ -97,9 +116,11 @@ data files: .. code-block:: python - from setuptools import setup + from setuptools import setup, find_packages setup( # ..., + packages=find_packages(where="src"), + package_dir={"": "src"}, package_data={"mypkg": ["*.txt", "*.rst"]} ) @@ -107,7 +128,9 @@ data files: .. code-block:: toml - # ... + [tool.setuptools.packages.find] + where = ["src"] + [tool.setuptools.package_data] mypkg = ["*.txt", "*.rst"] @@ -292,6 +315,9 @@ included in the installation, then you could use the ``exclude_package_data`` op = src include_package_data = True + [options.packages.find] + where = src + [options.exclude_package_data] mypkg = README.txt |