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
Merged
Show file tree
Hide file tree
Changes from 4 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
45 changes: 45 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Ignore Python bytecode files / cache
*.pyc
*.pyo
*.pyd
.mypy_cache
.pytest_cache
.ruff_cache
__pycache__
__pypackages__

# Ignore Python virtual environment files
venv/
.venv/
.ve/
.pdm.toml
.pdm-build
.pdm-python

# Ignore local development configuration files
.git
.env
.flake8
mypy.ini
.dockerignore
.gitignore
.gitlab-ci.yml
.python-version
README.md
.hooks
.lets
helm
.ipython
.ptpython
.secrets

# Ignore IDE settings
.vscode
.idea

# Ignore any compiled Python extension modules
*.so

# Ignore any build artifacts
build/
dist/
29 changes: 29 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Build & publish

# TODO: Setup release workflow
on:
push:
branches: [ "**" ]
tags:
- "client-v*"
# pull_request:
# branches: [main]

jobs:
deploy-client:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client
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?

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Upload package to pypi.org
run: pdm publish --username ${{ secrets.PYPI_USERNAME }} --password ${{ secrets.PYPI_PASSWORD }}
34 changes: 34 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Test

# TODO: enable after test fixes
on: workflow_dispatch
# pull_request:
# branches:
# - main
# types:
# - assigned
# - opened
# - synchronize
# - reopened

jobs:
test-client:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./client
strategy:
matrix:
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: pdm-project/setup-pdm@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: python -m pip install tox tox-gh-actions tox-pdm
- name: Test with tox
run: |
tox --version
tox
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Ignore Python bytecode files / cache
*.pyc
*.pyo
*.pyd
.mypy_cache
.pytest_cache
.ruff_cache
__pycache__
__pypackages__
featureflags_protobuf

# Ignore Python virtual environment files
venv/
.venv/
.ve/
.pdm.toml
.pdm-python
.pdm-build

# Ignore local development configuration files
.env
.lets
.ipython
.ptpython
.python-version
.secrets

# Ignore IDE settings
.vscode
.idea

# Ignore any compiled Python extension modules
*.so

# Ignore any build artifacts
build/
dist/
48 changes: 48 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
FROM python:3.11-slim-bullseye as base

ENV PIP_VERSION=23.2.1
ENV PDM_VERSION=2.9.1
ENV PDM_USE_VENV=no
ENV PYTHONPATH=/app/__pypackages__/3.11/lib

WORKDIR /app

COPY ./pyproject.toml .
COPY ./pdm.lock .

RUN apt-get update && \
apt-get install -y --no-install-recommends \
libpq-dev \
gcc \
make \
g++ \
git && \
# install tools
pip install --upgrade pip==${PIP_VERSION} && \
pip install pdm==${PDM_VERSION} && \
# configure
pdm config cache_dir /pdm_cache && \
pdm config check_update false && \
# install base deps \
pdm install --no-lock --prod --no-editable && \
# cleanup base layer to keep image size small
apt purge --auto-remove -y \
gcc \
make \
g++ \
git && \
rm -rf /var/cache/apt && \
rm -rf /var/lib/apt/list && \
rm -rf $HOME/.cache

FROM base as dev
RUN pdm install --no-lock -G dev -G lint --no-editable

FROM dev as examples
RUN pdm install --no-lock -G examples

FROM base as test
RUN pdm install --no-lock -G test

FROM base as docs
RUN pdm install --no-lock -G docs
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FeatureFlags client library for Python

See ``examples`` directory for complete examples for some major Web frameworks.

Overview
--------

Client supports Python >=3.7.


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

TODO:


Development
-----------

Install dependencies:
- ``pdm install -d``
1 change: 0 additions & 1 deletion client/featureflags/__init__.py

This file was deleted.

22 changes: 0 additions & 22 deletions client/featureflags/client/compat.py

This file was deleted.

Loading