Skip to content

Commit c61ebcd

Browse files
authored
Merge branch 'master' into generate-schema-command
2 parents 7ad05b5 + 2c070e2 commit c61ebcd

File tree

6 files changed

+9
-17
lines changed

6 files changed

+9
-17
lines changed

.python-version

-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2.7.13
21
3.6.1

.travis.yml

-9
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,6 @@ language: python
22

33
matrix:
44
include:
5-
- python: 2.7
6-
env: TOXENV=py27-flask010
7-
- python: 2.7
8-
env: TOXENV=py27-flask10
9-
- python: 2.7
10-
env: TOXENV=py27-flask104
115
- python: 3.6
126
env: TOXENV=py36-flask010
137
- python: 3.6
@@ -34,9 +28,6 @@ matrix:
3428
sudo: true
3529
allow_failures:
3630
- env: TOXENV=py38-dev-flasklatest
37-
- env: TOXENV=py27-flask010
38-
- env: TOXENV=py27-flask10
39-
- env: TOXENV=py27-flask104
4031

4132
before_install:
4233
- pip install -r requirements.txt

flasgger/base.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -268,8 +268,7 @@ def loader(stream):
268268
else:
269269
def loader(stream):
270270
return yaml.safe_load(
271-
parse_imports(stream.read(), filename)
272-
)
271+
parse_imports(stream.read(), filename))
273272
with codecs.open(filename, 'r', 'utf-8') as f:
274273
return loader(f)
275274

flasgger/utils.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import codecs
44
import copy
5-
import imp
5+
import importlib
66
import inspect
77
import os
88
import re
@@ -583,7 +583,13 @@ def load_from_file(swag_path, swag_type='yml', root_path=None):
583583
path = swag_path.replace(
584584
(root_path or os.path.dirname(__file__)), ''
585585
).split(os.sep)[1:]
586-
site_package = imp.find_module(path[0])[1]
586+
package_spec = importlib.util.find_spec(path[0])
587+
if package_spec.has_location:
588+
# Improvement idea: Use package_spec.submodule_search_locations
589+
# if we're sure there's only going to be one search location.
590+
site_package = package_spec.origin.replace('/__init__.py', '')
591+
else:
592+
raise RuntimeError("Package does not have origin")
587593
swag_path = os.path.join(site_package, os.sep.join(path[1:]))
588594
with open(swag_path) as yaml_file:
589595
return yaml_file.read()

setup.py

-2
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,6 @@ def grep(attrname):
5858
],
5959
classifiers=[
6060
'Intended Audience :: Developers',
61-
'Programming Language :: Python :: 2',
62-
'Programming Language :: Python :: 2.7',
6361
'Programming Language :: Python :: 3',
6462
'Programming Language :: Python :: 3.6',
6563
],

tox.ini

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
[tox]
77
envlist =
8-
py28-flask{010,012,10,104},
98
py36-flask{010,012,10,104},
109
py37-flask{010,012,10,104},
1110
py37-marshmallow-apispec,

0 commit comments

Comments
 (0)