Skip to content

Commit 1f52c5b

Browse files
symphony-eliassymphony-younesssymphony-hongsymphony-mariacristinasymphony-soufiane
authored
PLAT-10739: Release 2.0b1 (#165)
* PLAT-10433: Sphinx documentation (#130) * PLAT-10483 - HealthService implementation (#132) - HealthService implementation and tests - Renamed test classes from `test_name_of_class.py` to `name_of_class_test.py` * PLAT-10532: ApplicationService implementation (#133) * ApplicationService implementation * Update documentation * PLAT-10530: Presence service implementation (#134) - Presence service implementation and tests - Put the presence service test payloads in one JSON file - Added type-hint to the ServiceFactory.get_health_service function * PLAT-10530 Fixed documentation issues in links regarding the presence service (#135) This fix was added to correctly show links to the endpoint documentation when sphinx documentation is generated. * PLAT-10531 Signal service implementation (#138) * PLAT-10529 Ability to set private key and certificate content programmatically (#137) Private key and Certificate were able to only be loaded from the config file when initializing bdk. In this PR, we update bot config to be able to set private key and certificate after bdk being initialized. * PLAT-10489: Implemented automatic pagination (#139) * PLAT-10643: Load certs from system store In #122 we enable loading a custom cert store for the HTTP client. This broked using pods with valid certs because the system certs are no longer loaded. This change loads them even all the time (and we might add custom ones on top of that). Also sync the rest.mustache template used for code generation. * PLAT-10643: Unit test system certs loading * Added forgotten default value in list_all_stream_members (#144) * PLAT-10533: Added User-Agent header in requests (#141) * PLAT-10600 enforce pylint checks in PR builder (#146) Goal of this PR is to enable pylint checks in the PR builder. For now the limit to fail is set to 9.50 (max being 10.00). We can start like this and if needed we can adapt it later on, if we think that is too strict. All changes about fixture are related to this issue: https://stackoverflow.com/questions/46089480/pytest-fixtures-redefining-name-from-outer-scope-pylint * PLAT-10534: Added X-Trace-Id header to each HTTP call (#147) * PLAT-10534: Added X-Trace-Id header to each HTTP call * Replaced single quotes with double quotes * Fixed python version in GH workflow * Updated caching logic in workflows (#148) * Changed caching logic of poetry deps to be specific to the actual python version. * Updated build, push and pylint to cache pip dependencies as well * PLAT-10651: Updated generated code following role type update to string (#149) * Updated generated code using openApiGen 5.0.1 and updated role format to str * Updated unit tests and examples * PLAT-10565 Adding utils classes (#150) Adding some util classes on message processing to: Extract entities from a given incoming message (mentions, hashtags, cashtags, emojis) Extract message content from presentationML Pre-process an outgoing message by "cleaning" the text message, escaping all special characters that will violate messageML format Convert a stream id into a url safe id and viceversa * PLAT-10535: Extension App RSA authentication (#153) * PLAT-10535: First implementation of RSA ext app authentication * Added and improved docstrings * Fixed some pylint errors * Updated poetry deps * #143 Activity API (#151) * #143 Activity API (draft version) * #143 Added unit tests * #143 Added markdown doc * #143 Documented AbstractActivity class * PLAT-10709: Switch from python-jose to PyJWT (#159) Switch from using python-jose to using PyJWT * PLAT-10588: Implemented concurrent DF loop (#158) * PLAT-10588: Implemented concurrency of event handling in DF loop * Refactored datafeed loops * Updated poetry deps * PLAT-10563: FormReply activity (#161) - Base classes for a FormReply Activity. - Modification of the command activity to parse attributes in the constructor instead - Fixed related tests * PLAT-10538: Minor improvements on extension app authenticator (#163) * PLAT-10538: added allowed audience = app-id when validating jwt * Improved error handling in ExtensionAppAuthenticatorRsa.validate_jwt * Updated dependencies * Bumped version to 2.0b1 * PR builder should build 2.0-rc branch Co-authored-by: symphony-youness <76746033+symphony-youness@users.noreply.github.com> Co-authored-by: symphony-hong <65538951+symphony-hong@users.noreply.github.com> Co-authored-by: Mariacristina De Dominicis <65179248+symphony-mariacristina@users.noreply.github.com> Co-authored-by: Soufiane Aourinmouche <52406574+symphony-soufiane@users.noreply.github.com> Co-authored-by: Youri Bonnaffe <youri.bonnaffe@symphony.com> Co-authored-by: Youri Bonnaffé <63661676+symphony-youri@users.noreply.github.com> Co-authored-by: Thibault Pensec <39826516+symphony-thibault@users.noreply.github.com>
1 parent d188738 commit 1f52c5b

File tree

352 files changed

+8262
-1832
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

352 files changed

+8262
-1832
lines changed

.github/workflows/build.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: build
22

33
on:
44
push:
5-
branches: [ "2.0" ]
5+
branches: [ "2.0", "2.0-rc" ]
66
pull_request:
7-
branches: [ "2.0" ]
7+
branches: [ "2.0", "2.0-rc" ]
88

99
jobs:
1010
build:
@@ -24,29 +24,39 @@ jobs:
2424
- uses: actions/checkout@v2
2525

2626
- name: Set up Python 3.8
27+
id: setup-python
2728
uses: actions/setup-python@v2
2829
with:
2930
python-version: 3.8
3031

32+
- name: Get pip cache dir
33+
id: pip-cache
34+
run: |
35+
echo "::set-output name=dir::$(pip cache dir)"
36+
37+
- name: Cache pip dependencies
38+
uses: actions/cache@v2
39+
with:
40+
path: ${{ steps.pip-cache.outputs.dir }}
41+
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}
42+
3143
- name: Install Poetry
3244
run: pip install poetry
3345

3446
- name: Cache poetry
3547
uses: actions/cache@v2
3648
with:
3749
path: ${{ matrix.path }}
38-
key: ${{ runner.os }}-poetry-${{ hashFiles('poetry.lock') }}
50+
key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
3951
restore-keys: |
40-
${{ runner.os }}-poetry-
52+
${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-
4153
4254
- name: Install dependencies
4355
run: poetry install
4456

4557
- name: Run tests with coverage
4658
run: poetry run pytest
47-
48-
- name: Run pylint
49-
run: poetry run pylint symphony tests
59+
timeout-minutes: 10
5060

5161
- name: Upload test results
5262
uses: actions/upload-artifact@v2
@@ -60,4 +70,4 @@ jobs:
6070
with:
6171
name: pytest-coverage-${{ matrix.os }}
6272
path: htmlcov
63-
if: ${{ always() }}
73+
if: ${{ always() }}

.github/workflows/push.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: On 2.0 push
2+
3+
on:
4+
push:
5+
branches: [ "2.0" ]
6+
7+
jobs:
8+
security:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@master
12+
- name: Run Snyk to check for vulnerabilities
13+
uses: snyk/actions/python@master
14+
env:
15+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}
16+
with:
17+
args: --severity-threshold=high
18+
command: monitor
19+
20+
documentation:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Set up Python 3.8
28+
id: setup-python
29+
uses: actions/setup-python@v2
30+
with:
31+
python-version: 3.8
32+
33+
- name: Copy 2.0 branch into gh-pages
34+
run: |
35+
git checkout gh-pages
36+
git reset --hard 2.0
37+
38+
- name: Get pip cache dir
39+
id: pip-cache
40+
run: |
41+
echo "::set-output name=dir::$(pip cache dir)"
42+
43+
- name: Cache pip dependencies
44+
uses: actions/cache@v2
45+
with:
46+
path: ${{ steps.pip-cache.outputs.dir }}
47+
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}
48+
49+
- name: Install Poetry
50+
run: pip install poetry
51+
52+
- name: Cache poetry
53+
uses: actions/cache@v2
54+
with:
55+
path: ~/.cache/pypoetry/virtualenvs
56+
key: ${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('poetry.lock') }}
57+
restore-keys: |
58+
${{ runner.os }}-poetry-${{ steps.setup-python.outputs.python-version }}-
59+
60+
- name: Install Poetry deps
61+
run: poetry install
62+
63+
- name: Generate Sphinx documentation
64+
working-directory: ./docsrc
65+
run: |
66+
. `poetry env info --path`/bin/activate
67+
make html
68+
69+
- name: Copy Sphinx documentation into docs/
70+
working-directory: ./docsrc/_build/html
71+
run: mv * $GITHUB_WORKSPACE/docs/
72+
73+
- name: Commit changes
74+
run: |
75+
git config user.name github-actions
76+
git config user.email github-actions@github.com
77+
git add docs/
78+
git commit -m "Generated commit for Sphinx documentation"
79+
git push -f origin gh-pages

.github/workflows/pylint.yaml

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: pylint
2+
3+
on:
4+
push:
5+
branches: [ "2.0" ]
6+
pull_request:
7+
branches: [ "2.0" ]
8+
9+
jobs:
10+
build:
11+
name: pylint
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Code
16+
uses: actions/checkout@v2
17+
18+
- name: Set up Python 3.8
19+
id: setup-python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: 3.8
23+
24+
- name: Get pip cache dir
25+
id: pip-cache
26+
run: |
27+
echo "::set-output name=dir::$(pip cache dir)"
28+
29+
- name: Cache pip dependencies
30+
uses: actions/cache@v2
31+
with:
32+
path: ${{ steps.pip-cache.outputs.dir }}
33+
key: ${{ runner.os }}-pip-${{ steps.setup-python.outputs.python-version }}
34+
35+
- name: Install Pylint
36+
run: pip install pylint
37+
38+
- name: Download previous run results
39+
uses: dawidd6/action-download-artifact@v2.12.0
40+
continue-on-error: true
41+
with:
42+
workflow: pylint.yaml
43+
workflow_conclusion: success
44+
name: .pylint.d
45+
path: /home/runner/.pylint.d
46+
branch: "2.0"
47+
48+
- name: Run Pylint
49+
run: pylint symphony tests
50+
51+
- name: Upload Pylint results
52+
if: ${{ always() }}
53+
uses: actions/upload-artifact@v2
54+
with:
55+
name: .pylint.d
56+
path: ~/.pylint.d

.github/workflows/release.yml

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626

2727
- name: Run tests with coverage
2828
run: poetry run pytest
29+
timeout-minutes: 10
2930

3031
- name: publish
3132
env:

.github/workflows/snyk.yml

-18
This file was deleted.

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ instance/
6464
.scrapy
6565

6666
# Sphinx documentation
67-
docs/_build/
67+
docsrc/_build/
68+
docsrc/_autosummary/
6869

6970
# PyBuilder
7071
target/

.pylintrc

+10-7
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
extension-pkg-whitelist=
77

88
# Specify a score threshold to be exceeded before program exits with error.
9-
fail-under=0.00
9+
fail-under=9.50
1010

1111
# Add files or directories to the blacklist. They should be base names, not
1212
# paths.
@@ -34,7 +34,7 @@ limit-inference-results=100
3434
load-plugins=
3535

3636
# Pickle collected data for later comparisons.
37-
persistent=no
37+
persistent=yes
3838

3939
# When enabled, pylint would attempt to guess common misconfiguration and emit
4040
# user-friendly hints instead of false-positive error messages.
@@ -61,6 +61,7 @@ confidence=
6161
# no Warning level messages displayed, use "--disable=all --enable=classes
6262
# --disable=W".
6363
disable=print-statement,
64+
import-error,
6465
parameter-unpacking,
6566
unpacking-in-except,
6667
old-raise-syntax,
@@ -397,14 +398,14 @@ class-naming-style=PascalCase
397398

398399
# Regular expression matching correct class names. Overrides class-naming-
399400
# style.
400-
#class-rgx=
401+
class-rgx=[A-Z_][a-zA-Z0-9_]+$
401402

402403
# Naming style matching correct constant names.
403404
const-naming-style=UPPER_CASE
404405

405406
# Regular expression matching correct constant names. Overrides const-naming-
406407
# style.
407-
#const-rgx=
408+
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
408409

409410
# Minimum line length for functions/classes that require docstrings, shorter
410411
# ones are exempt.
@@ -437,7 +438,7 @@ inlinevar-naming-style=any
437438

438439
# Regular expression matching correct inline iteration names. Overrides
439440
# inlinevar-naming-style.
440-
#inlinevar-rgx=
441+
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
441442

442443
# Naming style matching correct method names.
443444
method-naming-style=snake_case
@@ -459,7 +460,7 @@ name-group=
459460

460461
# Regular expression which should only match function or class names that do
461462
# not require a docstring.
462-
no-docstring-rgx=^_
463+
no-docstring-rgx= ^_|test|assert|fixture
463464

464465
# List of decorators that produce properties, such as abc.abstractproperty. Add
465466
# to this list to register other decorators that produce valid properties.
@@ -478,7 +479,9 @@ variable-naming-style=snake_case
478479

479480
# This flag controls whether inconsistent-quotes generates a warning when the
480481
# character used as a quote delimiter is used inconsistently within a module.
481-
check-quote-consistency=no
482+
check-quote-consistency=yes
483+
string-quote=double
484+
docstring-quote=double
482485

483486
# This flag controls whether the implicit-str-concat should generate a warning
484487
# on implicit string concatenation in sequences defined over several lines.

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2018 The Python Packaging Authority
1+
Copyright (c) 2021 Symphony Communication Services, LLC
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+25-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,35 @@
1-
# symphony-api-client-python
1+
[![License](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)
2+
[![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9-blue)](https://www.python.org/downloads/release/python-3)
3+
[![Pypi](https://img.shields.io/badge/pypi-2.0b0-green)](https://pypi.org/project/sym-api-client-python/2.0b0/)
4+
![GitHub Workflow Status (branch)](https://img.shields.io/github/workflow/status/SymphonyPlatformSolutions/symphony-api-client-python/build/2.0)
25

3-
This is the Symphony BDK for Python to help developing bots and interact with the [Symphony REST APIs](https://developers.symphony.com/restapi/reference).
6+
# Symphony BDK for Python
7+
8+
This is the Symphony BDK for Python to help develop bots and interact with the [Symphony REST APIs](https://developers.symphony.com/restapi/reference).
49

510
Legacy Python BDK is located in [legacy](./legacy) folder.
611

7-
## How to build
12+
## Installation and getting started
13+
The [reference documentation](https://symphonyplatformsolutions.github.io/symphony-api-client-python/) includes detailed
14+
installation instructions as well as a comprehensive
15+
[getting started](https://symphonyplatformsolutions.github.io/symphony-api-client-python/markdown/getting_started.html)
16+
guide.
17+
18+
## Build from source
19+
20+
The Symphony BDK uses and requires Python 3.8 or higher. Be sure you have it installed before going further.
821

922
We use [poetry](https://python-poetry.org/) in order to manage dependencies, build, run tests and publish.
1023
To install poetry, follow instructions [here](https://python-poetry.org/docs/#installation).
1124

1225
On the first time, run `poetry install`. Then run `poetry build` to build the sdist and wheel packages.
1326
To run the tests, use `poetry run pytest`.
27+
28+
It is possible to run pylint scan locally (on a specific file or package) executing the following command:
29+
`poetry run pylint <module_name>`.
30+
31+
To generate locally the Sphinx documentation, run: `cd docsrc && make html`.
32+
33+
## Contributing
34+
35+
If you want to contribute, please check the [contributing guidelines](CONTRIBUTING.md).

docs/.nojekyll

Whitespace-only changes.

docs/datafeed.md

-21
This file was deleted.

docs/getting_started.md

-16
This file was deleted.

0 commit comments

Comments
 (0)