Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Even in new setuptools I get this error: Unknown distribution option: 'long_description_content_type' #4

Closed
Flimm opened this issue Apr 18, 2018 · 12 comments

Comments

@Flimm
Copy link

Flimm commented Apr 18, 2018

I cloned this repo, created a new virtualenv, and made sure to upgrade setuptools:

$ pip freeze --all
pip==10.0.0
setuptools==39.0.1
wheel==0.31.0

And yet when I run python setup.py, I get this warning or error:

$ python setup.py sdist
/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/distutils/dist.py:261: UserWarning: Unknown distribution option: 'long_description_content_type'
  warnings.warn(msg)
running sdist
# rest cut for brevity

Is this normal? Is the warning meant to be there? Why doesn't the new version of setuptools seem to support long_description_content_type?

@di
Copy link
Owner

di commented Apr 18, 2018

You need to provide it with a command, like python setup.py sdist (to build a source distribution) or python setup.py bdist_wheel (to build a wheel distribution).

Take a look at https://packaging.python.org/tutorials/distributing-packages/#packaging-your-project for more guidance.

@di di closed this as completed Apr 18, 2018
@Flimm
Copy link
Author

Flimm commented Apr 19, 2018

@di Could you re-open this issue? I've edited the main issue to make it clear that even when I run python setup.py sdist, I still get the warning:

Unknown distribution option: 'long_description_content_type'

@di
Copy link
Owner

di commented Apr 19, 2018

@Flimm Are you following my guide at https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi?

I think this error is because you are not actually using setuptools in your setup.py, you need something like:

from setuptools import setup

at the top of the file.

@Flimm
Copy link
Author

Flimm commented Apr 19, 2018

I cloned this repo. This repo does have the line from setuptools import setup.

@di
Copy link
Owner

di commented Apr 19, 2018

@Flimm What's the result of running python -c "import setuptools; print(setuptools.__version__)" for you?

@di
Copy link
Owner

di commented Apr 19, 2018

@Flimm Ah, sorry. I'm remembering now that distutils will emit this warning, but everything should still work fine.

@Flimm
Copy link
Author

Flimm commented Apr 19, 2018

Thanks. I might submit a bug report to setuptools or distutils in Python then. Just to ease my mind, could you point me to an example on Pypi.org of it working?

@di
Copy link
Owner

di commented Apr 19, 2018

@Flimm It wouldn't be an appropriate bug report for setuptools since the warning is coming from distutils.

I think generally the idea with distutils is that the Python core developers are not planning to add support for any new metadata fields to it (since distutils is part of your Python distribution) so it's unlikely that you'll get a good response to your bug report.

Here's this project on PyPI: https://pypi.org/project/markdown-description-example/

@Flimm
Copy link
Author

Flimm commented Apr 19, 2018

Could your blog post mention that this warning is expected and does not indicate a problem? https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi

This is a valid bug, so hopefully either Python or setuptools will be willing to do something about fixing it.

@di
Copy link
Owner

di commented Apr 19, 2018

Done: di/di.github.io@b5adc2a

@impredicative
Copy link

I encountered this error. For posterity, it went away after I updated setuptools using pip, now at version 40.8.0.

@hugovk
Copy link

hugovk commented Feb 19, 2019

Already documented :)

You’ll need a version of setuptools>=38.6.0 to be able to produce a distribution with the new metadata.

https://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypi/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants