Skip to content

Commit 8bf0e28

Browse files
committed
PyPI ready
- Adds setup.py with pydown entry-point - Adds MANIFEST.in - Adds NOTICE
1 parent 59e5fee commit 8bf0e28

File tree

3 files changed

+118
-0
lines changed

3 files changed

+118
-0
lines changed

MANIFEST.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include *.md *.rst
2+
include NOTICE
3+
recursive-include templates *.html *.css *.js
4+
recursive-include templates/css *.css
5+
recursive-include templates/js *.js

NOTICE

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
pydown includes some vendorized python libraries, including markdown and pygments.
2+
3+
markdown License
4+
================
5+
6+
Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
7+
Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
8+
Copyright 2004 Manfred Stienstra (the original version)
9+
10+
All rights reserved.
11+
12+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
13+
14+
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
15+
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
16+
Neither the name of the nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
17+
THIS SOFTWARE IS PROVIDED BY THE PYTHON MARKDOWN PROJECT ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANY CONTRIBUTORS TO THE PYTHON MARKDOWN PROJECT BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18+
19+
pygments License
20+
================
21+
22+
Copyright (c) 2006-2010 by the respective authors (see AUTHORS file).
23+
All rights reserved.
24+
25+
Redistribution and use in source and binary forms, with or without
26+
modification, are permitted provided that the following conditions are
27+
met:
28+
29+
* Redistributions of source code must retain the above copyright
30+
notice, this list of conditions and the following disclaimer.
31+
32+
* Redistributions in binary form must reproduce the above copyright
33+
notice, this list of conditions and the following disclaimer in the
34+
documentation and/or other materials provided with the distribution.
35+
36+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
37+
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
38+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
39+
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
40+
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
41+
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
42+
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
43+
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
44+
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
45+
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
46+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

setup.py

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import sys
2+
import subprocess
3+
4+
try:
5+
from setuptools import setup, find_packages
6+
except ImportError:
7+
from distutils.core import setup
8+
from distutils.util import convert_path
9+
10+
def _find_packages(where='.', exclude=()):
11+
"""Return a list all Python packages found within directory 'where'
12+
13+
'where' should be supplied as a "cross-platform" (i.e. URL-style) path; it
14+
will be converted to the appropriate local path syntax. 'exclude' is a
15+
sequence of package names to exclude; '*' can be used as a wildcard in the
16+
names, such that 'foo.*' will exclude all subpackages of 'foo' (but not
17+
'foo' itself).
18+
"""
19+
out = []
20+
stack = [(convert_path(where), '')]
21+
while stack:
22+
where, prefix = stack.pop(0)
23+
for name in os.listdir(where):
24+
fn = os.path.join(where, name)
25+
if ('.' not in name and os.path.isdir(fn) and
26+
os.path.isfile(os.path.join(fn, '__init__.py'))):
27+
out.append(prefix+name)
28+
stack.append((fn, prefix + name + '.'))
29+
for pat in list(exclude)+['ez_setup', 'distribute_setup']:
30+
from fnmatch import fnmatchcase
31+
out = [item for item in out if not fnmatchcase(item, pat)]
32+
33+
PUBLISH_CMD = "python setup.py register sdist upload"
34+
35+
if 'publish' in sys.argv:
36+
status = subprocess.call(PUBLISH_CMD, shell=True)
37+
sys.exit(status)
38+
39+
def read(fname):
40+
with open(fname) as fp:
41+
content = fp.read()
42+
return content
43+
44+
setup(
45+
name='pydown',
46+
version="0.1.0",
47+
description='An HTML5 presentation builder written by python',
48+
long_description=read("README.md"),
49+
author='isnowfy',
50+
url='https://github.com/isnowfy/pydown',
51+
packages=find_packages(exclude=('test*', )) + ['templates'],
52+
license=read("LICENSE.md"),
53+
classifiers=[
54+
'Development Status :: 3 - Alpha',
55+
'Intended Audience :: Developers',
56+
'License :: OSI Approved :: MIT License',
57+
'Programming Language :: Python',
58+
59+
],
60+
py_modules=('main', ),
61+
include_package_data=True,
62+
entry_points={
63+
'console_scripts': [
64+
"pydown = main:main"
65+
]
66+
},
67+
)

0 commit comments

Comments
 (0)