Skip to content

Commit 9fb70fe

Browse files
authored
Merge pull request #9 from nyu-devops/sp25-updates
Spring Semester 2025 Updates
2 parents a59f5b4 + 6dfd620 commit 9fb70fe

File tree

8 files changed

+39
-176
lines changed

8 files changed

+39
-176
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ FROM quay.io/rofrano/python:3.11-slim
33

44
# Add any tools that are needed beyond Python 3.11
55
RUN apt-get update && \
6-
apt-get install -y sudo vim make git zip tree curl wget jq procps net-tools && \
6+
apt-get install -y sudo vim make git zip tree curl wget jq procps net-tools iputils-ping && \
77
apt-get autoremove -y && \
88
apt-get clean -y
99

.devcontainer/devcontainer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,14 @@
5555
"tamasfe.even-better-toml",
5656
"donjayamanne.githistory",
5757
"GitHub.vscode-pull-request-github",
58+
"github.vscode-github-actions",
5859
"hbenl.vscode-test-explorer",
5960
"LittleFoxTeam.vscode-python-test-adapter",
6061
"redhat.vscode-yaml",
62+
"unjinjang.rest-api-client",
6163
"ms-azuretools.vscode-docker",
62-
"inercia.vscode-k3d",
6364
"ms-kubernetes-tools.vscode-kubernetes-tools",
65+
"inercia.vscode-k3d",
6466
"redhat.vscode-openshift-connector",
6567
"streetsidesoftware.code-spell-checker",
6668
"bbenoist.vagrant"

.devcontainer/scripts/setup-lab.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22
echo "**********************************************************************"
3-
echo "Setting up Docker lab environment..."
4-
echo "**********************************************************************"
3+
echo "Setting up OpenShift lab environment..."
4+
echo "**********************************************************************\n"
55

66
echo "Pulling custom Python:3.11-slim image from quay.io..."
77
docker pull quay.io/rofrano/python:3.11-slim
@@ -13,6 +13,6 @@ sudo bash -c "echo '127.0.0.1 cluster-registry' >> /etc/hosts"
1313
echo "Making git stop complaining about unsafe folders"
1414
git config --global --add safe.directory /app
1515

16-
echo "**********************************************************************"
16+
echo "\n**********************************************************************"
1717
echo "Setup complete"
1818
echo "**********************************************************************"

.tekton/pipeline.yaml

Lines changed: 0 additions & 149 deletions
This file was deleted.

.tekton/tasks.yaml

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@ spec:
1717
- name: source
1818
description: The workspace with the source code.
1919
description: >-
20-
Use to run pylint on the provided input source. If Poetry is being used
21-
it will detect the poetry.lock file and install via requirements export.
20+
Use to run pylint on the provided input source.
21+
If Poetry or Pipenv is being used it will detect
22+
the poetry.lock and Pipfile file and install using them.
2223
params:
2324
- name: image
2425
description: The container image with pylint
@@ -49,6 +50,10 @@ spec:
4950
python -m pip install --upgrade pip poetry
5051
poetry config virtualenvs.create false
5152
poetry install
53+
elif [ -e "Pipfile" ]; then
54+
echo "Found Pipfile file: using pipenv ..."
55+
python -m pip install --upgrade pip pipenv
56+
pipenv install --system --dev
5257
elif [ -n "$(params.requirements-file)" ] && [ -e "$(params.requirements-file)" ]; then
5358
python -m pip install --user -r "$(params.requirements-file)"
5459
fi
@@ -79,7 +84,7 @@ spec:
7984
- name: source
8085
description: >-
8186
This task can be used to perform unit tests with pytest.
82-
It supports both requirements.txt and poetry.lock files.
87+
It supports both requirements.txt, Pipfile, & poetry.lock files.
8388
8489
It also has the ability to create an environment variable
8590
that is sourced from a Secret. This allows you to define
@@ -118,6 +123,10 @@ spec:
118123
python -m pip install --upgrade pip poetry
119124
poetry config virtualenvs.create false
120125
poetry install
126+
elif [ -e "Pipfile" ]; then
127+
echo "Found Pipfile file: using pipenv ..."
128+
python -m pip install --upgrade pip pipenv
129+
pipenv install --system --dev
121130
elif -e "requirements.txt" ]; then
122131
python -m pip install --user -r requirements.txt
123132
fi
@@ -259,7 +268,7 @@ spec:
259268
default: "chrome"
260269
steps:
261270
- name: behave
262-
image: rofrano/pipeline-selenium
271+
image: quay.io/rofrano/pipeline-selenium
263272
workingDir: $(workspaces.source.path)
264273
env:
265274
- name: BASE_URL
@@ -278,6 +287,10 @@ spec:
278287
echo "Found poetry.lock file: using poetry"
279288
python -m pip install poetry poetry-plugin-export
280289
poetry export --with=dev -f requirements.txt --output requirements.txt
290+
elif [ -e "Pipfile" ]; then
291+
echo "Found Pipfile file: using pipenv ..."
292+
python -m pip install --upgrade pip pipenv
293+
pipenv requirements --dev > requirements.txt
281294
fi
282295
python -m pip install --user -r requirements.txt
283296

Makefile

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,17 @@ clean: ## Removes all dangling build cache
2424
docker image prune -f
2525
docker buildx prune -f
2626

27-
.PHONY: venv
28-
venv: ## Create a Python virtual environment
29-
$(info Creating Python 3 virtual environment...)
30-
poetry shell
31-
3227
.PHONY: install
3328
install: ## Install Python dependencies
3429
$(info Installing dependencies...)
35-
poetry config virtualenvs.create false
36-
poetry install
30+
sudo pipenv install --system --dev
3731

3832
.PHONY: lint
3933
lint: ## Run the linter
4034
$(info Running linting...)
41-
flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
42-
flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
43-
pylint service tests --max-line-length=127
35+
-flake8 service tests --count --select=E9,F63,F7,F82 --show-source --statistics
36+
-flake8 service tests --count --max-complexity=10 --max-line-length=127 --statistics
37+
-pylint service tests --max-line-length=127
4438

4539
.PHONY: test
4640
test: ## Run the unit tests
@@ -67,7 +61,7 @@ cluster: ## Create a K3D Kubernetes cluster with load balancer and registry
6761
.PHONY: cluster-rm
6862
cluster-rm: ## Remove a K3D Kubernetes cluster
6963
$(info Removing Kubernetes cluster...)
70-
k3d cluster delete nyu-devops
64+
k3d cluster delete $(CLUSTER)
7165

7266
.PHONY: tekton
7367
tekton: ## Install Tekton

Pipfile

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ python-dotenv = "~=1.0.1"
1212
gunicorn = "~=23.0.0"
1313

1414
[dev-packages]
15-
black = "~=25.1.0"
16-
coverage = "~=7.6.10"
17-
flake8 = "~=7.1.1"
15+
honcho = "~=2.0.0"
1816
pylint = "~=3.3.4"
17+
flake8 = "~=7.1.1"
18+
black = "~=25.1.0"
1919
pytest = "~=8.3.4"
2020
pytest-pspec = "~=0.0.4"
2121
pytest-cov = "~=6.0.0"
22-
factory-boy = "~=3.3.1"
23-
honcho = "~=2.0.0"
22+
factory-boy = "~=3.3.3"
23+
coverage = "~=7.6.12"
2424
httpie = "~=3.2.4"
2525

2626
[requires]

setup.cfg

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ testpaths =
1616
max-line-length = 127
1717

1818
[pylint.'MESSAGES CONTROL']
19-
disable = "no-member,protected-access,global-statement"
19+
disable = no-member,protected-access,global-statement
2020

2121
# setup Flake8 configuration
2222
[flake8]
@@ -32,7 +32,9 @@ line-length = 127
3232
# Setup Coverage configuration
3333
[coverage:run]
3434
source = service
35-
omit = venv/*
35+
omit =
36+
venv/*
37+
.venv/*
3638

3739
[coverage:report]
3840
show_missing = true
@@ -47,3 +49,4 @@ ignore_errors = true
4749

4850
[coverage:html]
4951
title = 'Test Coverage Report'
52+
directory = 'coverage_report'

0 commit comments

Comments
 (0)