1

I tried having long_description print when I build my wheel, and it prints just fine. But when I upload to PyPi it doesn't show my long description there. Here's my setup.py, hopefully someone can help figure this out.

from setuptools import setup
from codecs import open
from os import path

here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
    long_description = f.read()
setup(
    name='matchmod',
    version='1.2.1',
    description='Simple Rust-like pattern matching for Python, with some added features',
    long_description=long_description,
    url='https://github.com/AN3223/rustlike-pattern-matching-for-python',
    author='AN3223',
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools',
        'License :: OSI Approved :: MIT License',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
        'Programming Language :: Python :: 3.6',
    ],
    keywords='rust rustlang procedural',
    py_modules=['matchmod']
)

EDIT: I just realized I'm getting this error when building the wheel Error while finding module specification for 'setup.py' (AttributeError: module 'setup' has no attribute '__path__'), not sure what to do to solve this? I tried opening the file this way like the link from yausername suggested but still got the same error:

from pkg_resources import resource_string

long_description = resource_string(__name__, 'README.rst').decode('utf-8')
  • There might be a problem becuase of the __file__ attribute http://peak.telecommunity.com/DevCenter/PythonEggs#accessing-package-resources – yausername Mar 25 '18 at 16:41
  • Hey @yausername thanks for replying. I tried what the link suggested, prints fine just as before but still has the same issue when I build the wheel. Edited the post to explain further. –  Mar 25 '18 at 17:01
  • what command are you using to building the wheel? – yausername Mar 25 '18 at 17:48
  • python -m setup.py bdist_wheel –  Mar 25 '18 at 19:39
  • 1
    either use `python setup.py bdist_wheel` or `python -m setup bdist_wheel` as suggested [here](https://stackoverflow.com/a/36230538/3663254) – yausername Mar 25 '18 at 20:03
  • Thanks, that seems to have made the error go away at least, but the description still isn't showing up on PyPi. I tried uploading using both commands. –  Mar 26 '18 at 07:54

0 Answers0