Patchwork [3,of,6] packaging: upgrade Debian packaging to build with Python 3

login
register
mail settings
Submitter Denis Laxalde
Date Oct. 21, 2019, 10 a.m.
Message ID <09f95d7a20c6d2e0bf62.1571652055@marimba>
Download mbox | patch
Permalink /patch/42509/
State Accepted
Headers show

Comments

Denis Laxalde - Oct. 21, 2019, 10 a.m.
# HG changeset patch
# User Denis Laxalde <denis@laxalde.org>
# Date 1571648394 -7200
#      Mon Oct 21 10:59:54 2019 +0200
# Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
# Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
packaging: upgrade Debian packaging to build with Python 3

Also drop the explicit "Depends: python" as debhelper will add it.
Yuya Nishihara - Oct. 21, 2019, 1:43 p.m.
On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> # HG changeset patch
> # User Denis Laxalde <denis@laxalde.org>
> # Date 1571648394 -7200
> #      Mon Oct 21 10:59:54 2019 +0200
> # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> packaging: upgrade Debian packaging to build with Python 3
> 
> Also drop the explicit "Depends: python" as debhelper will add it.

So, are we ready to ship py3 version as stable?
I know it's planned for 5.2, but I have no idea about the current state.
via Mercurial-devel - Oct. 21, 2019, 2:38 p.m.
On Mon, Oct 21, 2019, 06:57 Yuya Nishihara <yuya@tcha.org> wrote:

> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > # HG changeset patch
> > # User Denis Laxalde <denis@laxalde.org>
> > # Date 1571648394 -7200
> > #      Mon Oct 21 10:59:54 2019 +0200
> > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > packaging: upgrade Debian packaging to build with Python 3
> >
> > Also drop the explicit "Depends: python" as debhelper will add it.
>
> So, are we ready to ship py3 version as stable?
> I know it's planned for 5.2, but I have no idea about the current state.
>

I'm a bit uncomfortable with shipping it since we have probably had pretty
much no testing of it on real users (including ourselves). How many here
have been running py3 hg for a while? I have only tried it for an hour or
so before I ran into a problem with our internal extension, so I don't
really know how well it works.
Denis Laxalde - Oct. 21, 2019, 3:32 p.m.
Martin von Zweigbergk a écrit :
> On Mon, Oct 21, 2019, 06:57 Yuya Nishihara <yuya@tcha.org> wrote:
> 
> > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > # HG changeset patch
> > > # User Denis Laxalde <denis@laxalde.org>
> > > # Date 1571648394 -7200
> > > #      Mon Oct 21 10:59:54 2019 +0200
> > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > packaging: upgrade Debian packaging to build with Python 3
> > >
> > > Also drop the explicit "Depends: python" as debhelper will add it.
> >
> > So, are we ready to ship py3 version as stable?
> > I know it's planned for 5.2, but I have no idea about the current state.

That's how I interpreted recent announces:

  https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-October/134689.html
  https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-October/134989.html

but perhaps I'm a bit optimistic...

> I'm a bit uncomfortable with shipping it since we have probably had pretty
> much no testing of it on real users (including ourselves). How many here
> have been running py3 hg for a while? I have only tried it for an hour or
> so before I ran into a problem with our internal extension, so I don't
> really know how well it works.

I've been using hg with py3 for a several weeks now; I've fixed all
issues I discovered quite quickly. The only third party extension I use
is Evolve. Now it's stable as far as my usage is concerned, though this
is mostly on client side less on server side.

Aside, it's not clear to me who is actually using the Debian packaging
in our repository as it differs from the one in Debian. I, for one, have
always used the latter and have therefore started adjusting that one
first.

Anyways, just let me know if this premature.
Gregory Szorc - Oct. 21, 2019, 4:01 p.m.
On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:

> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > # HG changeset patch
> > # User Denis Laxalde <denis@laxalde.org>
> > # Date 1571648394 -7200
> > #      Mon Oct 21 10:59:54 2019 +0200
> > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > packaging: upgrade Debian packaging to build with Python 3
> >
> > Also drop the explicit "Depends: python" as debhelper will add it.
>
> So, are we ready to ship py3 version as stable?
> I know it's planned for 5.2, but I have no idea about the current state.
>

We ideally produce Python 2 and Python 3 package variants. Then we switch
to Python 3 exclusive in a future release.

For Debian packaging, this could be a bit more difficult, as I believe we'd
need to fork the Debian packaging templates in the repository.

I doubt the in-repo Debian packaging is used that much. So I could go
either way with regards to transitioning the packaging to Python 3
exclusive. Definitely safer to hold off.
via Mercurial-devel - Oct. 21, 2019, 4:05 p.m.
On Mon, Oct 21, 2019, 08:32 Denis Laxalde <denis@laxalde.org> wrote:

> Martin von Zweigbergk a écrit :
> > On Mon, Oct 21, 2019, 06:57 Yuya Nishihara <yuya@tcha.org> wrote:
> >
> > > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > > # HG changeset patch
> > > > # User Denis Laxalde <denis@laxalde.org>
> > > > # Date 1571648394 -7200
> > > > #      Mon Oct 21 10:59:54 2019 +0200
> > > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > > packaging: upgrade Debian packaging to build with Python 3
> > > >
> > > > Also drop the explicit "Depends: python" as debhelper will add it.
> > >
> > > So, are we ready to ship py3 version as stable?
> > > I know it's planned for 5.2, but I have no idea about the current
> state.
>
> That's how I interpreted recent announces:
>
>
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-October/134689.html
>
> https://www.mercurial-scm.org/pipermail/mercurial-devel/2019-October/134989.html
>
> but perhaps I'm a bit optimistic...
>
> > I'm a bit uncomfortable with shipping it since we have probably had
> pretty
> > much no testing of it on real users (including ourselves). How many here
> > have been running py3 hg for a while? I have only tried it for an hour or
> > so before I ran into a problem with our internal extension, so I don't
> > really know how well it works.
>
> I've been using hg with py3 for a several weeks now; I've fixed all
> issues I discovered quite quickly. The only third party extension I use
> is Evolve. Now it's stable as far as my usage is concerned, though this
> is mostly on client side less on server side.
>
> Aside, it's not clear to me who is actually using the Debian packaging
> in our repository as it differs from the one in Debian. I, for one, have
> always used the latter and have therefore started adjusting that one
> first.
>
> Anyways, just let me know if this premature.
>


Oh, if this is not actually used by Debian, then I think we should just go
ahead and queue this on stable. Maybe it mostly affects Google in that case
(we build using these rules).

>
via Mercurial-devel - Oct. 21, 2019, 4:30 p.m.
On Mon, Oct 21, 2019 at 9:21 AM Gregory Szorc <gregory.szorc@gmail.com>
wrote:

> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
>
>> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
>> > # HG changeset patch
>> > # User Denis Laxalde <denis@laxalde.org>
>> > # Date 1571648394 -7200
>> > #      Mon Oct 21 10:59:54 2019 +0200
>> > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
>> > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
>> > packaging: upgrade Debian packaging to build with Python 3
>> >
>> > Also drop the explicit "Depends: python" as debhelper will add it.
>>
>> So, are we ready to ship py3 version as stable?
>> I know it's planned for 5.2, but I have no idea about the current state.
>>
>
> We ideally produce Python 2 and Python 3 package variants. Then we switch
> to Python 3 exclusive in a future release.
>
> For Debian packaging, this could be a bit more difficult, as I believe
> we'd need to fork the Debian packaging templates in the repository.
>
> I doubt the in-repo Debian packaging is used that much. So I could go
> either way with regards to transitioning the packaging to Python 3
> exclusive. Definitely safer to hold off.
>

I suspect they're just used only by Google and I think we're fine with
internally working around any issues we run into when we switch to py3
(including backing out these patches).
Yuya Nishihara - Oct. 21, 2019, 4:36 p.m.
On Mon, 21 Oct 2019 09:01:51 -0700, Gregory Szorc wrote:
> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > # HG changeset patch
> > > # User Denis Laxalde <denis@laxalde.org>
> > > # Date 1571648394 -7200
> > > #      Mon Oct 21 10:59:54 2019 +0200
> > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > packaging: upgrade Debian packaging to build with Python 3
> > >
> > > Also drop the explicit "Depends: python" as debhelper will add it.
> >
> > So, are we ready to ship py3 version as stable?
> > I know it's planned for 5.2, but I have no idea about the current state.
> >
> 
> We ideally produce Python 2 and Python 3 package variants. Then we switch
> to Python 3 exclusive in a future release.
> 
> For Debian packaging, this could be a bit more difficult, as I believe we'd
> need to fork the Debian packaging templates in the repository.

Maybe python-mercurial package can be split off so we can generate both
python-mercurial and python3-mercurial. The main mercurial package will have
to depend on one of these, but we can at least run python|python3 /usr/bin/hg.

That might also apply to tortoisehg, which py3 support is highly unstable.

> I doubt the in-repo Debian packaging is used that much. So I could go
> either way with regards to transitioning the packaging to Python 3
> exclusive. Definitely safer to hold off.

Seems fine so long as our package isn't advertised as stable one.
via Mercurial-devel - Oct. 21, 2019, 4:59 p.m.
On Mon, Oct 21, 2019 at 9:53 AM Yuya Nishihara <yuya@tcha.org> wrote:

> On Mon, 21 Oct 2019 09:01:51 -0700, Gregory Szorc wrote:
> > On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > > # HG changeset patch
> > > > # User Denis Laxalde <denis@laxalde.org>
> > > > # Date 1571648394 -7200
> > > > #      Mon Oct 21 10:59:54 2019 +0200
> > > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > > packaging: upgrade Debian packaging to build with Python 3
> > > >
> > > > Also drop the explicit "Depends: python" as debhelper will add it.
> > >
> > > So, are we ready to ship py3 version as stable?
> > > I know it's planned for 5.2, but I have no idea about the current
> state.
> > >
> >
> > We ideally produce Python 2 and Python 3 package variants. Then we switch
> > to Python 3 exclusive in a future release.
> >
> > For Debian packaging, this could be a bit more difficult, as I believe
> we'd
> > need to fork the Debian packaging templates in the repository.
>
> Maybe python-mercurial package can be split off so we can generate both
> python-mercurial and python3-mercurial. The main mercurial package will
> have
> to depend on one of these, but we can at least run python|python3
> /usr/bin/hg.
>

What's the advantage of that? You mean that tortoisehg would depend on
python-mercurial only?

And the main mercurial package would also contain any native code then,
right? Or is that compatible across Python versions?


> That might also apply to tortoisehg, which py3 support is highly unstable.
>
> > I doubt the in-repo Debian packaging is used that much. So I could go
> > either way with regards to transitioning the packaging to Python 3
> > exclusive. Definitely safer to hold off.
>
> Seems fine so long as our package isn't advertised as stable one.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Augie Fackler - Oct. 21, 2019, 7:52 p.m.
On Mon, Oct 21, 2019 at 09:30:27AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
> On Mon, Oct 21, 2019 at 9:21 AM Gregory Szorc <gregory.szorc@gmail.com>
> wrote:
>
> > On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
> >
> >> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> >> > # HG changeset patch
> >> > # User Denis Laxalde <denis@laxalde.org>
> >> > # Date 1571648394 -7200
> >> > #      Mon Oct 21 10:59:54 2019 +0200
> >> > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> >> > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> >> > packaging: upgrade Debian packaging to build with Python 3
> >> >
> >> > Also drop the explicit "Depends: python" as debhelper will add it.
> >>
> >> So, are we ready to ship py3 version as stable?
> >> I know it's planned for 5.2, but I have no idea about the current state.
> >>
> >
> > We ideally produce Python 2 and Python 3 package variants. Then we switch
> > to Python 3 exclusive in a future release.
> >
> > For Debian packaging, this could be a bit more difficult, as I believe
> > we'd need to fork the Debian packaging templates in the repository.
> >
> > I doubt the in-repo Debian packaging is used that much. So I could go
> > either way with regards to transitioning the packaging to Python 3
> > exclusive. Definitely safer to hold off.
> >
>
> I suspect they're just used only by Google and I think we're fine with
> internally working around any issues we run into when we switch to py3
> (including backing out these patches).

I believe they have at least some small usership outside Google, as a
way for users to have a more recent hg installed without having to
wait forever for a backport to show up.
Augie Fackler - Oct. 21, 2019, 7:56 p.m.
On Mon, Oct 21, 2019 at 09:01:51AM -0700, Gregory Szorc wrote:
> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
>
> > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > # HG changeset patch
> > > # User Denis Laxalde <denis@laxalde.org>
> > > # Date 1571648394 -7200
> > > #      Mon Oct 21 10:59:54 2019 +0200
> > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > packaging: upgrade Debian packaging to build with Python 3
> > >
> > > Also drop the explicit "Depends: python" as debhelper will add it.
> >
> > So, are we ready to ship py3 version as stable?
> > I know it's planned for 5.2, but I have no idea about the current state.
> >
>
> We ideally produce Python 2 and Python 3 package variants. Then we switch
> to Python 3 exclusive in a future release.
>
> For Debian packaging, this could be a bit more difficult, as I believe we'd
> need to fork the Debian packaging templates in the repository.
>
> I doubt the in-repo Debian packaging is used that much. So I could go
> either way with regards to transitioning the packaging to Python 3
> exclusive. Definitely safer to hold off.

I think we should move our first-party built debs to python3 now, to
facilitate testing via nightly-ish builds. That's mostly why these exist.

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
via Mercurial-devel - Oct. 21, 2019, 8:34 p.m.
On 21/10/19 21:52, Augie Fackler wrote:
> On Mon, Oct 21, 2019 at 09:30:27AM -0700, Martin von Zweigbergk via Mercurial-devel wrote:
>> On Mon, Oct 21, 2019 at 9:21 AM Gregory Szorc <gregory.szorc@gmail.com>
>> wrote:
>>
>>> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
>>>
>>>> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
>>>>> # HG changeset patch
>>>>> # User Denis Laxalde <denis@laxalde.org>
>>>>> # Date 1571648394 -7200
>>>>> #      Mon Oct 21 10:59:54 2019 +0200
>>>>> # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
>>>>> # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
>>>>> packaging: upgrade Debian packaging to build with Python 3
>>>>>
>>>>> Also drop the explicit "Depends: python" as debhelper will add it.
>>>> So, are we ready to ship py3 version as stable?
>>>> I know it's planned for 5.2, but I have no idea about the current state.
>>>>
>>> We ideally produce Python 2 and Python 3 package variants. Then we switch
>>> to Python 3 exclusive in a future release.
>>>
>>> For Debian packaging, this could be a bit more difficult, as I believe
>>> we'd need to fork the Debian packaging templates in the repository.
>>>
>>> I doubt the in-repo Debian packaging is used that much. So I could go
>>> either way with regards to transitioning the packaging to Python 3
>>> exclusive. Definitely safer to hold off.
>>>
>> I suspect they're just used only by Google and I think we're fine with
>> internally working around any issues we run into when we switch to py3
>> (including backing out these patches).
> I believe they have at least some small usership outside Google, as a
> way for users to have a more recent hg installed without having to
> wait forever for a backport to show up.
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

I can confirm. The in-repo packaging scripts fill well this need for us.
via Mercurial-devel - Oct. 21, 2019, 9:11 p.m.
Sounds good. I'd like to queue this series for stable, but I'll give Yuya a
chance to comment first.

On Mon, Oct 21, 2019 at 1:48 PM Antonio Muci via Mercurial-devel <
mercurial-devel@mercurial-scm.org> wrote:

>
> On 21/10/19 21:52, Augie Fackler wrote:
> > On Mon, Oct 21, 2019 at 09:30:27AM -0700, Martin von Zweigbergk via
> Mercurial-devel wrote:
> >> On Mon, Oct 21, 2019 at 9:21 AM Gregory Szorc <gregory.szorc@gmail.com>
> >> wrote:
> >>
> >>> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
> >>>
> >>>> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> >>>>> # HG changeset patch
> >>>>> # User Denis Laxalde <denis@laxalde.org>
> >>>>> # Date 1571648394 -7200
> >>>>> #      Mon Oct 21 10:59:54 2019 +0200
> >>>>> # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> >>>>> # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> >>>>> packaging: upgrade Debian packaging to build with Python 3
> >>>>>
> >>>>> Also drop the explicit "Depends: python" as debhelper will add it.
> >>>> So, are we ready to ship py3 version as stable?
> >>>> I know it's planned for 5.2, but I have no idea about the current
> state.
> >>>>
> >>> We ideally produce Python 2 and Python 3 package variants. Then we
> switch
> >>> to Python 3 exclusive in a future release.
> >>>
> >>> For Debian packaging, this could be a bit more difficult, as I believe
> >>> we'd need to fork the Debian packaging templates in the repository.
> >>>
> >>> I doubt the in-repo Debian packaging is used that much. So I could go
> >>> either way with regards to transitioning the packaging to Python 3
> >>> exclusive. Definitely safer to hold off.
> >>>
> >> I suspect they're just used only by Google and I think we're fine with
> >> internally working around any issues we run into when we switch to py3
> >> (including backing out these patches).
> > I believe they have at least some small usership outside Google, as a
> > way for users to have a more recent hg installed without having to
> > wait forever for a backport to show up.
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
> I can confirm. The in-repo packaging scripts fill well this need for us.
>
>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Yuya Nishihara - Oct. 22, 2019, 1:26 a.m.
On Mon, 21 Oct 2019 09:59:10 -0700, Martin von Zweigbergk wrote:
> On Mon, Oct 21, 2019 at 9:53 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > On Mon, 21 Oct 2019 09:01:51 -0700, Gregory Szorc wrote:
> > > On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > > > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > > > # HG changeset patch
> > > > > # User Denis Laxalde <denis@laxalde.org>
> > > > > # Date 1571648394 -7200
> > > > > #      Mon Oct 21 10:59:54 2019 +0200
> > > > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > > > packaging: upgrade Debian packaging to build with Python 3
> > > > >
> > > > > Also drop the explicit "Depends: python" as debhelper will add it.
> > > >
> > > > So, are we ready to ship py3 version as stable?
> > > > I know it's planned for 5.2, but I have no idea about the current
> > state.
> > > >
> > >
> > > We ideally produce Python 2 and Python 3 package variants. Then we switch
> > > to Python 3 exclusive in a future release.
> > >
> > > For Debian packaging, this could be a bit more difficult, as I believe
> > we'd
> > > need to fork the Debian packaging templates in the repository.
> >
> > Maybe python-mercurial package can be split off so we can generate both
> > python-mercurial and python3-mercurial. The main mercurial package will
> > have
> > to depend on one of these, but we can at least run python|python3
> > /usr/bin/hg.
> >
> 
> What's the advantage of that?

I can run "python /usr/bin/hg".

> You mean that tortoisehg would depend on
> python-mercurial only?

Kind of. tortoisehg will have to depend on python(2)-mercurial for in-process
dependency, and mercurial for command-server stuff.

> And the main mercurial package would also contain any native code then,
> right? Or is that compatible across Python versions?

The entry-point script and misc files will be included in the main package.

Anyway, splitting packages might be good for the official packages, but it
shouldn't be required for ours. Doing that might complicate our packaging
scripts.
Gregory Szorc - Oct. 22, 2019, 2:13 a.m.
On Mon, Oct 21, 2019 at 6:26 PM Yuya Nishihara <yuya@tcha.org> wrote:

> On Mon, 21 Oct 2019 09:59:10 -0700, Martin von Zweigbergk wrote:
> > On Mon, Oct 21, 2019 at 9:53 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > > On Mon, 21 Oct 2019 09:01:51 -0700, Gregory Szorc wrote:
> > > > On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org>
> wrote:
> > > > > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > > > > # HG changeset patch
> > > > > > # User Denis Laxalde <denis@laxalde.org>
> > > > > > # Date 1571648394 -7200
> > > > > > #      Mon Oct 21 10:59:54 2019 +0200
> > > > > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > > > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > > > > packaging: upgrade Debian packaging to build with Python 3
> > > > > >
> > > > > > Also drop the explicit "Depends: python" as debhelper will add
> it.
> > > > >
> > > > > So, are we ready to ship py3 version as stable?
> > > > > I know it's planned for 5.2, but I have no idea about the current
> > > state.
> > > > >
> > > >
> > > > We ideally produce Python 2 and Python 3 package variants. Then we
> switch
> > > > to Python 3 exclusive in a future release.
> > > >
> > > > For Debian packaging, this could be a bit more difficult, as I
> believe
> > > we'd
> > > > need to fork the Debian packaging templates in the repository.
> > >
> > > Maybe python-mercurial package can be split off so we can generate both
> > > python-mercurial and python3-mercurial. The main mercurial package will
> > > have
> > > to depend on one of these, but we can at least run python|python3
> > > /usr/bin/hg.
> > >
> >
> > What's the advantage of that?
>
> I can run "python /usr/bin/hg".
>
> > You mean that tortoisehg would depend on
> > python-mercurial only?
>
> Kind of. tortoisehg will have to depend on python(2)-mercurial for
> in-process
> dependency, and mercurial for command-server stuff.
>
> > And the main mercurial package would also contain any native code then,
> > right? Or is that compatible across Python versions?
>
> The entry-point script and misc files will be included in the main package.
>
> Anyway, splitting packages might be good for the official packages, but it
> shouldn't be required for ours. Doing that might complicate our packaging
> scripts.
>

I strongly believe that our official packages should be a unified .deb that
someone can download + `dpkg -i` to install it. Multiple packages just
complicates things for downstream consumers.
Yuya Nishihara - Oct. 22, 2019, 2:28 a.m.
On Mon, 21 Oct 2019 19:13:48 -0700, Gregory Szorc wrote:
> On Mon, Oct 21, 2019 at 6:26 PM Yuya Nishihara <yuya@tcha.org> wrote:
> 
> > On Mon, 21 Oct 2019 09:59:10 -0700, Martin von Zweigbergk wrote:
> > > On Mon, Oct 21, 2019 at 9:53 AM Yuya Nishihara <yuya@tcha.org> wrote:
> > > > On Mon, 21 Oct 2019 09:01:51 -0700, Gregory Szorc wrote:
> > > > > On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org>
> > wrote:
> > > > > > On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
> > > > > > > # HG changeset patch
> > > > > > > # User Denis Laxalde <denis@laxalde.org>
> > > > > > > # Date 1571648394 -7200
> > > > > > > #      Mon Oct 21 10:59:54 2019 +0200
> > > > > > > # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
> > > > > > > # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
> > > > > > > packaging: upgrade Debian packaging to build with Python 3
> > > > > > >
> > > > > > > Also drop the explicit "Depends: python" as debhelper will add
> > it.
> > > > > >
> > > > > > So, are we ready to ship py3 version as stable?
> > > > > > I know it's planned for 5.2, but I have no idea about the current
> > > > state.
> > > > > >
> > > > >
> > > > > We ideally produce Python 2 and Python 3 package variants. Then we
> > switch
> > > > > to Python 3 exclusive in a future release.
> > > > >
> > > > > For Debian packaging, this could be a bit more difficult, as I
> > believe
> > > > we'd
> > > > > need to fork the Debian packaging templates in the repository.
> > > >
> > > > Maybe python-mercurial package can be split off so we can generate both
> > > > python-mercurial and python3-mercurial. The main mercurial package will
> > > > have
> > > > to depend on one of these, but we can at least run python|python3
> > > > /usr/bin/hg.
> > > >
> > >
> > > What's the advantage of that?
> >
> > I can run "python /usr/bin/hg".
> >
> > > You mean that tortoisehg would depend on
> > > python-mercurial only?
> >
> > Kind of. tortoisehg will have to depend on python(2)-mercurial for
> > in-process
> > dependency, and mercurial for command-server stuff.
> >
> > > And the main mercurial package would also contain any native code then,
> > > right? Or is that compatible across Python versions?
> >
> > The entry-point script and misc files will be included in the main package.
> >
> > Anyway, splitting packages might be good for the official packages, but it
> > shouldn't be required for ours. Doing that might complicate our packaging
> > scripts.
> >
> 
> I strongly believe that our official packages should be a unified .deb that
> someone can download + `dpkg -i` to install it. Multiple packages just
> complicates things for downstream consumers.

We already have mercurial (binary-arch) and mercurial-common (binary-indep).
Maybe they can be unified by adding some conflicts/breaks fields.
via Mercurial-devel - Oct. 22, 2019, 3:05 a.m.
Yuya, are you okay with this patch as it is?

On Mon, Oct 21, 2019, 14:11 Martin von Zweigbergk <martinvonz@google.com>
wrote:

> Sounds good. I'd like to queue this series for stable, but I'll give Yuya
> a chance to comment first.
>
> On Mon, Oct 21, 2019 at 1:48 PM Antonio Muci via Mercurial-devel <
> mercurial-devel@mercurial-scm.org> wrote:
>
>>
>> On 21/10/19 21:52, Augie Fackler wrote:
>> > On Mon, Oct 21, 2019 at 09:30:27AM -0700, Martin von Zweigbergk via
>> Mercurial-devel wrote:
>> >> On Mon, Oct 21, 2019 at 9:21 AM Gregory Szorc <gregory.szorc@gmail.com
>> >
>> >> wrote:
>> >>
>> >>> On Mon, Oct 21, 2019 at 6:57 AM Yuya Nishihara <yuya@tcha.org> wrote:
>> >>>
>> >>>> On Mon, 21 Oct 2019 12:00:55 +0200, Denis Laxalde wrote:
>> >>>>> # HG changeset patch
>> >>>>> # User Denis Laxalde <denis@laxalde.org>
>> >>>>> # Date 1571648394 -7200
>> >>>>> #      Mon Oct 21 10:59:54 2019 +0200
>> >>>>> # Node ID 09f95d7a20c6d2e0bf6218e2a5bc9cd2b803c8ec
>> >>>>> # Parent  70764c9ddba397fa6cc2c92a28a1a65c5bdddaea
>> >>>>> packaging: upgrade Debian packaging to build with Python 3
>> >>>>>
>> >>>>> Also drop the explicit "Depends: python" as debhelper will add it.
>> >>>> So, are we ready to ship py3 version as stable?
>> >>>> I know it's planned for 5.2, but I have no idea about the current
>> state.
>> >>>>
>> >>> We ideally produce Python 2 and Python 3 package variants. Then we
>> switch
>> >>> to Python 3 exclusive in a future release.
>> >>>
>> >>> For Debian packaging, this could be a bit more difficult, as I believe
>> >>> we'd need to fork the Debian packaging templates in the repository.
>> >>>
>> >>> I doubt the in-repo Debian packaging is used that much. So I could go
>> >>> either way with regards to transitioning the packaging to Python 3
>> >>> exclusive. Definitely safer to hold off.
>> >>>
>> >> I suspect they're just used only by Google and I think we're fine with
>> >> internally working around any issues we run into when we switch to py3
>> >> (including backing out these patches).
>> > I believe they have at least some small usership outside Google, as a
>> > way for users to have a more recent hg installed without having to
>> > wait forever for a backport to show up.
>> > _______________________________________________
>> > Mercurial-devel mailing list
>> > Mercurial-devel@mercurial-scm.org
>> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>> I can confirm. The in-repo packaging scripts fill well this need for us.
>>
>>
>> _______________________________________________
>> Mercurial-devel mailing list
>> Mercurial-devel@mercurial-scm.org
>> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>>
>
Yuya Nishihara - Oct. 22, 2019, 3:07 a.m.
On Mon, 21 Oct 2019 20:05:41 -0700, Martin von Zweigbergk wrote:
> Yuya, are you okay with this patch as it is?

Yes.
via Mercurial-devel - Oct. 22, 2019, 4:59 a.m.
Queued patches 3-6 for stable. Thanks a lot! It would have taken me a long
time to figure out how to do this, and it would have been done in a worse
way.

On Mon, Oct 21, 2019 at 8:07 PM Yuya Nishihara <yuya@tcha.org> wrote:

> On Mon, 21 Oct 2019 20:05:41 -0700, Martin von Zweigbergk wrote:
> > Yuya, are you okay with this patch as it is?
>
> Yes.
>

Patch

diff --git a/contrib/packaging/debian/control b/contrib/packaging/debian/control
--- a/contrib/packaging/debian/control
+++ b/contrib/packaging/debian/control
@@ -7,20 +7,19 @@  Build-Depends:
  dh-python,
  less,
  netbase,
- python-all,
- python-all-dev,
- python-docutils,
+ python3-all,
+ python3-all-dev,
+ python3-docutils,
  unzip,
  zip
 Standards-Version: 3.9.4
-X-Python-Version: >= 2.7
+X-Python3-Version: >= 3.5
 
 Package: mercurial
 Depends:
- python,
  ${shlibs:Depends},
  ${misc:Depends},
- ${python:Depends},
+ ${python3:Depends},
  mercurial-common (= ${source:Version})
 Architecture: any
 Description: fast, easy to use, distributed revision control tool.
@@ -41,7 +40,7 @@  Package: mercurial-common
 Architecture: all
 Depends:
  ${misc:Depends},
- ${python:Depends},
+ ${python3:Depends},
 Recommends: mercurial (= ${source:Version}), ca-certificates
 Suggests: wish
 Breaks: mercurial (<< ${source:Version})
diff --git a/contrib/packaging/debian/rules b/contrib/packaging/debian/rules
--- a/contrib/packaging/debian/rules
+++ b/contrib/packaging/debian/rules
@@ -4,18 +4,21 @@ 
 
 CPUS=$(shell cat /proc/cpuinfo | grep -E ^processor | wc -l)
 
+export HGPYTHON3=1
+export PYTHON=python3
+
 %:
-	dh $@ --with python2
+	dh $@ --with python3
 
 override_dh_auto_test:
 	http_proxy='' dh_auto_test -- TESTFLAGS="-j$(CPUS)"
 
-override_dh_python2:
-	dh_python2
+override_dh_python3:
+	dh_python3
 	find debian/mercurial/usr/share -type d -empty -delete
 
 override_dh_install:
-	python$(PYVERS) setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
+	python3 setup.py install --root "$(CURDIR)"/debian/mercurial --install-layout=deb
 	# chg
 	make -C contrib/chg \
 		DESTDIR="$(CURDIR)"/debian/mercurial \
@@ -25,7 +28,7 @@  override_dh_install:
 	find "$(CURDIR)"/debian/mercurial/usr/lib \
 		! -name '*.so' ! -type d -delete , \
 		-type d -empty -delete
-	python$(PYVERS) setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb
+	python3 setup.py install --root "$(CURDIR)/debian/mercurial-common" --install-layout=deb
 	make install-doc PREFIX="$(CURDIR)"/debian/mercurial-common/usr
 	# remove arch-dependent python stuff
 	find "$(CURDIR)"/debian/mercurial-common/usr/lib \
diff --git a/tests/test-debian-packages.t b/tests/test-debian-packages.t
--- a/tests/test-debian-packages.t
+++ b/tests/test-debian-packages.t
@@ -17,10 +17,10 @@  Ensure debuild doesn't run the testsuite
   mercurial_*.deb (glob)
 main deb should have .so but no .py
   $ dpkg --contents mercurial_*.deb | egrep '(localrepo|parsers)'
-  * ./usr/lib/python2.7/dist-packages/mercurial/cext/parsers*.so (glob)
+  * ./usr/lib/python3/dist-packages/mercurial/cext/parsers*.so (glob)
 mercurial-common should have py but no .so or pyc
   $ dpkg --contents mercurial-common_*.deb | egrep '(localrepo|parsers.*so)'
-  * ./usr/lib/python2.7/dist-packages/mercurial/localrepo.py (glob)
+  * ./usr/lib/python3/dist-packages/mercurial/localrepo.py (glob)
 zsh completions should be in the common package
   $ dpkg --contents mercurial-common_*.deb | egrep 'zsh.*[^/]$'
   * ./usr/share/zsh/vendor-completions/_hg (glob)