GithubHelp home page GithubHelp logo

setuptools-markdown's Introduction

setuptools-markdown

Use Markdown for your project description


This project is deprecated.

Instead of using this, you should use the built-in functionality of setuptools and PyPI.

See this page for details.


Install

  1. Install pandoc
  2. Install this module
pip install setuptools-markdown

Use

#!/usr/bin/env python
# setup.py

from setuptools import setup

setup(
    ...
    setup_requires=['setuptools-markdown'],
    long_description_markdown_filename='README.md',
    ...
)

The plugin will read the specified file, convert it to reST using pypandoc and store the resulting reST in the long_description metadata field of your distribution.

setuptools-markdown's People

Contributors

msabramo avatar nicoddemus avatar xoviat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

setuptools-markdown's Issues

Missing format error

When running detox I get the following error.

File "/tmp/pip-f9No6w-build/setuptools_markdown-0.2-py2.7.egg/setuptools_markdown.py", line 22, in long_description_markdown_filename

    output = pypandoc.convert(markdown_filename, 'rst')

  File "build/bdist.linux-x86_64/egg/pypandoc.py", line 94, in convert

  File "build/bdist.linux-x86_64/egg/pypandoc.py", line 112, in _convert

RuntimeError: Missing format!

Fail gracefully if pandoc not present

This library is a great idea. I have had my own code copied between a bunch of projects that works similarly. This is much more compact.

One problem, however, is that setup fails hard if pandoc is not installed. Obviously, this is required to properly convert between formats, but I think the right thing to do is to warn rather than failing. Here's one instance of a failure: https://travis-ci.org/posborne/cmsis-svd/jobs/66494752

Here's the code I have been using that warns instead of failing. Note that I include README.md with MANIFEST.in: https://github.com/posborne/cmsis-svd/blob/master/python/setup.py#L34

Generated RST doesn't work on pypi

You can see one of my projects here and the README here. Obviously there are some problems. I am not sure exactly what is happening now but I will post some results shortly.

Don't fail with critical error if pandoc is not available

This is a problem where the user is running setup.py as part of a continuous-integration build process where pandoc isn't easily installable (for instance, on travis-ci's container based infrastructure). In that case, just fail with a warning and don't block the rest of the install process.

License text missing?

Hi,

I noticed that while you specify license='MIT' in the setup.py, the actual license text/copyright statements are missing from the source.

Could you please add them?

Thanks.

RuntimeError: Couldn't call pandoc to get output formats.

  • setuptools-markdown==0.2
  • pypandoc==1.2.0
  • pandoc: stable 2.0.2 (homebrew OSX)
    File "/Users/bzamecnik/odrive/dropbox/Documents/dev/repos/tfr/setup.py", line 41, in <module>
        'tfr = tfr.spectrogram_features.__main__:main'
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/Users/bzamecnik/anaconda/lib/python3.4/distutils/core.py", line 108, in setup
        _setup_distribution = dist = klass(attrs)
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/setuptools/dist.py", line 334, in __init__
        _Distribution.__init__(self, attrs)
      File "/Users/bzamecnik/anaconda/lib/python3.4/distutils/dist.py", line 280, in __init__
        self.finalize_options()
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/setuptools/dist.py", line 468, in finalize_options
        ep.load()(self, ep.name, value)
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/setuptools_markdown.py", line 22, in long_description_markdown_filename
        output = pypandoc.convert(markdown_filename, 'rst')
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/pypandoc/__init__.py", line 69, in convert
        outputfile=outputfile, filters=filters)
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/pypandoc/__init__.py", line 240, in _convert_input
        format, to = _validate_formats(format, to, outputfile)
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/pypandoc/__init__.py", line 201, in _validate_formats
        from_formats, to_formats = get_pandoc_formats()
      File "/Users/bzamecnik/anaconda/lib/python3.4/site-packages/pypandoc/__init__.py", line 335, in get_pandoc_formats
        str(comm))
    RuntimeError: Couldn't call pandoc to get output formats. Output from pandoc:
    (b'pandoc [OPTIONS] [FILES]\n  -f FORMAT, -r FORMAT  --from=FORMAT, --read=FORMAT                    \n
[...]

Option to strip in-page links?

My use case is a GFM-formatted README.md that I want to display on PyPI correctly. PyPI refuses to render it because I have project-relative links, e.g.

[point.py](examples/point.py)

According to various StackOverflow threads and my own experiments, this is not allowed.

I wonder whether it would be within the scope of this project to strip these links, perhaps replacing them with the plain url or a constant placeholder. Apparently this is possible in pandoc by transforming the parsed AST, and the step can be done in Python code using pandocfilters.

Counterpoints against implementing this feature include:

  • (I presume) there are other GFM constructs that can't be easily represented in rst. In other words, we still can't save everyone.
  • PyPI may at some point become less anal about its input documents, making the effort obsolete.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.