Skip to content

Commit ffe82fd

Browse files
authored
Publish alternative python sdk with FEAST_USAGE=False by default (feast-dev#2275)
Signed-off-by: pyalex <moskalenko.alexey@gmail.com>
1 parent f68dd88 commit ffe82fd

File tree

3 files changed

+26
-2
lines changed

3 files changed

+26
-2
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,27 @@ jobs:
144144
python3 setup.py sdist bdist_wheel
145145
python3 -m twine upload --verbose dist/*
146146
147+
publish-python-sdk-no-telemetry:
148+
runs-on: ubuntu-latest
149+
env:
150+
TWINE_USERNAME: __token__
151+
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
152+
container: python:3.7
153+
steps:
154+
- uses: actions/checkout@v2
155+
- name: Install pip-tools
156+
run: pip install pip-tools
157+
- name: Install dependencies
158+
run: make install-python-ci-dependencies PYTHON=3.7
159+
- name: Publish Python Package
160+
run: |
161+
cd sdk/python
162+
sed -i 's/DEFAULT_FEAST_USAGE_VALUE = "True"/DEFAULT_FEAST_USAGE_VALUE = "False"/g' feast/constants.py
163+
sed -i 's/NAME = "feast"/NAME = "feast-no-telemetry"/g' setup.py
164+
python3 -m pip install --user --upgrade setuptools wheel twine
165+
python3 setup.py sdist bdist_wheel
166+
python3 -m twine upload --verbose dist/*
167+
147168
publish-java-sdk:
148169
container: maven:3.6-jdk-11
149170
runs-on: ubuntu-latest

sdk/python/feast/constants.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
# Environment variable for toggling usage
3030
FEAST_USAGE = "FEAST_USAGE"
3131

32+
# Default value for FEAST_USAGE when environment variable is not set
33+
DEFAULT_FEAST_USAGE_VALUE = "True"
34+
3235
# Environment variable for the path for overwriting universal test configs
3336
FULL_REPO_CONFIGS_MODULE_ENV_NAME: str = "FULL_REPO_CONFIGS_MODULE"
3437

sdk/python/feast/usage.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@
2929

3030
import requests
3131

32-
from feast.constants import FEAST_USAGE
32+
from feast.constants import DEFAULT_FEAST_USAGE_VALUE, FEAST_USAGE
3333
from feast.version import get_version
3434

3535
USAGE_ENDPOINT = "https://usage.feast.dev"
3636

3737
_logger = logging.getLogger(__name__)
3838
_executor = concurrent.futures.ThreadPoolExecutor(max_workers=1)
3939

40-
_is_enabled = os.getenv(FEAST_USAGE, default="True") == "True"
40+
_is_enabled = os.getenv(FEAST_USAGE, default=DEFAULT_FEAST_USAGE_VALUE) == "True"
4141

4242
_constant_attributes = {
4343
"session_id": str(uuid.uuid4()),

0 commit comments

Comments
 (0)