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

General maintenance #10

Merged
merged 7 commits into from
Dec 11, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
MAINT: Resolve DeprecationWarnings
Resolves the following two DeprecationWarnings from traitlets 4.1:

    DeprecationWarning: Traits should be given as instances, not types
    (for example, `Int()`, not `Int`). Passing types is deprecated in
    traitlets 4.1.

    DeprecationWarning: metadata {'example': 97} was set from the
    constructor. With traitlets 4.1, metadata should be set using the
    .tag() method, e.g., Int().tag(key1='value1', key2='value2')
  • Loading branch information
quantophred committed Dec 5, 2018
commit 029541ac90a250a0ac12dda3464e6ba55e6e0e49
2 changes: 1 addition & 1 deletion straitlets/builtin_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def _password_requires_user(self, proposal):
return new

hosts = List(
trait=Unicode,
trait=Unicode(),
minlen=1,
help=(
"List of hosts in the replicaset. "
Expand Down
6 changes: 3 additions & 3 deletions straitlets/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ def test_nested_example():

class C(Serializable):
point = Instance(Point)
unicode_ = Unicode(example='foo')
unicode_ = Unicode().tag(example='foo')

class B(Serializable):
value = Integer(example=ord('b'))
value = Integer().tag(example=ord('b'))
next_ = Instance(C)

class A(Serializable):
value = Integer(example=ord('a'))
value = Integer().tag(example=ord('a'))
next_ = Instance(B)

expected = A(
Expand Down