Rainfall.NZ
Rainfall.NZ

Reputation: 336

When creating a Python package in PyPi how do I specify a path for the readme file

When creating my Python package I set the file name for my readme file in setup.cfg under the 'long_description' heading:

long_description = file: README.md

This assumes the README.md file is in the project's root directory. How do I specify an alternative location? I have unsucesfully tried:

long_description = file: Docs/README.md

Upvotes: 0

Views: 576

Answers (2)

Rainfall.NZ
Rainfall.NZ

Reputation: 336

I needed to explicitly include the path of my readme file by creating a MANIFEST.in file in my base directory with a directive that locates my readme file:

include Docs/README.md

Details of the MANIFEST.in file and associated directives are in https://packaging.python.org/guides/using-manifest-in/#using-manifest-in The path still needs to be under the long_description heading in the setup.cfg file

Upvotes: 0

luizbarcelos
luizbarcelos

Reputation: 796

I would suggest you to try:

long_description = open('your file').read()

Upvotes: 1

Related Questions