Skip to content

Commit ae0f530

Browse files
authored
Merge pull request #94 from reddit/py_typed
Add `py.typed` + misc.
2 parents 9f32a5a + 9c73939 commit ae0f530

File tree

5 files changed

+8
-10
lines changed

5 files changed

+8
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@ dist/
55
__pycache__/
66
reddit_experiments.egg-info/
77
venv*
8+
.idea/

docs/index.rst

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,7 @@ Prerequisite packages
1414
1515
reddit-edgecontext>=1.0.0
1616
17-
# upgrade or integrate latest reddit-v2-events package
18-
# or manually update thrift schemas
19-
# to allow event fields to be populated in exposures
20-
reddit-v2-events
17+
reddit-v2-events>=2.6.0
2118
2219
Prerequisite infrastructure
2320
---------------------------
@@ -68,18 +65,17 @@ Upgrade or integrate reddit-experiments package:
6865
.. code-block:: python
6966
7067
# import latest reddit-experiments package in service requirements.txt
71-
reddit-experiments>=1.3.11
68+
reddit-experiments>=1.3.14
7269
7370
Initialize :code:`decider` instance on Baseplate context
7471
--------------------------------------------------------
7572

7673
In your service's initialization process, add a :code:`decider` instance to baseplate's context:
77-
(Note the use of the :code:`ExperimentLogger`, which is used to publish exposure V2 events,
78-
an example can be seen `here <https://github.snooguts.net/reddit/reddit-service-graphql/blob/master/graphql-py/graphql_api/events/utils.py>`_)
7974

8075
.. code-block:: python
8176
8277
# application code
78+
from event_utils.v2_event_utils import ExperimentLogger
8379
from reddit_decider import decider_client_from_config
8480
from reddit_decider import DeciderClient
8581
@@ -100,7 +96,7 @@ an example can be seen `here <https://github.snooguts.net/reddit/reddit-service-
10096
baseplate.configure_context({
10197
"decider": DeciderClient(
10298
prefix="experiments.",
103-
event_logger=ExperimentLogger,
99+
event_logger=ExperimentLogger()),
104100
request_field_extractor=my_field_extractor # optional
105101
})
106102

reddit_decider/py.typed

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# https://www.python.org/dev/peps/pep-0561/#packaging-type-information

reddit_experiments/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ def experiments_client_from_config(
361361
experiment configuration fetcher daemon.
362362
``timeout`` (optional)
363363
The time that we should wait for the file specified by ``path`` to
364-
exist. Defaults to `None` which is `infinite`.
364+
exist. (defaults to not blocking).
365365
``backoff`` (optional)
366366
The base amount of time for exponential backoff when trying to find the
367367
experiments config file. Defaults to no backoff between tries.

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"reddit-decider~=1.2.31",
2323
"typing_extensions>=3.10.0.0,<5.0",
2424
],
25-
package_data={"reddit_experiments": ["py.typed"]},
25+
package_data={"reddit_experiments": ["py.typed"], "reddit_decider": ["py.typed"]},
2626
zip_safe=True,
2727
classifiers=[
2828
"Development Status :: 5 - Production/Stable",

0 commit comments

Comments
 (0)