diff --git a/README.md b/README.md index 048b72d..ad22f7c 100644 --- a/README.md +++ b/README.md @@ -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+ @@ -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 @@ -65,38 +66,47 @@ 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 ``` @@ -104,6 +114,7 @@ pytest ### Benchmarks To run the benchmarks, run: + ```bash pytest --benchmark-only ``` @@ -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. \ No newline at end of file +This will rebuild the `variableForUserParams_pb2.py` file. DO NOT edit this file directly. diff --git a/pyproject.toml b/pyproject.toml index ae24d27..a0275ee 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,7 +5,7 @@ addopts = "--benchmark-skip --showlocals" # black options [tool.black] -target-version = ['py37'] +target-version = ['py38'] extend-exclude = '_pb2\.pyi?$' # mypy options @@ -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"] - diff --git a/requirements.txt b/requirements.txt index 82b3390..e3e4bd8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 \ No newline at end of file +responses~=0.23.1 \ No newline at end of file diff --git a/setup.py b/setup.py index b7cf8e9..a67a2a2 100644 --- a/setup.py +++ b/setup.py @@ -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"],