Skip to content

Commit d8a448b

Browse files
committed
Add support for installation from PyPI.
1 parent 5bf8d2d commit d8a448b

File tree

3 files changed

+54
-0
lines changed

3 files changed

+54
-0
lines changed

Makefile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.PHONY: clean-pyc build release
2+
3+
clean-pyc:
4+
find . -name '*.pyc' -exec rm -f {} +
5+
find . -name '*.pyo' -exec rm -f {} +
6+
find . -name '*~' -exec rm -f {} +
7+
8+
build:
9+
python setup.py bdist_wheel --universal
10+
11+
release: build
12+
python setup.py sdist bdist_wheel upload

setup.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[bdist_wheel]
2+
universal = 1

setup.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/usr/bin/env python
2+
# -*- coding: utf-8 -*-
3+
4+
import os
5+
from setuptools import setup, find_packages
6+
7+
8+
def get_info(name):
9+
basedir = os.path.dirname(__file__)
10+
with open(os.path.join(basedir, 'pdfbookmarker.py')) as f:
11+
locals = {}
12+
try:
13+
exec(f.read(), locals)
14+
except ImportError:
15+
pass
16+
return locals[name]
17+
18+
19+
setup(
20+
name='pdfbookmarker',
21+
version=get_info('__version__'),
22+
author=get_info('__author__'),
23+
author_email=get_info('__email__'),
24+
maintainer=get_info('__author__'),
25+
maintainer_email=get_info('__email__'),
26+
keywords='PDF, Bookmarks, Python tools',
27+
description='Add bookmarks to existing PDF files',
28+
license=get_info('__license__'),
29+
long_description=get_info('__doc__'),
30+
py_modules=['pdfbookmarker'],
31+
url='https://github.com/RussellLuo/pdfbookmarker',
32+
install_requires=[
33+
'PyPDF2==1.26.0',
34+
],
35+
entry_points={
36+
'console_scripts': [
37+
'pdfbm = pdfbookmarker:main',
38+
],
39+
},
40+
)

0 commit comments

Comments
 (0)