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

Parametrize Python versions in functional tests #10

Merged
merged 5 commits into from
Jan 15, 2024
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
5 changes: 4 additions & 1 deletion .github/workflows/functional-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ on:
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ "3.9", "3.10", "3.11"]

steps:
- uses: actions/checkout@v3

- name: Run functional tests on Ubuntu environment
run: docker build . -f tests/functional/Dockerfile-ubuntu -t click-test-ubuntu
run: docker build . -f tests/functional/Dockerfile-ubuntu --build-arg PYTHON_VERSION=${{ matrix.python-version }} -t click-test-ubuntu
13 changes: 13 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## [0.1.4] - 2024-01-15

### Added

- Parametrized functional testing for Ubuntu environments for Python 3.9, 3.10, 3.11 (https://github.com/KAUTH/auto-click-auto/pull/10)

### Fixed

- Autocomplete did not work properly for Python 3.11 environments.
Users can manually delete incorrectly created fish configuration file
~/.config/fish/completions/{program_name}.ShellType.FISH, created from this
bug (https://github.com/KAUTH/auto-click-auto/issues/9)

## [0.1.3] - 2023-12-28

### Fixed
Expand Down
4 changes: 2 additions & 2 deletions auto_click_auto/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def enable_click_shell_completion(
for shell in shells:

if shell in (ShellType.BASH, ShellType.ZSH):
shell_config_file = os.path.expanduser(f"~/.{shell}rc")
shell_config_file = os.path.expanduser(f"~/.{shell.value}rc")

# Completion implementation: `eval` command in shell configuration
eval_command = (
Expand Down Expand Up @@ -105,7 +105,7 @@ def enable_click_shell_completion(

elif shell == ShellType.FISH:
completer_script_path = os.path.expanduser(
f"~/.config/fish/completions/{program_name}.{shell}"
f"~/.config/fish/completions/{program_name}.{shell.value}"
)

# bash and zsh config files are generic, so we can assume the user
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "auto-click-auto"
version = "0.1.3"
version = "0.1.4"
description = "Automatically enable tab autocompletion for shells in Click CLI applications."
authors = ["Konstantinos Papadopoulos <konpap1996@yahoo.com>"]
maintainers = ["Konstantinos Papadopoulos <konpap1996@yahoo.com>"]
Expand Down
4 changes: 3 additions & 1 deletion tests/functional/Dockerfile-ubuntu
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Dockerfile for functional testing of `auto-click-auto`

ARG PYTHON_VERSION=3.10

# Base test image to re-use for each test
FROM python:3.10-slim-buster as base_test_env
FROM python:${PYTHON_VERSION}-slim-buster as base_test_env

RUN apt-get update && apt-get install -y vim zsh fish
COPY . /opt/auto-click-auto/
Expand Down