diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2019-11-01 17:37:12 -0700 |
|---|---|---|
| committer | Carlton Gibson <carlton.gibson@noumenal.es> | 2019-11-05 15:05:37 +0100 |
| commit | 4325239e2df70054716e8211dd0749dfdc1f2550 (patch) | |
| tree | 9c51a810b8bdfdf7700eec2b774b2faf5a567281 /docs | |
| parent | 22466f91dccf440fa8b0aff3610ed51dbb25403b (diff) | |
[2.2.x] Fixed #30944 -- Changed reusable apps docs to use a declarative config.
Backport of 89368ab6e358ebe29a0417d65209182238daa245 from master.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/intro/reusable-apps.txt | 79 |
1 files changed, 40 insertions, 39 deletions
diff --git a/docs/intro/reusable-apps.txt b/docs/intro/reusable-apps.txt index 56e8bb1625..dda315b9ad 100644 --- a/docs/intro/reusable-apps.txt +++ b/docs/intro/reusable-apps.txt @@ -181,50 +181,51 @@ this. For a small app like polls, this process isn't too difficult. license. Just be aware that your licensing choice will affect who is able to use your code. -#. Next we'll create a ``setup.py`` file which provides details about how to - build and install the app. A full explanation of this file is beyond the - scope of this tutorial, but the `setuptools docs - <https://setuptools.readthedocs.io/en/latest/>`_ have a good - explanation. Create a file ``django-polls/setup.py`` with the following - contents: +#. Next we'll create ``setup.cfg`` and ``setup.py`` files which detail how to + build and install the app. A full explanation of these files is beyond the + scope of this tutorial, but the `setuptools documentation + <https://setuptools.readthedocs.io/en/latest/>`_ has a good explanation. + Create the files ``django-polls/setup.cfg`` and ``django-polls/setup.py`` + with the following contents: - .. code-block:: python - :caption: django-polls/setup.py + .. code-block:: ini + :caption: django-polls/setup.cfg - import os - from setuptools import find_packages, setup + [metadata] + name = django-polls + version = 0.1 + description = A Django app to conduct Web-based polls. + long_description = file: README.rst + url = https://www.example.com/ + author = Your Name + author_email = yourname@example.com + license = BSD-3-Clause # Example license + classifiers = + Environment :: Web Environment + Framework :: Django + Framework :: Django :: X.Y # Replace "X.Y" as appropriate + Intended Audience :: Developers + License :: OSI Approved :: BSD License + Operating System :: OS Independent + Programming Language :: Python + Programming Language :: Python :: 3 + Programming Language :: Python :: 3 :: Only + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Topic :: Internet :: WWW/HTTP + Topic :: Internet :: WWW/HTTP :: Dynamic Content - with open(os.path.join(os.path.dirname(__file__), 'README.rst')) as readme: - README = readme.read() + [options] + include_package_data = true + packages = find: + + .. code-block:: python + :caption: django-polls/setup.py - # allow setup.py to be run from any path - os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir))) + from setuptools import setup - setup( - name='django-polls', - version='0.1', - packages=find_packages(), - include_package_data=True, - license='BSD License', # example license - description='A simple Django app to conduct Web-based polls.', - long_description=README, - url='https://www.example.com/', - author='Your Name', - author_email='yourname@example.com', - classifiers=[ - 'Environment :: Web Environment', - 'Framework :: Django', - 'Framework :: Django :: X.Y', # replace "X.Y" as appropriate - 'Intended Audience :: Developers', - 'License :: OSI Approved :: BSD License', # example license - 'Operating System :: OS Independent', - 'Programming Language :: Python', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', - 'Topic :: Internet :: WWW/HTTP', - 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', - ], - ) + setup() #. Only Python modules and packages are included in the package by default. To include additional files, we'll need to create a ``MANIFEST.in`` file. The |
