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
57 changes: 29 additions & 28 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,63 +10,64 @@ jobs:
build:
name: Build
runs-on: ubuntu-24.04
env:
PYTHON_VERSION: "3.10"

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Setup Python
uses: actions/setup-python@v6
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
python-version: "3.13"
enable-cache: true

- name: Install Poetry
uses: snok/install-poetry@v1
- name: "Set up Python"
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}

- name: Install dependencies
run: poetry install
run: uv sync --locked --all-extras --dev

- name: Format Check
run: uv run ruff format --check

- name: Lint
run: poetry run black --check .
run: uv run ruff check --no-fix

- name: Type Check
run: uv run pyright

- name: Build
run: poetry build
run: uv build

# the `coverage xml -i` command is needed to re-write the
# coverage report with relative paths
- name: Test
run: |
poetry run pytest --cov src --cov-report xml tests
poetry run coverage xml -i
run: uv run pytest

test:
name: Test
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
poetry-version: ["1.8.2"]
python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Setup python
uses: actions/setup-python@v6
with:
python-version: "${{ matrix.python-version }}"
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install Poetry
uses: snok/install-poetry@v1
- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
version: "${{ matrix.poetry-version }}"
enable-cache: true
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: poetry install
run: uv sync --locked --all-extras --dev

- name: Build
run: poetry build
run: uv build

- name: Test
run: poetry run tox
run: uv run pytest
40 changes: 0 additions & 40 deletions .github/workflows/codeql-analysis.yml

This file was deleted.

26 changes: 11 additions & 15 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,23 @@ jobs:
name: Deploy to package index
runs-on: ubuntu-24.04
env:
PYTHON_VERSION: "3.12"
REPOSITORY_USERNAME: ${{ secrets.PYPI_USERNAME }}
REPOSITORY_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
PYTHON_VERSION: "3.10"
UV_PUBLISH_TOKEN: ${{ secrets.PYPI_PASSWORD }}
REPOSITORY_URL: ${{ secrets.PYPI_PUBLISH_URL }}
ANACONDA_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
CONDA_ENV_NAME: conda-env

steps:
- name: Checkout repository
uses: actions/checkout@v6
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2

- name: Install uv
uses: astral-sh/setup-uv@61cb8a9741eeb8a550a1b8544337180c0fc8476b # v7.2.0
with:
enable-cache: true

- name: Setup Python
uses: actions/setup-python@v6
uses: actions/setup-python@83679a892e2d95755f2dac6acb0bfd1e9ac5d548 # 6.1.0
with:
python-version: ${{ env.PYTHON_VERSION }}

Expand All @@ -32,21 +36,13 @@ jobs:
activate-environment: ${{ env.CONDA_ENV_NAME }}
python-version: ${{ env.PYTHON_VERSION }}

- name: Install Poetry
uses: snok/install-poetry@v1

- name: Configure Poetry
run: |
poetry config repositories.publish $REPOSITORY_URL
poetry config http-basic.publish $REPOSITORY_USERNAME $REPOSITORY_PASSWORD

- name: Build
run: |
poetry build
uv build

- name: Publish
run: |
poetry publish -r publish
uv publish

- name: Publish to Anaconda
shell: bash -el {0}
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,6 @@ target/
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
Expand Down
1 change: 1 addition & 0 deletions .python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.10
35 changes: 12 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,11 @@ from fds.sdk.utils.authentication import ConfidentialClient
import requests

# The ConfidentialClient instance should be reused in production environments.
client = ConfidentialClient(
config_path='/path/to/config.json'
)
client = ConfidentialClient(config_path="/path/to/config.json")
res = requests.get(
'https://api.factset.com/analytics/lookups/v3/currencies',
headers={
'Authorization': 'Bearer ' + client.get_access_token()
})
"https://api.factset.com/analytics/lookups/v3/currencies",
headers={"Authorization": "Bearer " + client.get_access_token()},
)

print(res.text)
```
Expand All @@ -72,11 +69,9 @@ If necessary it is possible to set custom `proxy_headers` as dictionary.
from fds.sdk.utils.authentication import ConfidentialClient

client = ConfidentialClient(
config_path='/path/to/config.json',
proxy="http://secret:password@localhost:5050",
proxy_headers={
"Custom-Proxy-Header": "Custom-Proxy-Header-Value"
}
config_path="/path/to/config.json",
proxy="http://secret:password@localhost:5050",
proxy_headers={"Custom-Proxy-Header": "Custom-Proxy-Header-Value"},
)
```

Expand All @@ -95,9 +90,7 @@ local development or testing
from fds.sdk.utils.authentication import ConfidentialClient

client = ConfidentialClient(
config_path='/path/to/config.json',
verify_ssl=True,
ssl_ca_cert='/path/to/ca.pem'
config_path="/path/to/config.json", verify_ssl=True, ssl_ca_cert="/path/to/ca.pem"
)
```

Expand All @@ -111,12 +104,8 @@ from urllib3 import Retry
from fds.sdk.utils.authentication import ConfidentialClient

client = ConfidentialClient(
config_path='/path/to/config.json',
retry=Retry(
total=5,
backoff_factor=0.1,
status_forcelist=[500, 502, 503, 504]
)
config_path="/path/to/config.json",
retry=Retry(total=5, backoff_factor=0.1, status_forcelist=[500, 502, 503, 504]),
)
```

Expand Down Expand Up @@ -183,13 +172,13 @@ help you understand what it's doing. You can increase the log level to see addit
conventions. For example:

```python
logging.getLogger('fds.sdk.utils').setLevel(logging.DEBUG)
logging.getLogger("fds.sdk.utils").setLevel(logging.DEBUG)
```

or

```python
logging.getLogger('fds.sdk.utils.authentication').setLevel(logging.DEBUG)
logging.getLogger("fds.sdk.utils.authentication").setLevel(logging.DEBUG)
```

# Contributing
Expand Down
Loading
Loading