Skip to content
Closed
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
62 changes: 0 additions & 62 deletions .circleci/config.yml

This file was deleted.

28 changes: 28 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Lint

on:
push:
branches: [master, develop]
pull_request:

jobs:
ruff:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.13'

- name: Install ruff
run: |
python -m pip install --upgrade pip
pip install -e ".[lint]"

- name: Run ruff
run: |
ruff check castle
ruff format --check castle
31 changes: 31 additions & 0 deletions .github/workflows/specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Specs

on:
push:
branches: [master, develop]
pull_request:

jobs:
specs:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e ".[test]"

- name: Run tests
run: python -m unittest -v castle.test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,13 @@
*.pyo
*.egg-info
.eggs
__pycache__/
.pytest_cache
.ruff_cache
/dist
/build
.coverage
/htmlcov
.venv/
.vscode/
.idea/
2 changes: 1 addition & 1 deletion .python-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.10.2
3.13
1 change: 1 addition & 0 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python 3.13.3
36 changes: 36 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,42 @@
master
------

7.1.0 (2026-05-29)
------------------

Features:
~~~~~~~~~
- add ``events_schema``, ``query_events``, and ``group_events`` for the Events API

7.0.0 (2026-05-29)
------------------

Breaking Changes:
~~~~~~~~~~~~~~~~~
- require Python 3.9 or newer (3.4–3.8 are no longer supported)
- remove ``track``, ``authenticate``, device management, and impersonation
client methods; use ``risk``, ``filter``, and ``log`` instead
- remove ``ImpersonationFailed``

Features:
~~~~~~~~~
- add Lists and List Items APIs
- add Privacy API (``request_user_data``, ``delete_user_data``)
- add ``RateLimitError`` for HTTP 429 responses

Bug fixes:
~~~~~~~~~~
- fix ``Client.filter`` and ``Client.risk`` failover when ``user`` is missing;
fall back to ``matching_user_id``

Enhancements:
~~~~~~~~~~~~~
- remove unused ``ValidatorsNotSupported`` validator
- migrate CI to GitHub Actions (Python 3.9–3.13)
- migrate packaging to ``pyproject.toml`` (PEP 621)
- replace ``pylint``/``autopep8`` with ``ruff``
- bump ``requests`` minimum to ``2.31``

6.1.0 (2022-03-14)
------------------
- `#111 <https://github.com/castle/castle-python/pull/111>`__ fix context preparation issues
Expand Down
43 changes: 31 additions & 12 deletions DEVELOPMENT.rst
Original file line number Diff line number Diff line change
@@ -1,35 +1,54 @@
Development
===========

Requirements
------------

Python 3.9 or newer. The repo pins a version in ``.tool-versions``; with `asdf` installed, run commands via ``asdf exec`` (or ensure that Python is active in your shell).

Installation
------------

.. code-block:: console

$ git clone git@github.com:castle/castle-python.git
$ cd castle-python
$ python3 setup.py install
$ make setup

``make setup`` installs the package in editable mode with test and lint extras (``pip install -e ".[test,lint]"``).

Test
------------
----

.. code-block:: console

$ python3 setup.py test
$ make test

Runs ``python3 -m unittest -v castle.test``. CI runs the same suite on Python 3.9–3.13 via GitHub Actions (``.github/workflows/specs.yml``).

Linting
------------
-------

.. code-block:: console

$ pip3 install pylint
$ pip3 install --upgrade pep8
$ pip3 install --upgrade autopep8
$ pylint --rcfile=./pylintrc castle
$ autopep8 --in-place -r castle
$ make lint

Runs ``ruff check`` and ``ruff format --check`` on ``castle/``. CI uses the same checks (``.github/workflows/lint.yml``).

To auto-fix and format:

.. code-block:: console

$ make format

Coverage
------------
--------

.. code-block:: console

$ pip3 install coverage
$ coverage run setup.py test
$ make coverage

Makefile targets
----------------

``make help`` lists ``setup``, ``test``, ``lint``, ``format``, and ``coverage``.
2 changes: 0 additions & 2 deletions MANIFEST.in

This file was deleted.

39 changes: 20 additions & 19 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
PIP = pip3
PYTHON = python3

.PHONY = help ci-lint coverage lint pre-lint setup test
.PHONY = help ci-lint coverage lint format setup test
.DEFAULT_GOAL = help

help:
@echo "---------------HELP-----------------"
@echo "To check the project coverage type make coverage"
@echo "To install the project type make setup"
@echo "To run the tests type make test"
@echo "To lint the project type make lint"
@echo "To setup the project type make setup"
@echo "To test the project type make test"
@echo "To auto-format the project type make format"
@echo "To check coverage type make coverage"
@echo "------------------------------------"

coverage:
${PIP} install coverage
coverage run setup.py test

ci-lint: pre-lint lint
setup:
${PIP} install -e ".[test,lint]"

pre-lint:
${PIP} install pylint
${PIP} install --upgrade pep8
${PIP} install --upgrade autopep8
test:
${PYTHON} -m unittest -v castle.test

lint:
pylint --rcfile=./pylintrc castle
autopep8 --in-place -r castle
ruff check castle
ruff format --check castle

setup:
${PYTHON} setup.py install
ci-lint: lint

test:
${PYTHON} setup.py test
format:
ruff check --fix castle
ruff format castle

coverage:
${PIP} install coverage
coverage run -m unittest castle.test
coverage report
Loading
Loading