Patchwork D12482: setup: fix incomplete implementation of Command

login
register
mail settings
Submitter phabricator
Date April 7, 2022, 1:29 p.m.
Message ID <differential-rev-PHID-DREV-4yk3vpocu6g3wfs6emmu-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/50828/
State New
Headers show

Comments

phabricator - April 7, 2022, 1:29 p.m.
Alphare created this revision.
Alphare added a comment.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.


  Pending CI refresh

REVISION SUMMARY
  `test-install.t` fails without the `get_outputs` method being implemented,
  which is used when, `self.report` is `True`.
  
  When 8d7eaff92f9c <https://phab.mercurial-scm.org/rHG8d7eaff92f9cc4c7156a2e217123b798e76fcf60> introduced this change, they probably ran `test-install.t`
  without `HGTESTS_ALLOW_NETIO=1`, which does not trigger this codepath.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D12482

AFFECTED FILES
  setup.py

CHANGE DETAILS




To: Alphare, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -1110,12 +1110,16 @@ 
 
     def initialize_options(self):
         self.install_dir = None
+        self.outputs = []
 
     def finalize_options(self):
         self.set_undefined_options(
             'install_data', ('install_dir', 'install_dir')
         )
 
+    def get_outputs(self):
+        return self.outputs
+
     def run(self):
         for src, dir_path, dest in (
             (
@@ -1127,9 +1131,10 @@ 
         ):
             dir = os.path.join(self.install_dir, *dir_path)
             self.mkpath(dir)
-            self.copy_file(
-                os.path.join('contrib', src), os.path.join(dir, dest)
-            )
+
+            dest = os.path.join(dir, dest)
+            self.outputs.append(dest)
+            self.copy_file(os.path.join('contrib', src), dest)
 
 
 # virtualenv installs custom distutils/__init__.py and