Skip to content

Commit

Permalink
build: Use poetry build system to match SDK (#19)
Browse files Browse the repository at this point in the history
  • Loading branch information
keelerm84 committed Apr 26, 2024
1 parent af9a2c3 commit e8f677f
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 6 deletions.
7 changes: 5 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,14 @@ jobs:
with:
python-version: 3.8

- name: Install poetry
uses: abatilo/actions-poetry@7b6d33e44b4f08d7021a1dee3c044e9c253d6439

- name: Install dependencies
run: pip install --user -r requirements.txt
run: poetry install

- uses: launchdarkly/gh-actions/actions/verify-hello-app@verify-hello-app-v1.0.1
with:
use_server_key: true
role_arn: ${{ vars.AWS_ROLE_ARN }}
command: python main.py
command: poetry run python main.py
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.python-version
poetry.lock
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ This demo requires Python 3.8 or higher.
export LAUNCHDARKLY_FLAG_KEY="my-boolean-flag"
```

1. Install the required dependencies with `pip install -r requirements.txt`.
1. On the command line, run `python main.py`
1. Ensure you have [Poetry](https://python-poetry.org/) installed.
1. Install the required dependencies with `poetry install`.
1. On the command line, run `poetry run python main.py`

You should receive the message "The <flagKey> feature flag evaluates to <flagValue>.". The application will run continuously and react to the flag changes in LaunchDarkly.
17 changes: 17 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[tool.poetry]
name = "main"
version = "0.1.0"
description = "Hello LaunchDarkly for Python"
authors = ["LaunchDarkly <dev@launchdarkly.com>"]
license = "Apache-2.0"
readme = "README.md"

[tool.poetry.dependencies]
python = "^3.8"
launchdarkly-server-sdk = ">=9.0.0"
halo = ">=0.0.3"


[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"
2 changes: 0 additions & 2 deletions requirements.txt

This file was deleted.

0 comments on commit e8f677f

Please sign in to comment.