Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #93609

Re: module dependencies issues

References <10ADE079-3F0F-4EA8-9312-06F7FCDB6130@free.fr> <CAPTjJmoJnNRzoQGBgK8qGaqv7zSeQ7HcHhiGO6ijiPt29QmmhA@mail.gmail.com> <85B68343-326C-4768-A236-3459299AD129@free.fr> <mailman.370.1436472009.3674.python-list@python.org> <87wpy96pbd.fsf@elektro.pacujo.net>
Date 2015-07-10 06:47 +1000
Subject Re: module dependencies issues
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.372.1436474856.3674.python-list@python.org> (permalink)

Show all headers | View raw


On Fri, Jul 10, 2015 at 6:36 AM, Marko Rauhamaa <marko@pacujo.net> wrote:
> Chris Angelico <rosuav@gmail.com>:
>
>> How do you expect the end result to work? Will it be that your code
>> imports one version of a module, but other code imports another? You
>> would have to rename one of them or something.
>
> At work, we have created an analogous component system that has solved
> this issue the way I think it should be solved.
>
> Component B ver 1.1 must declare (ABI) backward-compatibility with B ver
> 1.0. That allows the component system to resolve such natural dependency
> discrepancies in a safe manner.
>
> The application (or component) C, which was created at B ver 1.0 time,
> can't depend on >= B-1.0 because C has no way of knowing if, say, B-2.0
> will be backward-compatible with B-1.0. The compatibility declaration
> belongs to B.

Or, B could simply declare that it follows the common versioning
pattern of Major.Minor.Revision, where Revision changes don't add
features or in any way break compatibility (or if they do, it's a
bug), Minor changes add features without normally breaking backward
compatibility in any serious way, and Major chances might break all
sorts of things (but usually won't). Then, depending on B >= 1.3 < 2.0
is sufficient if you require a feature that came in with 1.3. If it
turns out that 1.7 breaks your code, you either change your code to be
compatible with 1.7 (and either drop support for 1.3 or figure out
some way of supporting both), or declare B >= 1.3 < 1.7. It's really
not difficult. This is what version numbers are for.

In general, I would expect that B 1.1 is backward-compatible with B
1.0, unless otherwise stated. Why must it be declared in any way other
than the version number?

ChrisA

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: module dependencies issues Chris Angelico <rosuav@gmail.com> - 2015-07-10 05:59 +1000
  Re: module dependencies issues Marko Rauhamaa <marko@pacujo.net> - 2015-07-09 23:36 +0300
    Re: module dependencies issues Chris Angelico <rosuav@gmail.com> - 2015-07-10 06:47 +1000
      Re: module dependencies issues Marko Rauhamaa <marko@pacujo.net> - 2015-07-10 00:11 +0300
        Re: module dependencies issues Chris Angelico <rosuav@gmail.com> - 2015-07-10 07:20 +1000
          Re: module dependencies issues Marko Rauhamaa <marko@pacujo.net> - 2015-07-10 00:33 +0300
            Re: module dependencies issues Chris Angelico <rosuav@gmail.com> - 2015-07-10 07:45 +1000
              Re: module dependencies issues Marko Rauhamaa <marko@pacujo.net> - 2015-07-10 03:04 +0300
                Re: module dependencies issues Mark Lawrence <breamoreboy@yahoo.co.uk> - 2015-07-10 01:24 +0100

csiph-web