After implementing your packages functionalities, you’ll now add additional files, which are needed in order to publish your package to PyPI.
The setup.py
file should be placed in the top folder of your package. A fairly minimal setup.py
for reader looks like this:
import pathlib
from setuptools import setup
# The directory containing this file
HERE = pathlib.Path(__file__).parent
# The text of the README file
README = (HERE / "README.md").read_text()
# This call to setup() does all the work
setup(
name="realpython-reader",
version="1.0.0",
description="Read the latest Real Python tutorials",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/realpython/reader",
author="Real Python",
author_email="YOUR_EMAIL_ADDRESS_HERE",
license="MIT",
classifiers=[
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
],
packages=["reader"],
include_package_data=True,
install_requires=["feedparser", "html2text"],
entry_points={
"console_scripts": [
"realpython=reader.__main__:main",
]
},
)
rorydaulton on May 31, 2020
At time stamp 1:13 the video for this lesson “Preparing Your Package for Publication on PyPI” says, “Copy and paste the code from below”. The code was for
setup.py
. Could you add that code, along with any others, into the text below the video? (Similar code may need to be placed into other lessons in this series.)