Эх сурвалжийг харах

Update documentation for protobuf_distutils Python package.

This updates README.md to use an example with pip instead of setup.py.
The README.md is then used as the long_description argument to setup(),
so that the doc shows up on pypi.
David L. Jones 5 жил өмнө
parent
commit
f4aa17b28a

+ 2 - 2
python/protobuf_distutils/README.md

@@ -10,7 +10,7 @@ projects' setup.py.
 
 ```shell
 $ python setup.py build
-$ python setup.py install
+$ python -m pip install .
 ```
 
 (If you want to test changes to the extension, you can use `python setup.py
@@ -50,7 +50,7 @@ and installing `example_project` (see above):
 ```shell
 $ python setup.py generate_py_protobufs
 $ python setup.py build
-$ python setup.py install
+$ python -m pip install .
 ```
 
 ## Options

+ 8 - 0
python/protobuf_distutils/setup.py

@@ -96,8 +96,14 @@ Options:
 
 __author__ = 'dlj@google.com (David L. Jones)'
 
+from os import path
 from setuptools import setup, find_packages
 
+# Use README.md as the source for long_description.
+this_directory = path.abspath(path.dirname(__file__))
+with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
+    _readme = f.read()
+
 setup(
     name='protobuf_distutils',
     version='1.0',
@@ -123,6 +129,8 @@ setup(
     ],
     description=('This is a distutils extension to generate Python code for '
                  '.proto files using an installed protoc binary.'),
+    long_description=_readme,
+    long_description_content_type='text/markdown',
     url='https://github.com/protocolbuffers/protobuf/',
     entry_points={
         'distutils.commands': [