home / code

code

Custom SQL query returning 101 rows

idfile_idline_noline
1 1 1 from click.testing import CliRunner
2 1 2 from datasette.cli import cli
3 1 3 from pathlib import Path
4 1 4
5 1 5 docs_path = Path(__file__).parent / "docs"
6 1 6
7 1 7 includes = (
8 1 8 ("serve", "datasette-serve-help.txt"),
9 1 9 ("package", "datasette-package-help.txt"),
10 1 10 ("publish now", "datasette-publish-now-help.txt"),
11 1 11 ("publish heroku", "datasette-publish-heroku-help.txt"),
12 1 12 )
13 1 13
14 1 14
15 1 15 def update_help_includes():
16 1 16 for name, filename in includes:
17 1 17 runner = CliRunner()
18 1 18 result = runner.invoke(
19 1 19 cli, name.split() + ["--help"], terminal_width=88
20 1 20 )
21 1 21 actual = "$ datasette {} --help\n\n{}".format(
22 1 22 name, result.output
23 1 23 )
24 1 24 actual = actual.replace('Usage: cli ', 'Usage: datasette ')
25 1 25 open(docs_path / filename, "w").write(actual)
26 1 26
27 1 27
28 1 28 if __name__ == "__main__":
29 1 29 update_help_includes()
30 2 1 from setuptools import setup, find_packages
31 2 2 import os
32 2 3
33 2 4 import versioneer
34 2 5
35 2 6
36 2 7 def get_long_description():
37 2 8 with open(os.path.join(
38 2 9 os.path.dirname(os.path.abspath(__file__)), 'README.md'
39 2 10 ), encoding='utf8') as fp:
40 2 11 return fp.read()
41 2 12
42 2 13
43 2 14 def get_version():
44 2 15 path = os.path.join(
45 2 16 os.path.dirname(os.path.abspath(__file__)), 'datasette', 'version.py'
46 2 17 )
47 2 18 g = {}
48 2 19 exec(open(path).read(), g)
49 2 20 return g['__version__']
50 2 21
51 2 22
52 2 23 setup(
53 2 24 name='datasette',
54 2 25 version=versioneer.get_version(),
55 2 26 cmdclass=versioneer.get_cmdclass(),
56 2 27 description='An instant JSON API for your SQLite databases',
57 2 28 long_description=get_long_description(),
58 2 29 long_description_content_type='text/markdown',
59 2 30 author='Simon Willison',
60 2 31 license='Apache License, Version 2.0',
61 2 32 url='https://github.com/simonw/datasette',
62 2 33 packages=find_packages(),
63 2 34 package_data={'datasette': ['templates/*.html']},
64 2 35 include_package_data=True,
65 2 36 install_requires=[
66 2 37 'click==6.7',
67 2 38 'click-default-group==1.2',
68 2 39 'Sanic==0.7.0',
69 2 40 'Jinja2==2.10',
70 2 41 'hupper==1.0',
71 2 42 'pint==0.8.1',
72 2 43 'pluggy>=0.7.1',
73 2 44 ],
74 2 45 entry_points='''
75 2 46 [console_scripts]
76 2 47 datasette=datasette.cli:cli
77 2 48 ''',
78 2 49 setup_requires=['pytest-runner'],
79 2 50 extras_require={
80 2 51 'test': [
81 2 52 'pytest==3.7.1',
82 2 53 'aiohttp==3.3.2',
83 2 54 'beautifulsoup4==4.6.1',
84 2 55 ]
85 2 56 },
86 2 57 tests_require=[
87 2 58 'datasette[test]',
88 2 59 ],
89 2 60 classifiers=[
90 2 61 'Development Status :: 4 - Beta',
91 2 62 'Intended Audience :: Developers',
92 2 63 'Intended Audience :: Science/Research',
93 2 64 'Intended Audience :: End Users/Desktop',
94 2 65 'Topic :: Database',
95 2 66 'License :: OSI Approved :: Apache Software License',
96 2 67 'Programming Language :: Python :: 3.6',
97 2 68 'Programming Language :: Python :: 3.5',
98 2 69 ],
99 2 70 )
100 3 1
101 3 2 # Version: 0.18
Powered by Datasette · Query took 0.731ms