Skip to content

Commit

Permalink
Use pip-tools to lock versions of dependent packages (#2093)
Browse files Browse the repository at this point in the history
* Use pipenv

Signed-off-by: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com>

* Update coverage.xml path

Signed-off-by: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com>

* Revert "Update coverage.xml path"

This reverts commit e38eddf.

Signed-off-by: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com>

* Revert "Use pipenv"

This reverts commit da9c425.

Signed-off-by: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com>

* Use pip-tools to lock dependencies

Signed-off-by: Yusuke Nishioka <yusuke.nishioka.0713@gmail.com>
  • Loading branch information
ysk24ok authored Dec 7, 2021
1 parent 5826a9d commit 42c6eb7
Show file tree
Hide file tree
Showing 14 changed files with 2,268 additions and 11 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ jobs:
${{ steps.pip-cache.outputs.dir }}
/opt/hostedtoolcache/Python
/Users/runner/hostedtoolcache/Python
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles(format('**/py{0}-ci-requirements.txt', env.PYTHON)) }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Test python
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ on: [push, pull_request]
jobs:
lint-python:
runs-on: [ubuntu-latest]
env:
PYTHON: 3.7
steps:
- uses: actions/checkout@v2
- name: Setup Python
Expand All @@ -27,9 +29,11 @@ jobs:
${{ steps.pip-cache.outputs.dir }}
/opt/hostedtoolcache/Python
/Users/runner/hostedtoolcache/Python
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles(format('**/py{0}-ci-requirements.txt', env.PYTHON)) }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Lint python
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/pr_integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ jobs:
${{ steps.pip-cache.outputs.dir }}
/opt/hostedtoolcache/Python
/Users/runner/hostedtoolcache/Python
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles(format('**/py{0}-ci-requirements.txt', env.PYTHON)) }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Test python
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,8 @@ jobs:
container: python:3.7
steps:
- uses: actions/checkout@v2
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Publish Python Package
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/unit_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,15 @@ jobs:
${{ steps.pip-cache.outputs.dir }}
/opt/hostedtoolcache/Python
/Users/runner/hostedtoolcache/Python
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles('**/setup.py') }}
key: ${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-${{ hashFiles(format('**/py{0}-ci-requirements.txt', env.PYTHON)) }}
restore-keys: |
${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-pip-
- name: Install pip-tools
run: pip install pip-tools
- name: Install dependencies
run: make install-python-ci-dependencies
- name: Test Python
run: FEAST_USAGE=False pytest -n 8 --cov=./ --cov-report=xml --verbose --color=yes sdk/python/tests
- name: Ensure conflict-free dependencies
run: FEAST_USAGE=False pip-compile --dry-run sdk/python/setup.py --extra ci
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v1
with:
Expand All @@ -63,4 +63,4 @@ jobs:
- name: Compile protos
run: make compile-protos-go
- name: Test
run: make test-go
run: make test-go
12 changes: 10 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,11 @@ install-ci-dependencies: install-python-ci-dependencies install-java-ci-dependen
# Python SDK

install-python-ci-dependencies:
pip install -e "sdk/python[ci]"
cd sdk/python && python -m piptools sync requirements/py$(PYTHON)-ci-requirements.txt
cd sdk/python && python setup.py develop

lock-python-ci-dependencies:
cd sdk/python && python -m piptools compile -U --extra ci --output-file requirements/py$(PYTHON)-ci-requirements.txt

package-protos:
cp -r ${ROOT_DIR}/protos ${ROOT_DIR}/sdk/python/feast/protos
Expand All @@ -50,7 +54,11 @@ compile-protos-python:
@$(foreach dir,$(PROTO_TYPE_SUBDIRS),grep -rli 'from feast.$(dir)' sdk/python/feast/protos | xargs -I@ sed -i.bak 's/from feast.$(dir)/from feast.protos.feast.$(dir)/g' @;)

install-python:
python -m pip install -e sdk/python -U --use-deprecated=legacy-resolver
cd sdk/python && python -m piptools sync requirements/py$(PYTHON)-requirements.txt
cd sdk/python && python setup.py develop

lock-python-dependencies:
cd sdk/python && python -m piptools compile -U --output-file requirements/py$(PYTHON)-requirements.txt

benchmark-python:
FEAST_USAGE=False IS_TEST=True python -m pytest --integration --benchmark --benchmark-autosave --benchmark-save-data sdk/python/tests
Expand Down
2 changes: 1 addition & 1 deletion infra/scripts/test-end-to-end.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ infra/scripts/download-maven-cache.sh --archive-uri ${MAVEN_CACHE} --output-dir
apt-get update && apt-get install -y redis-server postgresql libpq-dev

make build-java-no-tests REVISION=develop
python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel pip-tools
make install-python
python -m pip install -qr tests/requirements.txt
export FEAST_USAGE="False"
Expand Down
2 changes: 1 addition & 1 deletion infra/scripts/test-integration.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

python -m pip install --upgrade pip setuptools wheel
python -m pip install --upgrade pip setuptools wheel pip-tools
make install-python
python -m pip install -qr tests/requirements.txt

Expand Down
Loading

0 comments on commit 42c6eb7

Please sign in to comment.