Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Split namespace packages and add httpx client #1

Merged
merged 20 commits into from
Jan 19, 2024

Conversation

n4mespace
Copy link
Collaborator

@n4mespace n4mespace commented Dec 22, 2023

Changelog:

  • updated project deps
  • add ruff
  • move grpc part to featureflags/grpc/
  • add http part in featureflags/http/
  • some code duplicates, like in conditions.py because a lot was written with types from protobufs
  • add httpx manager featureflags/http/managers/httpx.py and example for it examples/http/httpx_client.py

QA:

  • from which version we plan to support clients?
    if not from ≥3.7 then we can use more modern typing (just run pyupgrade)

TODO:

  • add sync requests/ async aiohttp managers
  • update protobuf version in deps after protobuf release
  • update tests/enable test workflow
  • regenerate docs
  • add pre-commit hooks
  • try to integrate with some service http API
  • add tracer / stats_collector to http managers

from aiohttp import web
from grpclib.client import Channel

from featureflags.grpc.client import FeatureFlagsClient
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we rename featureflags to featureflags_client ?

self._refresh_task = asyncio.create_task(self._refresh_loop())

async def wait_closed(self) -> None:
self._refresh_task.cancel()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In grpc manager, there is a separate method close which closes refresh_task. Lets try following that implementation. (Or if all in one method is desired we can rename it to async close)

if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/client-')
strategy:
matrix:
python-version: [3.7]
Copy link
Collaborator Author

@n4mespace n4mespace Dec 26, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

by the way, @kindermax, what minimun version should we support? can we start from 3.9/3.10 at least? maybe do a poll in dev channel?

@n4mespace n4mespace force-pushed the split-namespace-packages branch from 4b5d57e to 81b0a09 Compare January 19, 2024 12:21
@n4mespace n4mespace merged commit 9aac9da into main Jan 19, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants