Skip to content

Commit f54bd1a

Browse files
committed
Release 7.0.0: drop legacy endpoints, add Lists/Privacy APIs, modernize
Remove deprecated track/authenticate/device/impersonation client methods, add Lists/List Items and Privacy APIs, fix failover when user is missing, migrate to GitHub Actions, pyproject.toml, and ruff, and require Python 3.9+.
1 parent 3a83027 commit f54bd1a

114 files changed

Lines changed: 1064 additions & 1490 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 0 additions & 62 deletions
This file was deleted.

.github/workflows/lint.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
pull_request:
7+
8+
jobs:
9+
ruff:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: '3.13'
19+
20+
- name: Install ruff
21+
run: |
22+
python -m pip install --upgrade pip
23+
pip install -e ".[lint]"
24+
25+
- name: Run ruff
26+
run: |
27+
ruff check castle
28+
ruff format --check castle

.github/workflows/specs.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Specs
2+
3+
on:
4+
push:
5+
branches: [master, develop]
6+
pull_request:
7+
8+
jobs:
9+
specs:
10+
runs-on: ubuntu-latest
11+
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- name: Set up Python ${{ matrix.python-version }}
21+
uses: actions/setup-python@v5
22+
with:
23+
python-version: ${{ matrix.python-version }}
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -e ".[test]"
29+
30+
- name: Run tests
31+
run: python -m unittest -v castle.test

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
*.pyo
33
*.egg-info
44
.eggs
5+
__pycache__/
56
.pytest_cache
7+
.ruff_cache
68
/dist
79
/build
810
.coverage
911
/htmlcov
12+
.venv/
1013
.vscode/
1114
.idea/

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.10.2
1+
3.13

.tool-versions

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
python 3.13.3

CHANGELOG.rst

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,35 @@
11
master
22
------
33

4+
7.0.0 (2026-05-29)
5+
------------------
6+
7+
Breaking Changes:
8+
~~~~~~~~~~~~~~~~~
9+
- require Python 3.9 or newer (3.4–3.8 are no longer supported)
10+
- remove ``track``, ``authenticate``, device management, and impersonation
11+
client methods; use ``risk``, ``filter``, and ``log`` instead
12+
- remove ``ImpersonationFailed``
13+
14+
Features:
15+
~~~~~~~~~
16+
- add Lists and List Items APIs
17+
- add Privacy API (``request_user_data``, ``delete_user_data``)
18+
- add ``RateLimitError`` for HTTP 429 responses
19+
20+
Bug fixes:
21+
~~~~~~~~~~
22+
- fix ``Client.filter`` and ``Client.risk`` failover when ``user`` is missing;
23+
fall back to ``matching_user_id``
24+
25+
Enhancements:
26+
~~~~~~~~~~~~~
27+
- remove unused ``ValidatorsNotSupported`` validator
28+
- migrate CI to GitHub Actions (Python 3.9–3.13)
29+
- migrate packaging to ``pyproject.toml`` (PEP 621)
30+
- replace ``pylint``/``autopep8`` with ``ruff``
31+
- bump ``requests`` minimum to ``2.31``
32+
433
6.1.0 (2022-03-14)
534
------------------
635
- `#111 <https://github.com/castle/castle-python/pull/111>`__ fix context preparation issues

DEVELOPMENT.rst

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,37 @@ Installation
55
66
$ git clone git@github.com:castle/castle-python.git
77
$ cd castle-python
8-
$ python3 setup.py install
8+
$ pip3 install -e ".[test,lint]"
99
1010
1111
Test
1212
------------
1313

1414
.. code-block:: console
1515
16-
$ python3 setup.py test
16+
$ python3 -m unittest castle.test
1717
1818
Linting
1919
------------
2020

2121
.. code-block:: console
2222
23-
$ pip3 install pylint
24-
$ pip3 install --upgrade pep8
25-
$ pip3 install --upgrade autopep8
26-
$ pylint --rcfile=./pylintrc castle
27-
$ autopep8 --in-place -r castle
23+
$ pip3 install ruff
24+
$ ruff check castle
25+
$ ruff format --check castle
26+
27+
To auto-fix and format:
28+
29+
.. code-block:: console
30+
31+
$ ruff check --fix castle
32+
$ ruff format castle
2833
2934
Coverage
3035
------------
3136

3237
.. code-block:: console
3338
3439
$ pip3 install coverage
35-
$ coverage run setup.py test
40+
$ coverage run -m unittest castle.test
41+
$ coverage report

MANIFEST.in

Lines changed: 0 additions & 2 deletions
This file was deleted.

Makefile

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,35 @@
11
PIP = pip3
22
PYTHON = python3
33

4-
.PHONY = help ci-lint coverage lint pre-lint setup test
4+
.PHONY = help ci-lint coverage lint format setup test
55
.DEFAULT_GOAL = help
66

77
help:
88
@echo "---------------HELP-----------------"
9-
@echo "To check the project coverage type make coverage"
9+
@echo "To install the project type make setup"
10+
@echo "To run the tests type make test"
1011
@echo "To lint the project type make lint"
11-
@echo "To setup the project type make setup"
12-
@echo "To test the project type make test"
12+
@echo "To auto-format the project type make format"
13+
@echo "To check coverage type make coverage"
1314
@echo "------------------------------------"
1415

15-
coverage:
16-
${PIP} install coverage
17-
coverage run setup.py test
18-
19-
ci-lint: pre-lint lint
16+
setup:
17+
${PIP} install -e ".[test,lint]"
2018

21-
pre-lint:
22-
${PIP} install pylint
23-
${PIP} install --upgrade pep8
24-
${PIP} install --upgrade autopep8
19+
test:
20+
${PYTHON} -m unittest -v castle.test
2521

2622
lint:
27-
pylint --rcfile=./pylintrc castle
28-
autopep8 --in-place -r castle
23+
ruff check castle
24+
ruff format --check castle
2925

30-
setup:
31-
${PYTHON} setup.py install
26+
ci-lint: lint
3227

33-
test:
34-
${PYTHON} setup.py test
28+
format:
29+
ruff check --fix castle
30+
ruff format castle
31+
32+
coverage:
33+
${PIP} install coverage
34+
coverage run -m unittest castle.test
35+
coverage report

0 commit comments

Comments
 (0)