Skip to content

Commit

Permalink
Merge branch 'main' into fix-100
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea authored Mar 4, 2024
2 parents 10d5df6 + d82470d commit 4aa3155
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: python3 -m pip install --user tox

- name: Check out src from Git
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0 # needed by setuptools-scm

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
runs-on: ubuntu-22.04
steps:
- name: Check out code
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0

Expand Down
14 changes: 7 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ exclude: |
)
repos:
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.2.0
hooks:
- id: black
language_version: python3
- repo: https://github.com/pre-commit/pre-commit-hooks.git
rev: v4.4.0
rev: v4.5.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
Expand All @@ -25,7 +25,7 @@ repos:
- id: debug-statements
language_version: python3
- repo: https://github.com/pycqa/flake8.git
rev: 6.0.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -35,14 +35,14 @@ repos:
- pydocstyle>=5.1.1
language_version: python3
- repo: https://github.com/adrienverge/yamllint.git
rev: v1.32.0
rev: v1.35.1
hooks:
- id: yamllint
files: \.(yaml|yml)$
types: [file, yaml]
entry: yamllint --strict
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
rev: v1.8.0
hooks:
- id: mypy
# empty args needed in order to match mypy cli behavior
Expand All @@ -53,7 +53,7 @@ repos:
- pytest>=6.1.2
- enrich>=1.2.5
- repo: https://github.com/PyCQA/pylint
rev: v3.0.3
rev: v3.1.0
hooks:
- id: pylint
additional_dependencies:
Expand Down
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ py3-ruamel.yaml \

RUN \
apk add --update --no-cache \
${BUILD_DEPS} && \
pip3 install -U pip
${BUILD_DEPS}

COPY . /root/code/
WORKDIR /root/code/
RUN \
python3 --version && \
python3 -m venv venv && \
. venv/bin/activate && \
python3 -m pip install ".[test]" && \
python3 -m pytest
2 changes: 1 addition & 1 deletion molecule/default/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
dependency:
name: galaxy
driver:
name: delegated
name: default
platforms:
- name: instance
provisioner:
Expand Down
1 change: 0 additions & 1 deletion readthedocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ build:
python: "3.11"

python:
system_packages: false
install:
- method: pip
path: .
Expand Down
1 change: 1 addition & 0 deletions src/subprocess_tee/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""tee like run implementation."""

import asyncio
import os
import platform
Expand Down
7 changes: 7 additions & 0 deletions test/test_func.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
"""Functional tests for subprocess-tee library."""

import subprocess
import sys

import pytest


@pytest.mark.skipif(
sys.version_info < (3, 9), reason="molecule test requires python 3.9+"
)
def test_molecule() -> None:
"""Ensures molecule does display output of its subprocesses."""
result = subprocess.run(
Expand Down
1 change: 1 addition & 0 deletions test/test_rich.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Tests for rich module."""

import sys

import pytest
Expand Down
8 changes: 8 additions & 0 deletions test/test_unit.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Unittests."""

import subprocess
import sys
from typing import Dict
Expand Down Expand Up @@ -148,3 +149,10 @@ def test_run_compat() -> None:
assert ours.stdout == original.stdout
assert ours.stderr == original.stderr
assert ours.args == original.args


def test_run_waits_for_completion(tmp_path):
"""run() should always wait for the process to complete."""
tmpfile = tmp_path / "output.txt"
run(f"sleep 0.1 && echo 42 > {str(tmpfile)}")
assert tmpfile.read_text() == "42\n"
3 changes: 2 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ passenv =
TERM
setenv =
PIP_DISABLE_VERSION_CHECK=1
PYTEST_REQPASS=15
PYTEST_REQPASS=16
py38: PYTEST_REQPASS=15
PYTHONDONTWRITEBYTECODE=1
PYTHONUNBUFFERED=1
commands =
Expand Down

0 comments on commit 4aa3155

Please sign in to comment.