Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@
packages=find_packages(exclude=("tests",)),
script_args=sys.argv[1:],
include_package_data=True,
package_data={"": ["cacerts.txt", "cacert.pem"]},
package_data={"": ["cacerts.txt", "cacert.pem", "py.typed"]},
zip_safe=False,
python_requires=">=3.7.0",
python_requires=">=3.9.0",
classifiers=[
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Operating System :: OS Independent",
],
)
5 changes: 3 additions & 2 deletions shotgun_api3/lib/mockgun/mockgun.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"""

import datetime
from typing import Any
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't like using things from outside without having a package/module name.

Suggested change
from typing import Any
import typing

Then use typing.Any.

If you are looking for a short version, we can always aggree on

import typing as tp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a subjective personal preference, and we cannot enforce this. I agree on being explicit and importing the objects specifically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we cannot enforce this.

True but the first use usually defines the rule. So this is why I'd like the first iteration to mark our preferences.


from ... import ShotgunError
from ...shotgun import _Config
Expand Down Expand Up @@ -580,7 +581,7 @@ def _get_new_row(self, entity_type):
row[field] = default_value
return row

def _compare(self, field_type, lval, operator, rval):
def _compare(self, field_type: str, lval: Any, operator: str, rval: Any) -> bool:
"""
Compares a field using the operator and value provide by the filter.

Expand Down Expand Up @@ -797,7 +798,7 @@ def _row_matches_filter(self, entity_type, row, sg_filter, retired_only):

return self._compare(field_type, lval, operator, rval)

def _rearrange_filters(self, filters):
def _rearrange_filters(self, filters: list) -> None:
"""
Modifies the filter syntax to turn it into a list of three items regardless
of the actual filter. Most of the filters are list of three elements, so this doesn't change much.
Expand Down
2 changes: 1 addition & 1 deletion shotgun_api3/lib/mockgun/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class SchemaFactory(object):
_schema_cache_path = None

@classmethod
def get_schemas(cls, schema_path, schema_entity_path):
def get_schemas(cls, schema_path: str, schema_entity_path: str) -> tuple:
"""
Retrieves the schemas from disk.

Expand Down
Empty file added shotgun_api3/py.typed
Empty file.
Loading