-
Notifications
You must be signed in to change notification settings - Fork 71
/
setup.py
50 lines (36 loc) · 1.17 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python
from setuptools import setup, find_packages, Command
import os
from pathlib import Path
packages = find_packages()
class PyTest(Command):
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
import sys
import subprocess
errno = subprocess.call([sys.executable, "runtests.py"])
raise SystemExit(errno)
def get_locals(filename):
the_locals = {}
exec(open(filename, "r").read(), {}, the_locals)
return the_locals
metadata = get_locals(os.path.join("markdown_to_json", "_metadata.py"))
this_directory = Path(__file__).parent
long_description = (this_directory / "README.md").read_text()
setup(
name="markdown-to-json",
long_description=long_description,
long_description_content_type="text/markdown",
version=metadata["version"],
author=metadata["author"],
author_email=metadata["author_email"],
license=metadata["license"],
url=metadata["url"],
packages=find_packages(),
cmdclass={"test": PyTest},
entry_points={"console_scripts": ["md_to_json = markdown_to_json.scripts.md_to_json:main"]},
)