#11 Install shell completion files
Closed 2 years ago by churchyard. Opened 2 years ago by defolos.
rpms/ defolos/poetry f34  into  f34

file modified
+15 -1
@@ -5,7 +5,7 @@ 

  Name:           poetry

  Summary:        Python dependency management and packaging made easy

  Version:        1.1.5

- Release:        1%{?dist}

+ Release:        2%{?dist}

  

  License:        MIT

  
@@ -61,6 +61,13 @@ 

  %pyproject_install

  %pyproject_save_files poetry

  

+ export PYTHONPATH=%{buildroot}%{python3_sitelib}

+ for i in bash,bash-completion/completions,poetry fish,fish/completions,poetry.fish zsh,zsh/site-functions,_poetry; do IFS=","

+     set -- $i

+     mkdir -p %{buildroot}%{_datadir}/$2

+     # poetry leaves references to the buildroot in the completion files -> remove them

+     %{buildroot}%{_bindir}/poetry completions $1 | sed 's|%{buildroot}||g' > %{buildroot}%{_datadir}/$2/$3

+ done

  

  %check

  # don't use %%tox here because tox.ini runs "poetry install"
@@ -72,6 +79,10 @@ 

  

  %files

  %{_bindir}/poetry

+ # The directories with shell completions are co-woned

+ %{_datadir}/bash-completion/

+ %{_datadir}/fish/

+ %{_datadir}/zsh/

  

  

  %files -n python3-poetry -f %{pyproject_files}
@@ -86,6 +97,9 @@ 

  

  

  %changelog

+ * Wed Jun  9 2021 Dan Čermák <dan.cermak@cgc-instruments.com> - 1.1.5-2

+ - Install shell completion files

+ 

  * Fri Mar 05 2021 Tomas Hrnciar <thrnciar@redhat.com> - 1.1.5-1

  - Update to version 1.1.5

  

no initial comment

Build succeeded.

The directories need to be co-owned.

Suggestion: run the sed in a pipe in the commands above before dumping them to files. E.g.:

%{buildroot}%{_bindir}/poetry completions bash | sed 's|%{buildroot}||g' > %{buildroot}%{_sysconfdir}/bash_completion.d/%{name}.bash-completion

rebased onto aa79df196edd68fd757ba73d580ce23203d56d9f

2 years ago

The directories are now co-owned and the completion generation is simplified a bit.

Build succeeded.

Thanks for the changes. However, all of the directories need to be co-owned. Even the following ones:

%{_datadir}/bash-completion
%{_datadir}/fish
%{_datadir}/zsh

That is because the package does not require bash-completion, fish and shell.

The easiest way to do it is to include them directly in the %files section. I.e. replace:

%dir %{_datadir}/bash-completion/completions
%dir %{_datadir}/fish/completions
%dir %{_datadir}/zsh/site-functions
%{_datadir}/bash-completion/completions/%{name}
%{_datadir}/fish/completions/%{name}.fish
%{_datadir}/zsh/site-functions/_%{name}

With:

# The directories with shell completions are co-woned
%{_datadir}/bash-completion/
%{_datadir}/fish/
%{_datadir}/zsh/

As a personal style nitpick: I'd prefer poetry over %{name} in the added code snippet (for consistency, we don't use %{name} in the spec to refer to files).

Language nitpicks: "poetry polutes leaves references" seems like a redundant verb, also my spellchecker says it shall be "pollutes"

rebased onto 95ddc6d

2 years ago

Language nitpicks: "poetry polutes leaves references" seems like a redundant verb, also my spellchecker says it shall be "pollutes"

Whoops, that sentence doesn't make a whole lot of sense… Should be fixed now, as well as the directory ownership issues.

Build succeeded.

Looks good. Please also update #12.

@thrnciar do we diverge branches or can we update poetry in f34?

@thrnciar do we diverge branches or can we update poetry in f34?

Latest version contains only fixes so I think we can safely update poetry also on F34. I have opened PR #13 to backport it.

In that case closing in favor of #12

Pull-Request has been closed by churchyard

2 years ago
Metadata