Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pre-release merge for minor release v0.5.3 #235

Merged
merged 106 commits into from
Mar 12, 2019
Merged
Show file tree
Hide file tree
Changes from 104 commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
473909c
ARXIVNG-281 moved Kinesis BaseConsumer to arxiv-base
erickpeirson Apr 19, 2018
4dfc7b5
ARXIVNG-1177 prototype API
erickpeirson Sep 8, 2018
65c4711
set max page size
erickpeirson Sep 8, 2018
7e079d6
ARXIVNG-1177 updating openapi and jsonschema
erickpeirson Sep 8, 2018
b71ccfe
Merge branch 'develop' into task/ARXIVNG-281
erickpeirson Sep 11, 2018
e455260
Update Pipfile
erickpeirson Sep 11, 2018
db111f3
Merge pull request #163 from cul-it/task/ARXIVNG-281
erickpeirson Sep 11, 2018
8aedaf3
ARXIVNG-1177 working on serialization
erickpeirson Sep 11, 2018
a73cc87
resolved merge conflict
erickpeirson Sep 11, 2018
4934728
cleanup
erickpeirson Sep 11, 2018
ebe82b8
cleaned up mypy issues
erickpeirson Sep 11, 2018
743329b
fixed docstyle issues
erickpeirson Sep 11, 2018
c9e254c
fixed failing test
erickpeirson Sep 11, 2018
b67b061
ARXIVNG-1177 added tests using JSON schema
erickpeirson Sep 11, 2018
49bb047
minor
erickpeirson Sep 11, 2018
6e3315b
authn/z and exception handling for API endpoints
erickpeirson Sep 12, 2018
ea45338
ARXIVNG-1177 added auth, more tests
erickpeirson Sep 12, 2018
c5a839b
Merge pull request #213 from cul-it/api
erickpeirson Sep 12, 2018
45d8cbc
minor
erickpeirson Sep 18, 2018
57da6f5
updated docs
erickpeirson Sep 18, 2018
73f27fa
updated docs
erickpeirson Sep 18, 2018
40f7e16
updated readme
erickpeirson Sep 18, 2018
8f5f12f
minor update to docs
erickpeirson Sep 18, 2018
d84995f
ARXIVNG-1206 added support for configurable return fields; query by URI.
erickpeirson Sep 27, 2018
dc4f295
cleanup, test fixes
erickpeirson Sep 27, 2018
ea98299
fixed mypy errors
erickpeirson Sep 27, 2018
fceaa7f
updated openapi spec
erickpeirson Sep 28, 2018
e6ac1c3
minor
erickpeirson Sep 28, 2018
7cccd8a
added canonical URI to latest and parent metadata object
erickpeirson Sep 28, 2018
b21e2f9
added documentation for date parameters, and fixed a bug
erickpeirson Sep 28, 2018
9c2127a
fixed typo in jsonschema
erickpeirson Sep 28, 2018
57a8f64
Merge pull request #215 from cul-it/feature/ARXIVNG-1206
erickpeirson Sep 28, 2018
085da3f
Merge pull request #214 from cul-it/api
erickpeirson Sep 28, 2018
b8606fe
Fix template to display secondaries
mhl10 Oct 18, 2018
6d9ba5f
ARXIVNG-1348 updated requests to >= 2.20.0
erickpeirson Nov 12, 2018
894d462
Merge branch 'master' into develop
erickpeirson Nov 12, 2018
ecf304c
Merge branch 'develop' into feature/ARXIVNG-1347
erickpeirson Nov 12, 2018
c6a0ed2
APPLICATION_ROOT defaults to /; updated Flask to v1
erickpeirson Nov 12, 2018
b8cadf2
ARXIVNG-1347 added cross list search option in advanced; ARXIVNG-1278…
erickpeirson Nov 12, 2018
c72a927
added handling of outsideallowedrange exception
erickpeirson Nov 12, 2018
fb79a89
ARXIVNG-1277 add styling for secondary search catgories
eawoods Nov 12, 2018
691ca93
Merge pull request #217 from cul-it/ARXIVNG-1277
eawoods Nov 12, 2018
bbe6e2b
Merge branch 'develop' into feature/ARXIVNG-1347
erickpeirson Nov 12, 2018
0a6be52
fix for hit highlighting
erickpeirson Nov 12, 2018
b2806da
updated arxiv-base dep
erickpeirson Nov 12, 2018
0a45158
ARXIVNG-1349 change layout for search results to better align tags an…
eawoods Nov 12, 2018
209ea6d
Merge pull request #216 from cul-it/feature/ARXIVNG-1347
erickpeirson Nov 14, 2018
b540ee9
ARXIVNG-1349 rearrange header in advanced search take 1
eawoods Nov 14, 2018
f4f2333
ARXIVNG-1349 tweak margins and layout for tabletet/mobile
eawoods Nov 15, 2018
3a3460c
Merge pull request #218 from cul-it/bug/ARXIVNG-1349
eawoods Nov 15, 2018
9d36f62
ARXIVNG-1363 upgraded requests version; ARXIVNG-1362 added custom use…
erickpeirson Dec 3, 2018
5b0bc3c
minor
erickpeirson Dec 3, 2018
5357086
upgraded Flask to 1.0.2
erickpeirson Dec 3, 2018
7d06422
ARXIVNG-1357 upgraded secondary classification mapping to be consiste…
erickpeirson Dec 3, 2018
054bb5b
ARXIVNG-1357 mappings
erickpeirson Dec 3, 2018
1ae8b35
fixed hit highlighting for secondaries
erickpeirson Dec 3, 2018
1b93b00
Merge branch 'develop' into task/ARXIVNG-1363
erickpeirson Dec 3, 2018
d1b74d0
highlighting fix for non-field hits on primary and secondary category
erickpeirson Dec 3, 2018
baf5970
Merge pull request #219 from arXiv/task/ARXIVNG-1363
erickpeirson Dec 18, 2018
ea3b1f9
more changes to documentmapping, fixes for highlighting
erickpeirson Dec 18, 2018
752b3c9
minor bugfix
erickpeirson Dec 18, 2018
8711be8
better fix for category bug
erickpeirson Dec 18, 2018
7362810
fixed typing errors
erickpeirson Dec 18, 2018
9bf6452
fixed bug
erickpeirson Dec 18, 2018
3dbb9b7
supporting cross-list classification in high-level filtering, per #209
erickpeirson Dec 18, 2018
0f9f41b
updated some dependencies, refs
erickpeirson Dec 18, 2018
1732e2c
fixed broken test
erickpeirson Dec 18, 2018
be10271
fixed mypy issues
erickpeirson Dec 19, 2018
e1f198a
Merge pull request #220 from arXiv/task/ARXIVNG-1357
erickpeirson Dec 19, 2018
e540a33
minor update to dockerfile
erickpeirson Dec 19, 2018
d2a1499
updated dockerfile
erickpeirson Dec 19, 2018
4f722c1
ARXIVNG-1448 support for primary, ARXIVNG-1447 secondary categories
erickpeirson Dec 20, 2018
6969f65
updated schema
erickpeirson Dec 20, 2018
8aba213
ARXIVNG-1223 query parameters are included in response metadata
erickpeirson Dec 20, 2018
1eca21a
fixed minor bug
erickpeirson Dec 20, 2018
beb35ef
added examples to openapi schema
erickpeirson Dec 20, 2018
dc9d602
fixed style and typing issues
erickpeirson Dec 20, 2018
4e55d39
added some tests
erickpeirson Dec 20, 2018
e82633b
fixed docstyle issue
erickpeirson Dec 20, 2018
c04fc43
ARXIVNG-1349 mobile styling fix ffor results
eawoods Dec 20, 2018
7bdf1f6
updated dependencies
erickpeirson Dec 20, 2018
34a0358
Merge pull request #222 from arXiv/feature/ARXIVNG-1448
erickpeirson Dec 20, 2018
81740c4
Merge pull request #223 from arXiv/bug/ARXIVNG-1349add
erickpeirson Dec 20, 2018
a68f2fa
minor tweaks to dependencies
erickpeirson Dec 20, 2018
98a2e0d
Merge remote-tracking branch 'origin/master' into develop
mhl10 Jan 16, 2019
3db098d
updating gitignore for docs
JaimieMurdock Feb 8, 2019
93a6e61
adding update-docs script, updating intersphinx refs
JaimieMurdock Feb 8, 2019
e4b26fe
Merge pull request #225 from arXiv/task/ARXIVNG-1114
JaimieMurdock Feb 8, 2019
07624e0
update help search redirect for new help pages (#227)
mhl10 Feb 13, 2019
86f94ac
Merge branch 'master' into develop
mhl10 Feb 15, 2019
4129fbb
ARXIVNG-1519 tuning search API for production
erickpeirson Feb 25, 2019
bdf6686
ARXIVNG-1901 apply layout fixes for search results display
eawoods Feb 26, 2019
f56d2b6
Merge pull request #229 from arXiv/bug/ARXIVNG-1901
eawoods Feb 26, 2019
aa10e30
adding start and size to docs, adjusting MAXIMUM_size to match old API
JaimieMurdock Mar 6, 2019
34c32b9
upgrade arxiv-base to 0.15.1 which includes four-column footer
mhl10 Mar 7, 2019
25e0d40
Merge branch 'master' into develop
mhl10 Mar 7, 2019
e8a5108
mypy fix
mhl10 Mar 7, 2019
674a2f1
update arxiv-base to 0.15.2
mhl10 Mar 7, 2019
b688271
Merge branch 'develop' of github.com:cul-it/arxiv-search into develop
Mar 7, 2019
fad3229
lintstats with more debug
mhl10 Mar 7, 2019
94b4262
Merge branch 'develop' of github.com:cul-it/arxiv-search into develop
mhl10 Mar 7, 2019
3651f05
Correcting mypy errors with an upgrade and some type: ignore
JaimieMurdock Mar 7, 2019
e9e5052
Merge pull request #236 from arXiv/mypy-fix
JaimieMurdock Mar 7, 2019
355b23e
mypy ignores for a variety of errors
JaimieMurdock Mar 7, 2019
278dd5b
Merge pull request #237 from arXiv/mypy-fix
JaimieMurdock Mar 7, 2019
1a9a098
Merge pull request #231 from arXiv/task/ARXIVNG-1895
JaimieMurdock Mar 8, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name = "pypi"

[packages]
arxiv-auth = "==0.2.7"
arxiv-base = "==0.14.3"
arxiv-base = "==0.15.2"
boto = "==2.48.0"
"boto3" = "==1.6.6"
botocore = "==1.9.6"
Expand All @@ -28,7 +28,7 @@ jsonschema = "==2.6.0"
markupsafe = "==1.0"
mccabe = "==0.6.1"
mock = "==2.0.0"
mypy = "==0.560"
mypy = "==0.670"
"nose2" = "==0.7.3"
pbr = "==3.1.1"
psutil = "==5.4.3"
Expand All @@ -43,7 +43,6 @@ requests = "==2.20.0"
snowballstemmer = "==1.2.1"
thrift = "==0.11.0"
thrift-connector = "==0.23"
typed-ast = "==1.1.0"
"urllib3" = "==1.22"
werkzeug = "==0.14.1"
wtforms = "==2.1"
Expand Down
128 changes: 65 additions & 63 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lintstats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ curl -u $USERNAME:$GITHUB_TOKEN \


# Check mypy integration
MYPY_STATUS=$( pipenv run mypy -p search | grep -v "test.*" | grep -v "defined here" | wc -l | tr -d '[:space:]' )
MYPY_STATUS=$( pipenv run mypy -p search | grep -v "test.*" | grep -v "defined here" | tee /dev/tty | wc -l | tr -d '[:space:]' )
if [ $MYPY_STATUS -ne 0 ]; then MYPY_STATE="failure" && echo "mypy failed"; else MYPY_STATE="success" && echo "mypy passed"; fi

curl -u $USERNAME:$GITHUB_TOKEN \
Expand Down
2 changes: 1 addition & 1 deletion search/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import werkzeug


def get_application_config(app: Flask = None) -> Union[dict, os._Environ]:
def get_application_config(app: Optional[Union[Flask, object]] = None) -> Union[dict, os._Environ]:
"""
Get a configuration from the current app, or fall back to env.

Expand Down
4 changes: 2 additions & 2 deletions search/controllers/advanced/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def search(request_params: MultiDict) -> Response:
has_classic = False
for key in request_params.keys():
if key.startswith('terms-') and key.endswith('-term'):
value = request_params.get(key)
i = re.search('terms-([0-9])+-term', key).group(1)
value: str = request_params.get(key) # type: ignore
i = re.search('terms-([0-9])+-term', key).group(1) # type: ignore
field = request_params.get(f'terms-{i}-field')
# We are only looking for this syntax in the author search, or
# in an all-fields search.
Expand Down
9 changes: 3 additions & 6 deletions search/controllers/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,11 @@ def _get_date_params(params: MultiDict, query_terms: List) \
dt = pytz.utc.localize(dt)
dt = dt.replace(tzinfo=EASTERN)
except ValueError:
raise BadRequest({'field': field, 'reason': 'invalid datetime'})
raise BadRequest(f'Invalid datetime in {field}')
date_params[field] = dt
query_terms.append({'parameter': field, 'value': dt})
if 'date_type' in params:
date_params['date_type'] = params.get('date_type')
date_params['date_type'] = params.get('date_type') # type: ignore
query_terms.append({'parameter': 'date_type',
'value': date_params['date_type']})
if date_params:
Expand Down Expand Up @@ -192,9 +192,6 @@ def _get_classification(value: str, field: str, query_terms: List) \
try:
clsns = _to_classification(value, query_terms)
except ValueError:
raise BadRequest({
'field': field,
'reason': 'not a valid classification term'
})
raise BadRequest(f'Not a valid classification term: {field}={value}')
query_terms.append({'parameter': field, 'value': value})
return clsns
5 changes: 3 additions & 2 deletions search/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def create_ui_web_app() -> Flask:
logging.getLogger('botocore').setLevel(logging.ERROR)

app = Flask('search')
app.config.from_pyfile('config.py')
app.config.from_pyfile('config.py') # type: ignore
app.url_map.converters['archive'] = ArchiveConverter

index.init_app(app)
Expand All @@ -47,7 +47,7 @@ def create_api_web_app() -> Flask:

app = Flask('search')
app.json_encoder = ISO8601JSONEncoder
app.config.from_pyfile('config.py')
app.config.from_pyfile('config.py') # type: ignore

index.init_app(app)

Expand All @@ -62,3 +62,4 @@ def create_api_web_app() -> Flask:
app.errorhandler(error)(handler)

return app

4 changes: 2 additions & 2 deletions search/routes/api/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ def search() -> Response:
# if requested == ATOM_XML:
# return serialize.as_atom(data), status, headers
response_data = serialize.as_json(data['results'], query=data['query'])
return response_data, status_code, headers
return response_data, status_code, headers # type: ignore


@blueprint.route('<arxiv:paper_id>v<string:version>', methods=['GET'])
@scoped(required=scopes.READ_PUBLIC)
def paper(paper_id: str, version: str) -> Response:
"""Document metadata endpoint."""
data, status_code, headers = api.paper(f'{paper_id}v{version}')
return serialize.as_json(data['results']), status_code, headers
return serialize.as_json(data['results']), status_code, headers # type: ignore
14 changes: 7 additions & 7 deletions search/routes/api/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def get_handlers() -> List[Tuple[type, Callable]]:
def handle_not_found(error: NotFound) -> Response:
"""Render the base 404 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_404_NOT_FOUND
return response

Expand All @@ -54,7 +54,7 @@ def handle_not_found(error: NotFound) -> Response:
def handle_forbidden(error: Forbidden) -> Response:
"""Render the base 403 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_403_FORBIDDEN
return response

Expand All @@ -63,7 +63,7 @@ def handle_forbidden(error: Forbidden) -> Response:
def handle_unauthorized(error: Unauthorized) -> Response:
"""Render the base 401 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_401_UNAUTHORIZED
return response

Expand All @@ -72,7 +72,7 @@ def handle_unauthorized(error: Unauthorized) -> Response:
def handle_method_not_allowed(error: MethodNotAllowed) -> Response:
"""Render the base 405 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_405_METHOD_NOT_ALLOWED
return response

Expand All @@ -81,7 +81,7 @@ def handle_method_not_allowed(error: MethodNotAllowed) -> Response:
def handle_request_entity_too_large(error: RequestEntityTooLarge) -> Response:
"""Render the base 413 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_413_REQUEST_ENTITY_TOO_LARGE
return response

Expand All @@ -90,7 +90,7 @@ def handle_request_entity_too_large(error: RequestEntityTooLarge) -> Response:
def handle_bad_request(error: BadRequest) -> Response:
"""Render the base 400 error page."""
rendered = jsonify({'code': error.code, 'error': error.description})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_400_BAD_REQUEST
return response

Expand All @@ -104,6 +104,6 @@ def handle_internal_server_error(error: InternalServerError) -> Response:
logger.error('Caught unhandled exception: %s', error)
rendered = jsonify({'code': status.HTTP_500_INTERNAL_SERVER_ERROR,
'error': 'Unexpected error'})
response = make_response(rendered)
response: Response = make_response(rendered)
response.status_code = status.HTTP_500_INTERNAL_SERVER_ERROR
return response
Loading