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
27 changes: 19 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ The DevCycle Python SDK used for feature management.

This SDK allows your application to interface with the [DevCycle Bucketing API](https://docs.devcycle.com/bucketing-api/#tag/devcycle).

## Requirements.
## Requirements

* Python 3.8+

Expand All @@ -13,6 +13,7 @@ This SDK allows your application to interface with the [DevCycle Bucketing API](
```sh
pip install devcycle-python-server-sdk
```

(you may need to run `pip` with root permission: `sudo pip install devcycle-python-server-sdk`)

## Getting Started
Expand Down Expand Up @@ -65,45 +66,55 @@ When developing the SDK it is recommended that you have both a 3.8 and 3.12 pyth
### Dependencies

To set up dependencies for local development, run:
```

```bash
pip install -r requirements.test.txt
```

To run the example app against the local version of the API for testing and development, run:
```sh

```bash
pip install --editable .
```
from the top level of the repo (same level as setup.py). Then run the example app as normal.

from the top level of the repo (same level as setup.py). Then run the example app as normal:

```bash
python example/local_bucketing_client_example.py
```

### Linting & Formatting

Linting checks on PRs are run using [ruff](https://github.com/charliermarsh/ruff), and are configured using `.ruff.toml`. To run the linter locally, run this command from the top level of the repo:
```

```bash
ruff check .
```

Ruff can automatically fix simple linting errors (the ones marked with `[*]`). To do so, run:
```

```bash
ruff check . --fix
```

Formatting checks on PRs are done using [black](https://github.com/psf/black). To run the formatter locally, run this command from the top level of the repo:

```
```bash
black .
```

### Unit Tests

To run the unit tests, run:

```bash
pytest
```

### Benchmarks

To run the benchmarks, run:

```bash
pytest --benchmark-only
```
Expand All @@ -116,4 +127,4 @@ To generate the protobuf source files run the following from the root of the pro
protoc --proto_path=./protobuf/ --python_out=devcycle_python_sdk/protobuf --pyi_out=devcycle_python_sdk/protobuf variableForUserParams.proto
```

This will rebuild the `variableForUserParams_pb2.py` file. DO NOT edit this file directly.
This will rebuild the `variableForUserParams_pb2.py` file. DO NOT edit this file directly.
17 changes: 7 additions & 10 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ addopts = "--benchmark-skip --showlocals"

# black options
[tool.black]
target-version = ['py37']
target-version = ['py38']
extend-exclude = '_pb2\.pyi?$'

# mypy options
Expand Down Expand Up @@ -43,20 +43,17 @@ ignore_missing_imports = true
[tool.ruff]
# https://beta.ruff.rs/docs/rules/
select = [
"F", # PyFlakes
"E", # pycodestyle error
"W", # pycodestyle warning
"N", # pep8-naming
"T20", # flake8-print
"F", # PyFlakes
"E", # pycodestyle error
"W", # pycodestyle warning
"N", # pep8-naming
"T20", # flake8-print
"RUF100", # ensure noqa comments actually match an error
]
ignore = [
"E501", # line too long
]
exclude = [
"variableForUserParams_pb2.pyi"
]
exclude = ["variableForUserParams_pb2.pyi"]
[tool.ruff.per-file-ignores]
"__init__.py" = ["F401"]
"variableForUserParams_pb2.py" = ["F821", "N999", "E712"]

3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,4 @@ wasmtime == 23.0.0
protobuf >= 4.23.3
openfeature-sdk >= 0.7.0
launchdarkly-eventsource >= 1.2.0
responses~=0.23.1
dataclasses~=0.6
responses~=0.23.1
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
url="https://github.com/devcycleHQ/python-server-sdk",
keywords=["DevCycle"],
install_requires=REQUIRES,
python_requires=">=3.8",
packages=find_packages(),
package_data={
"": ["VERSION.txt"],
Expand Down