Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Specify test dependencies using poetry #506

Merged
merged 1 commit into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 3 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,19 @@ jobs:
steps:
- name: Bootstrap Debian system package dependencies
run: |
apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates
apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates \
python3-poetry
- uses: actions/checkout@v4
with:
lfs: true
- name: Install additional packages and Python dependencies
run: |
# Installs Python & bootstrap wheels, and initializes a virtualenv at .venv
make install-deps
./.venv/bin/pip install -r test-requirements.txt
poetry install --no-ansi
- name: Run linters
run: |
. ./.venv/bin/activate
make lint
- name: Run tests except reprotest
run: |
. ./.venv/bin/activate
make test

checksums:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/reprotest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,17 @@ jobs:
steps:
- name: Bootstrap Debian system package dependencies
run: |
apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates
apt-get update && apt-get install --yes --no-install-recommends make sudo git git-lfs ca-certificates \
python3-poetry
- uses: actions/checkout@v4
with:
lfs: true
- name: Install additional packages and Python dependencies
run: |
# Installs Python & bootstrap wheels, and initializes a virtualenv at .venv
make install-deps
./.venv/bin/pip install -r test-requirements.txt
# Install poetry deps into the .venv
poetry install --no-ansi
- name: Test wheel reproducibility
run: |
# Necessary to enable git operations without permission issues
Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ SHELL := /bin/bash

.PHONY: lint
lint:
@ruff check .
@ruff format --check .
@poetry run ruff check .
@poetry run ruff format --check .

.PHONY: fix
fix:
@ruff check . --fix
@ruff format .
@poetry run ruff check . --fix
@poetry run ruff format .

.PHONY: install-deps
install-deps: ## Install initial wheel building dependencies
Expand All @@ -28,11 +28,11 @@ build-wheels: ## Builds the wheels and adds them to the wheels subdirectory

.PHONY: test
test: ## Run simple test suite (skips reproducibility checks)
pytest -v tests/test_update_requirements.py tests/test_utils.py
poetry run pytest -v tests/test_update_requirements.py tests/test_utils.py

.PHONY: reprotest
reprotest: ## Runs only reproducibility tests for .whl files
pytest -vvs tests/test_reproducible_wheels.py
poetry run pytest -vvs tests/test_reproducible_wheels.py

.PHONY: help
help: ## Prints this message and exits
Expand Down
129 changes: 129 additions & 0 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,21 @@ name = "securedrop-builder"
version = "0.1.0"
requires-python = ">=3.9"

[tool.poetry]
name = "securedrop-builder"
version = "0.1.0"
description = ""
authors = []

[tool.poetry.dependencies]
python = ">=3.11"

[tool.poetry.group.dev.dependencies]
pytest = "*"
pytest-mock = "*"
ruff = "*"
virtualenv = "<16"

[tool.ruff]
line-length = 100

Expand Down
4 changes: 0 additions & 4 deletions test-requirements.txt

This file was deleted.

Loading