Skip to content

Commit

Permalink
Add back the paasta venv
Browse files Browse the repository at this point in the history
I think in retrospect I still want this and can pin the tox versions
outside of tox itself
  • Loading branch information
mattmb committed Mar 13, 2024
1 parent cadb9cb commit 51dbe99
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 34 deletions.
6 changes: 2 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- run: pip install tox==3.24.4
- run: pip install -U -r requirements-bootstrap.txt
- run: tox -e ${{ matrix.toxenv }}
k8s_itests:
runs-on: ubuntu-20.04
Expand All @@ -40,10 +40,8 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: '3.10'
- run: python -m pip install --upgrade pip virtualenv
- run: pip install -U -r requirements-bootstrap.txt
- run: curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- run: python -m pip install --upgrade pip
- run: pip install ephemeral-port-reserve
- run: make k8s_itests
build_debs:
runs-on: ubuntu-20.04
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-python@v2
with:
python-version: 3.7
- run: python -m pip install --upgrade pip
- run: pip install -U -r requirements-bootstrap.txt
- run: tox -e ${{ matrix.toxenv }}
pypi:
# lets run tests before we push anything to pypi, much like we do internally
Expand Down
49 changes: 27 additions & 22 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,36 +32,41 @@ endif

.PHONY: all docs test itest k8s_itests quick-test

dev:
tox
dev: .paasta/bin/activate
.paasta/bin/tox

docs:
tox -e docs
docs: .paasta/bin/activate
.paasta/bin/tox -e docs

test:
test: .paasta/bin/activate
if [ "$(PAASTA_ENV)" != "YELP" ]; then \
tox -e tests; \
.paasta/bin/tox -e tests; \
else \
tox -e tests-yelpy; \
.paasta/bin/tox -e tests-yelpy; \
fi

test-yelpy:
tox -e tests-yelpy
test-yelpy: .paasta/bin/activate
.paasta/bin/tox -e tests-yelpy

test-not-yelpy:
tox -e tests
test-not-yelpy: .paasta/bin/activate
.paasta/bin/tox -e tests

quick-test: .tox/py38-linux
TZ=UTC .tox/py38-linux/bin/py.test --failed-first -x --disable-warnings -- tests

.tox/py38-linux:
tox
.tox/py38-linux: .paasta/bin/activate
.paasta/bin/tox

dev-api: .tox/py38-linux
tox -e dev-api
.paasta/bin/tox -e dev-api

itest: test
tox -e general_itests
.paasta/bin/activate: requirements.txt requirements-dev.txt
test -d .paasta/bin/activate || virtualenv -p python3.8 .paasta
.paasta/bin/pip install -U -r requirements-bootstrap.txt
touch .paasta/bin/activate

itest: test .paasta/bin/activate
.paasta/bin/tox -e general_itests

itest_%:
# See the makefile in yelp_package/Makefile for packaging stuff
Expand Down Expand Up @@ -91,15 +96,15 @@ help:
install-hooks:
tox -e install-hooks

k8s_itests:
k8s_itests: .paasta/bin/activate
make -C k8s_itests all

.PHONY: k8s_fake_cluster
k8s_fake_cluster: .tox/py38-linux
make -C k8s_itests .fake_cluster

.PHONY: k8s_clean
k8s_clean:
k8s_clean: .paasta/bin/activate
make -C k8s_itests clean

# image source: openapitools/openapi-generator-cli:latest
Expand All @@ -126,10 +131,10 @@ swagger-validate:
-i paasta_tools/api/api_docs/swagger.json

.PHONY: vscode_settings
vscode_settings: .tox/py38-linux
.tox/py38-linux/bin/python paasta_tools/contrib/ide_helper.py
vscode_settings: .paasta/bin/activate .tox/py38-linux
.paasta/bin/python paasta_tools/contrib/ide_helper.py

etc_paasta_playground soa_config_playground: .tox/py38-linux
etc_paasta_playground soa_config_playground: .paasta/bin/activate .tox/py38-linux
.tox/py38-linux/bin/python paasta_tools/contrib/create_paasta_playground.py

.PHONY: generate_deployments_for_service
Expand All @@ -142,7 +147,7 @@ generate_deployments_for_service: | soa_config_playground .tox/py38-linux

.PHONY: playground-api
playground-api: .tox/py38-linux | soa_config_playground
tox -e playground-api
.paasta/bin/tox -e playground-api

.PHONY: setup-kubernetes-job
setup-kubernetes-job: k8s_fake_cluster generate_deployments_for_service
Expand Down
6 changes: 6 additions & 0 deletions requirements-bootstrap.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
ephemeral-port-reserve==1.1.4
pip==22.0.4
setuptools==69.1.0
tox==3.7.0
tox-pip-extensions==1.4.2
virtualenv==16.2.0
7 changes: 0 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,6 @@
skipsdist=True
envlist=py38-linux
docker_compose_version = 1.26.2
requires=
tox==3.7.0
tox-pip-extensions==1.4.2
setuptools==69.1.0
pip==22.0.4
virtualenv==16.2.0
ephemeral-port-reserve==1.1.4

[testenv]
basepython = python3.8
Expand Down

0 comments on commit 51dbe99

Please sign in to comment.