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
5 changes: 5 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ jobs:
steps:
- checkout

- run:
name: Install PostgreSQL
command: |
sudo apt-get update && sudo apt-get install -y postgresql postgresql-client

- restore_cache:
keys:
- v1-dependencies-{{ checksum "setup.py" }}
Expand Down
2 changes: 1 addition & 1 deletion .isort.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ include_trailing_comma=True
force_grid_wrap=0
combine_as_imports=True
line_length=88
known_third_party = boto3,cachetools,fakeredis,moto,pyee,pytest,redis,setuptools,testing,thrift
known_third_party = boto3,cachetools,fakeredis,moto,psycopg,pyee,pytest,pytest_postgresql,redis,setuptools,thrift
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ repos:
hooks:
- id: insert-license
files: flipper|flipper_thrift
- repo: https://gitlab.com/pycqa/flake8
- repo: https://github.com/pycqa/flake8
rev: 3.9.2
hooks:
- id: flake8
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,7 @@ This project is actively maintained by the maintainers listed in the MAINTAINERS

## Contacts

The project maintainers can be reached via email at adam.savitzky@carta.com or luis.montiel@carta.com.
The project maintainers can be reached via email at luis.montiel@carta.com.

## Discussion

Expand Down
2 changes: 1 addition & 1 deletion flipper/contrib/cached.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from typing import Iterator, Optional

from cachetools import LRUCache, TTLCache
from cachetools import LRUCache, TTLCache # type: ignore

from .interface import AbstractFeatureFlagStore
from .storage import FeatureFlagStoreItem, FeatureFlagStoreMeta
Expand Down
2 changes: 1 addition & 1 deletion flipper/contrib/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

from typing import Iterator, Optional

from redis import Redis
from redis import Redis # type: ignore

from .interface import AbstractFeatureFlagStore, FlagDoesNotExistError
from .storage import FeatureFlagStoreItem, FeatureFlagStoreMeta
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ exclude = '''
| dist
)/
'''

[tool.mypy]
namespace_packages = true
explicit_package_bases = true
23 changes: 12 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setup(
name="flipper-client",
version="1.3.2",
version="1.3.3",
packages=find_packages(),
license="Apache License 2.0",
long_description=open("README.md").read(),
Expand All @@ -24,20 +24,21 @@
"six>=1.12",
"fakeredis~=1.0",
"pytest~=7.1.0",
"ipython",
"thrift",
"ipython~=8.0",
"thrift~=0.22",
"setuptools",
"wheel",
"ipdb",
"black==22.1.0",
"black~=22.3",
"pre-commit",
"isort",
"flake8",
"mypy",
"moto",
"bandit",
"twine",
"testing.postgresql",
"isort~=6.0",
"flake8~=7.2",
"mypy~=1.0",
"moto~=4.2",
"bandit~=1.8",
"twine~=6.1",
"pytest-postgresql~=6.0",
"pytest~=7.1",
],
},
classifiers=["License :: OSI Approved :: Apache Software License"],
Expand Down
8 changes: 4 additions & 4 deletions tests/bucketing/test_consistent_hash_percentage_bucketer.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,28 +39,28 @@ def test_always_returns_false_when_percentage_is_zero(self):
self.assertFalse(bucketer.check()) # score = 0.32

def test_returns_true_when_conditions_hash_to_value_less_than_percentage(
self
self,
): # noqa: E501
percentage = Percentage(value=0.8)
bucketer = ConsistentHashPercentageBucketer(percentage=percentage)
self.assertTrue(bucketer.check(foo="bar")) # score = 0.79

def test_returns_false_when_conditions_hash_to_value_greater_than_percentage(
self
self,
): # noqa: E501
percentage = Percentage(value=0.5)
bucketer = ConsistentHashPercentageBucketer(percentage=percentage)
self.assertFalse(bucketer.check(foo="bar")) # score = 0.79

def test_returns_true_when_conditions_hash_to_value_equal_to_percentage(
self
self,
): # noqa: E501
percentage = Percentage(value=0.79)
bucketer = ConsistentHashPercentageBucketer(percentage=percentage)
self.assertTrue(bucketer.check(foo="bar")) # score = 0.79

def test_always_returns_false_when_percentage_is_zero_when_including_conditions(
self
self,
): # noqa: E501
percentage = Percentage(value=0.0)
bucketer = ConsistentHashPercentageBucketer(percentage=percentage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest

from flipper.conditions.operators.greater_than_or_equal_to_operator import (
GreaterThanOrEqualToOperator
GreaterThanOrEqualToOperator,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest

from flipper.conditions.operators.less_than_or_equal_to_operator import (
LessThanOrEqualToOperator
LessThanOrEqualToOperator,
)


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import unittest

from flipper.conditions.operators.negated_set_membership_operator import (
NegatedSetMembershipOperator
NegatedSetMembershipOperator,
)


Expand Down
6 changes: 3 additions & 3 deletions tests/conditions/test_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
from flipper.conditions.operators.equality_operator import EqualityOperator
from flipper.conditions.operators.greater_than_operator import GreaterThanOperator
from flipper.conditions.operators.greater_than_or_equal_to_operator import (
GreaterThanOrEqualToOperator
GreaterThanOrEqualToOperator,
)
from flipper.conditions.operators.less_than_operator import LessThanOperator
from flipper.conditions.operators.less_than_or_equal_to_operator import (
LessThanOrEqualToOperator
LessThanOrEqualToOperator,
)
from flipper.conditions.operators.negated_set_membership_operator import (
NegatedSetMembershipOperator
NegatedSetMembershipOperator,
)
from flipper.conditions.operators.negation_operator import NegationOperator
from flipper.conditions.operators.set_membership_operator import SetMembershipOperator
Expand Down
8 changes: 4 additions & 4 deletions tests/contrib/storage/test_item.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def test_returns_true_if_bucketer_check_returns_true(self):
self.assertTrue(item.is_enabled())

def test_returns_false_when_bucketer_returns_false_and_conditions_not_specified(
self
self,
): # noqa: E501
# flag.is_enabled(user_id=2) # False
bucketer = MagicMock()
Expand All @@ -159,7 +159,7 @@ def test_returns_false_when_bucketer_returns_false_and_conditions_not_specified(
self.assertFalse(item.is_enabled())

def test_returns_true_when_bucketer_returns_false_and_conditions_return_true(
self
self,
): # noqa: E501
# flag.is_enabled(user_id=2, is_admin=True) # True
bucketer = MagicMock()
Expand All @@ -171,7 +171,7 @@ def test_returns_true_when_bucketer_returns_false_and_conditions_return_true(
self.assertTrue(item.is_enabled(is_admin=True))

def test_returns_true_when_bucketer_returns_true_and_conditions_not_specified(
self
self,
): # noqa: E501
# flag.is_enabled(user_id=1) # True
bucketer = MagicMock()
Expand All @@ -183,7 +183,7 @@ def test_returns_true_when_bucketer_returns_true_and_conditions_not_specified(
self.assertTrue(item.is_enabled())

def test_returns_false_when_bucketer_returns_true_and_conditions_return_false(
self
self,
): # noqa: E501
# flag.is_enabled(user_id=1, is_admin=False) # False
bucketer = MagicMock()
Expand Down
Loading