Patchwork [evolve-ext] setup.py: remove unused and harmful code importing mercurial

login
register
mail settings
Submitter via Mercurial-devel
Date March 9, 2017, 5:52 p.m.
Message ID <b7133ce4fc5afbcbb617.1489081971@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/19062/
State Accepted
Headers show

Comments

via Mercurial-devel - March 9, 2017, 5:52 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1489077180 28800
#      Thu Mar 09 08:33:00 2017 -0800
# Node ID b7133ce4fc5afbcbb617eba6adea7cd7f10f8b2b
# Parent  74934195747b437ac49958cbb4deb2287753e1db
setup.py: remove unused and harmful code importing mercurial

This was failing on some build system we have. The import seemed to
succeed, but then mercurial.__all__ would fail. I don't know why, but
since it's unused anyway, let's just drop it.
Pierre-Yves David - March 9, 2017, 6:22 p.m.
On 03/09/2017 09:52 AM, Martin von Zweigbergk via Mercurial-devel wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1489077180 28800
> #      Thu Mar 09 08:33:00 2017 -0800
> # Node ID b7133ce4fc5afbcbb617eba6adea7cd7f10f8b2b
> # Parent  74934195747b437ac49958cbb4deb2287753e1db
> setup.py: remove unused and harmful code importing mercurial
>
> This was failing on some build system we have. The import seemed to
> succeed, but then mercurial.__all__ would fail. I don't know why, but
> since it's unused anyway, let's just drop it.

That part was from a setup.py from Augie. From IRC, you have seen with 
him already so I'm taking the patch.

Thanks,
Augie Fackler - March 10, 2017, 12:06 a.m.
On Thu, Mar 09, 2017 at 10:22:44AM -0800, Pierre-Yves David wrote:
> On 03/09/2017 09:52 AM, Martin von Zweigbergk via Mercurial-devel wrote:
> > # HG changeset patch
> > # User Martin von Zweigbergk <martinvonz@google.com>
> > # Date 1489077180 28800
> > #      Thu Mar 09 08:33:00 2017 -0800
> > # Node ID b7133ce4fc5afbcbb617eba6adea7cd7f10f8b2b
> > # Parent  74934195747b437ac49958cbb4deb2287753e1db
> > setup.py: remove unused and harmful code importing mercurial
> >
> > This was failing on some build system we have. The import seemed to
> > succeed, but then mercurial.__all__ would fail. I don't know why, but
> > since it's unused anyway, let's just drop it.
>
> That part was from a setup.py from Augie. From IRC, you have seen with him
> already so I'm taking the patch.

I believe that's vestigial garbage that's been blindly carried around
for about a decade now. It's never done anything in that setup.py that
you inherited it from AFAICT.

>
> Thanks,
>
> --
> Pierre-Yves David
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Patch

diff -r 74934195747b -r b7133ce4fc5a setup.py
--- a/setup.py	Tue Mar 07 09:47:37 2017 -0800
+++ b/setup.py	Thu Mar 09 08:33:00 2017 -0800
@@ -30,13 +30,6 @@ 
     py_modules.append('hgext3rd.evolve.hack.inhibit')
     py_modules.append('hgext3rd.evolve.hack.directaccess')
 
-requires = []
-try:
-    import mercurial
-    mercurial.__all__
-except ImportError:
-    requires.append('mercurial>=%s' % min_hg_version())
-
 setup(
     name='hg-evolve',
     version=get_version(),