-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FFM-11935 Add
with_httpx_args
option (#106)
* {client,config}: allow passing through additional httpx arguments (#105) * FFM-11935 Fix line length for flake8 / Update docs and add sample. * FFM-11935 Update docstring and flake8 formatting change --------- Co-authored-by: Zane van Iperen <[email protected]>
- Loading branch information
1 parent
a5e9a1f
commit d32a599
Showing
9 changed files
with
99 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import logging | ||
import time | ||
|
||
from featureflags.config import with_httpx_args, with_base_url | ||
from featureflags.evaluations.auth_target import Target | ||
from featureflags.client import CfClient | ||
from featureflags.util import log | ||
|
||
|
||
def main(): | ||
log.setLevel(logging.INFO) | ||
log.info("Starting example") | ||
api_key = "Your API key" | ||
|
||
# Using the httpx proxies option. | ||
# Ensure you supply a valid httpx option. if you supply an option that | ||
# doesn't exist in `httpx` the SDK will fail to initialize with `got an | ||
# unexpected keyword argument` | ||
client = CfClient(api_key, | ||
with_httpx_args({'proxies': 'http://localhost:8888'})) | ||
|
||
client.wait_for_initialization() | ||
|
||
target = Target(identifier='HT_1', name="Harness_Target_1", | ||
attributes={"location": "emea"}) | ||
|
||
while True: | ||
result = client.bool_variation('identifier_of_your_bool_flag', target, | ||
False) | ||
log.info("Result %s", result) | ||
time.sleep(10) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,4 +2,4 @@ | |
|
||
__author__ = """Harness""" | ||
__email__ = "[email protected]" | ||
__version__ = '1.6.4' | ||
__version__ = '1.7.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
[bumpversion] | ||
current_version = 1.6.4 | ||
current_version = 1.7.0 | ||
commit = True | ||
tag = True | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters