public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Benjamin A. Beasley <code@musicinmybrain.net>
To: git-commits@fedoraproject.org
Subject: [rpms/python-nodeenv] f44: Update to 1.12.0 (close RHBZ#2563723)
Date: Tue, 03 Nov 2026 09:25:45 GMT	[thread overview]
Message-ID: <179369794544.1.5001212635916178272.rpms-python-nodeenv-05e71817e310@fedoraproject.org> (raw)

            A new commit has been pushed.

            Repo   : rpms/python-nodeenv
            Branch : f44
            Commit : 05e71817e31006f9ac56e0f09dba186a84203365
            Author : Benjamin A. Beasley <code@musicinmybrain.net>
            Date   : 2026-11-01T10:04:54+00:00
            Stats  : +57/-11 in 3 file(s)
            URL    : https://src.fedoraproject.org/rpms/python-nodeenv/c/05e71817e31006f9ac56e0f09dba186a84203365?branch=f44

            Log:
            Update to 1.12.0 (close RHBZ#2563723)

- Add support for installing shell completions, waiting for shtab≥1.11

Since this release requires Python 3.10 and EPEL9 has Python 3.9, no
longer accommodate EPEL9 limitations in the spec file.

---
diff --git a/.gitignore b/.gitignore
index 8ba5c05..2f67142 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,3 +5,4 @@
 /nodeenv-1.10.0.tar.gz
 /nodeenv-1.11.0.tar.gz
 /nodeenv-1.11.1.tar.gz
+/nodeenv-1.12.0.tar.gz

diff --git a/python-nodeenv.spec b/python-nodeenv.spec
index 22f5fa4..9dc3a5f 100644
--- a/python-nodeenv.spec
+++ b/python-nodeenv.spec
@@ -1,5 +1,10 @@
+# Generating shell completions requires shtab 1.11.0 or later,
+# https://bugzilla.redhat.com/show_bug.cgi?id=2415592,
+# https://src.fedoraproject.org/rpms/python-shtab/pull-request/2
+%bcond completion 0
+
 Name:           python-nodeenv
-Version:        1.11.1
+Version:        1.12.0
 Release:        %autorelease
 Summary:        Node.js virtual environment builder
 
@@ -41,21 +46,29 @@ Summary:        %{summary}
 %description -n python3-nodeenv %{_description}
 
 
-%pyproject_extras_subpkg -n python3-nodeenv certifi
+%pyproject_extras_subpkg --name python3-nodeenv certifi
+%if %{with completion}
+%pyproject_extras_subpkg --name python3-nodeenv completion
+%endif
 
 
 %prep
 %autosetup -n nodeenv-%{version} -p1
 
 # https://docs.fedoraproject.org/en-US/packaging-guidelines/Python/#_linters
-sed -r -i "s@'coverage', 'run', '-p',@'%{python3}',@" tests/nodeenv_test.py
+sed --regexp-extended --in-place \
+    "s@'coverage', 'run', '-p',@'%{python3}',@" tests/nodeenv_test.py
 
 # Remove unwanted shebangs from files that will not have the executable bit set
-sed -r -i '1{/^#!/d}' nodeenv.py
+sed --regexp-extended --in-place '1{/^#!/d}' nodeenv.py
+
+# Upstream wants shtab >=1.11, but we can get by with older releases
+# https://bugzilla.redhat.com/show_bug.cgi?id=2415592
+sed --regexp-extended --in-place "s/(shtab)>=[^'\"]+/\\1/" setup.py
 
 
 %generate_buildrequires
-%pyproject_buildrequires -x certifi
+%pyproject_buildrequires --extras certifi%{?with_completion:,completion}
 
 
 %build
@@ -64,21 +77,48 @@ sed -r -i '1{/^#!/d}' nodeenv.py
 
 %install
 %pyproject_install
-%pyproject_save_files -l nodeenv
+%pyproject_save_files --assert-license nodeenv
+
+# Set up the environment to generate the man page and completions using the
+# installed entry point. See %%{py3_test_envvars} on EPEL10+ and Fedora.
+export PYTHONPATH='%{buildroot}%{python3_sitelib}'
+export PYTHONDONTWRITEBYTECODE=1
 
 # Generate the man page here, rather than in %%build, so that the executable
 # script entry point is readily available.
-install -d '%{buildroot}%{_mandir}/man1'
-PYTHONPATH='%{buildroot}%{python3_sitelib}' \
-    help2man --no-info --output='%{buildroot}%{_mandir}/man1/nodeenv.1' \
+install --directory '%{buildroot}%{_mandir}/man1'
+help2man --no-info --output='%{buildroot}%{_mandir}/man1/nodeenv.1' \
     '%{buildroot}%{_bindir}/nodeenv'
 
+%if %{with completions}
+# From the message for
+# https://github.com/ekalinin/nodeenv/commit/0fd263f58fd232b6b6a8e8def2401db885eb3d7d,
+#
+#   --print-completion SHELL prints a completion script for bash, zsh, fish or
+#   PowerShell, made by shtab from the same parser that reads the command line.
+#   shtab is an optional dependency, installed with the completion extra, and
+#   only this flag imports it: without shtab the flag stays in --help and exits
+#   with the pip command to run.
+#
+# Pre-generate and install the completion files.
+while read -r shell target
+do
+  install --directory "%{buildroot}$(dirname "${target}")"
+  '%{buildroot}%{_bindir}/nodeenv' --print-completion "${shell}" \
+      > "%{buildroot}${target}"
+done <<'EOF'
+bash %{bash_completions_dir}/nodeenv
+zsh %{zsh_completions_dir}/_nodeenv
+fish %{fish_completions_dir}/nodeenv.fish
+EOF
+%endif
+
 
 %check
 # Requires network access:
 k="${k-}${k+ and }not test_smoke"
 
-%pytest -k "${k-}" -v
+%pytest -k "${k-}" --verbose
 
 
 %files -n python3-nodeenv -f %{pyproject_files}
@@ -88,6 +128,11 @@ k="${k-}${k+ and }not test_smoke"
 
 %{_bindir}/nodeenv
 %{_mandir}/man1/nodeenv.1*
+%if %{with completions}
+%{bash_completions_dir}/nodeenv
+%{zsh_completions_dir}/_nodeenv
+%{fish_completions_dir}/nodeenv.fish
+%endif
 
 
 %changelog

diff --git a/sources b/sources
index 9a9f690..31caead 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-SHA512 (nodeenv-1.11.1.tar.gz) = ac0dc6a8ce12e5422392e777b6dde03c4c254cccd55d862e53c5467a4b1830ef31c0af8a71915923f288b6d363b48e2f12f92c29d443fcd183e4da38fde45e90
+SHA512 (nodeenv-1.12.0.tar.gz) = 965fe7110e1241ce10f0a3eb63c57177caf0504758e0bfa538cca5c0d4d06954db43154f866aa73710161004de476af019e38ac9355dc16b7c094c70495d21d2

                 reply	other threads:[~2026-11-03  9:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179369794544.1.5001212635916178272.rpms-python-nodeenv-05e71817e310@fedoraproject.org \
    --to=code@musicinmybrain.net \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox