Compare commits

...

4 commits

Author SHA1 Message Date
Simon Willison
391d109dc3 Upgrade to pytest 5 2019-07-02 21:23:09 -07:00
Simon Willison
dc893692fb imp. is deprecated, use types.ModuleType instead
Thanks https://stackoverflow.com/a/32175781
2019-07-02 21:22:54 -07:00
Simon Willison
dd67c491f3 Bump click and click-default-group 2019-07-02 21:14:56 -07:00
Simon Willison
8c09c10f25 Switch to ~= dependencies, closes #532 2019-07-02 21:11:59 -07:00
2 changed files with 15 additions and 15 deletions

View file

@ -3,7 +3,6 @@ from collections import OrderedDict
import base64 import base64
import click import click
import hashlib import hashlib
import imp
import json import json
import os import os
import pkg_resources import pkg_resources
@ -11,6 +10,7 @@ import re
import shlex import shlex
import tempfile import tempfile
import time import time
import types
import shutil import shutil
import urllib import urllib
import numbers import numbers
@ -588,7 +588,7 @@ def link_or_copy_directory(src, dst):
def module_from_path(path, name): def module_from_path(path, name):
# Adapted from http://sayspy.blogspot.com/2011/07/how-to-import-module-from-just-file.html # Adapted from http://sayspy.blogspot.com/2011/07/how-to-import-module-from-just-file.html
mod = imp.new_module(name) mod = types.ModuleType(name)
mod.__file__ = path mod.__file__ = path
with open(path, "r") as file: with open(path, "r") as file:
code = compile(file.read(), path, "exec", dont_inherit=True) code = compile(file.read(), path, "exec", dont_inherit=True)

View file

@ -41,14 +41,14 @@ setup(
package_data={"datasette": ["templates/*.html"]}, package_data={"datasette": ["templates/*.html"]},
include_package_data=True, include_package_data=True,
install_requires=[ install_requires=[
"click>=6.7", "click~=7.0",
"click-default-group==1.2", "click-default-group~=1.2.1",
"Jinja2==2.10.1", "Jinja2~=2.10.1",
"hupper==1.0", "hupper~=1.0",
"pint==0.8.1", "pint~=0.8.1",
"pluggy>=0.12.0", "pluggy~=0.12.0",
"uvicorn>=0.8.1", "uvicorn~=0.8.1",
"aiofiles==0.4.0", "aiofiles~=0.4.0",
], ],
entry_points=""" entry_points="""
[console_scripts] [console_scripts]
@ -58,11 +58,11 @@ setup(
extras_require={ extras_require={
"docs": ["sphinx_rtd_theme", "sphinx-autobuild"], "docs": ["sphinx_rtd_theme", "sphinx-autobuild"],
"test": [ "test": [
"pytest==4.6.1", "pytest~=5.0.0",
"pytest-asyncio==0.10.0", "pytest-asyncio~=0.10.0",
"aiohttp==3.5.3", "aiohttp~=3.5.3",
"beautifulsoup4==4.6.1", "beautifulsoup4~=4.6.1",
"asgiref==3.1.2", "asgiref~=3.1.2",
] ]
+ maybe_black, + maybe_black,
}, },