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
2 changes: 1 addition & 1 deletion .github/workflows/check-templates-consistency.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
check-template-consistency:
uses: fingerprintjs/dx-team-toolkit/.github/workflows/check-template-consistency.yml@v1
with:
generate-command: 'python3 -m pip install ruff && bash ./generate.sh'
generate-command: 'pip install uv && uv sync --only-group dev && bash ./generate.sh'
12 changes: 5 additions & 7 deletions .github/workflows/coverage-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: "3.12"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
run: uv sync
- name: "Generate coverage"
run: |
coverage run --source=fingerprint_server_sdk -m pytest
coverage xml
uv run coverage run --source=fingerprint_server_sdk -m pytest
uv run coverage xml
- name: Get Cover
uses: orgoro/coverage@3f13a558c5af7376496aa4848bf0224aead366ac
with:
Expand Down
16 changes: 7 additions & 9 deletions .github/workflows/coverage-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,18 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: "3.13"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
run: uv sync
- name: "Generate coverage"
run: |
coverage run --source=fingerprint_server_sdk -m pytest
coverage html
coverage json
python ./generate_coverage_summary.py
uv run coverage run --source=fingerprint_server_sdk -m pytest
uv run coverage html
uv run coverage json
uv run python ./generate_coverage_summary.py
rm ./htmlcov/.gitignore

- name: Create Coverage Badges
Expand Down
10 changes: 4 additions & 6 deletions .github/workflows/functional_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,14 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: ${{ matrix.python-version }}
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
run: uv sync

- name: "Try to get data using SDK"
run: "python ./run_checks.py"
run: "uv run python ./run_checks.py"
env:
PRIVATE_KEY: "${{ secrets.PRIVATE_KEY }}"
14 changes: 6 additions & 8 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,18 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: "3.11"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
run: uv sync

- name: "Run Ruff format check"
run: "ruff format --check ."
run: "uv run ruff format --check ."

- name: "Run Ruff linter"
run: "ruff check ."
run: "uv run ruff check ."

- name: "Run MyPy type checker"
run: "mypy fingerprint_server_sdk"
run: "uv run mypy fingerprint_server_sdk"
12 changes: 3 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,13 @@ jobs:
with:
ref: ${{ github.event.inputs.tag }}

- name: 'Install Python'
uses: actions/setup-python@v5
- name: 'Install uv'
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
python-version: '3.12'

- name: 'Build'
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel
pip install twine
pip install ruff
python setup.py sdist bdist_wheel
run: uv build

- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@76f52bc884231f62b9a034ebfe128415bbaabdfc
Expand Down
7 changes: 2 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@ jobs:
language: python
language-version: '3.12'
prepare-command: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install wheel
pip install twine
pip install ruff
pip install uv
uv sync
secrets:
APP_PRIVATE_KEY: ${{ secrets.APP_PRIVATE_KEY }}
RUNNER_APP_PRIVATE_KEY: ${{ secrets.RUNNER_APP_PRIVATE_KEY }}
10 changes: 4 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ jobs:

steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
with:
enable-cache: true
python-version: "${{ matrix.python-version }}"
- name: "Install dependencies"
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r test-requirements.txt
run: uv sync

- name: "Run tests for ${{ matrix.python-version }}"
run: "pytest"
run: "uv run pytest"
6 changes: 5 additions & 1 deletion .openapi-generator-ignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,8 @@
git_push.sh
tox.ini
test/*.py
.github/workflows/python.yml
.github/workflows/python.yml
setup.py
setup.cfg
requirements.txt
test-requirements.txt
5 changes: 1 addition & 4 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
README.md
README.pypi.md
docs/BotInfo.md
docs/BotInfoCategory.md
docs/BotInfoConfidence.md
Expand Down Expand Up @@ -133,7 +134,3 @@ fingerprint_server_sdk/rest.py
fingerprint_server_sdk/sealed.py
fingerprint_server_sdk/webhook_validation.py
pyproject.toml
requirements.txt
setup.cfg
setup.py
test-requirements.txt
13 changes: 7 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.6
rev: v0.15.20
hooks:
- id: ruff-format
- id: ruff
args: [--fix]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.14.1
- repo: local
hooks:
- id: mypy
additional_dependencies:
- pydantic>=2
- types-python-dateutil>=2.8.19.14
name: mypy
entry: uv run mypy
language: system
types: [python]
args: [--config-file=pyproject.toml]
pass_filenames: false
16 changes: 1 addition & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ The following Python versions are supported:
## Installation & Usage
### pip install

You can install the package directly from the Github
You can install the package directly from GitHub

```sh
pip install git+https://github.com/fingerprintjs/python-sdk.git
Expand All @@ -56,20 +56,6 @@ Then import the package:
import fingerprint_server_sdk
```

### Setuptools

Install via [Setuptools](http://pypi.python.org/pypi/setuptools).

```sh
python setup.py install --user
```
(or `sudo python setup.py install` to install the package for all users)

Then import the package:
```python
import fingerprint_server_sdk
```

## Getting Started

Please follow the [installation procedure](#installation--usage) and then run the following:
Expand Down
Loading
Loading