[Metacello] about required list

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[Metacello] about required list

stepharo
Hi

using the dependency analyser I see that may packages have the following
dependencies

for example

     package: 'Math-DistributionGamma' with: [ spec requires:
#('Math-Core' 'Math-DHB-Numerical' 'Math-Series'
'Math-Core-Distribution') ];

     package: 'Math-DistributionBeta' with: [ spec requires:
#('Math-DistributionGamma' 'Math-Core' 'Math-Core-Distribution'
'Math-DHB-Numerical' 'Math-Series') ];

so I wrote the requirement this way


Now does it have an impact on Metacello and should I keep only the
direct depend.


     package: 'Math-DistributionBeta' with: [ spec requires:
#('Math-DistributionGamma' ) ];

This is annoying because I have 50 packages and doing that manually is a
pain.

Stef


Reply | Threaded
Open this post in threaded view
|

Re: [Metacello] about required list

CyrilFerlicot


On 26/03/2016 22:00, stepharo wrote:

> Hi
>
> using the dependency analyser I see that may packages have the following
> dependencies
>
> for example
>
>     package: 'Math-DistributionGamma' with: [ spec requires:
> #('Math-Core' 'Math-DHB-Numerical' 'Math-Series'
> 'Math-Core-Distribution') ];
>
>     package: 'Math-DistributionBeta' with: [ spec requires:
> #('Math-DistributionGamma' 'Math-Core' 'Math-Core-Distribution'
> 'Math-DHB-Numerical' 'Math-Series') ];
>
> so I wrote the requirement this way
>
>
> Now does it have an impact on Metacello and should I keep only the
> direct depend.
>
Hi,

Since Math-DistributionBeta depend on Math-DistributionGamma you can do:

 package: 'Math-DistributionGamma' with: [ spec requires: #('Math-Core'
'Math-DHB-Numerical' 'Math-Series' 'Math-Core-Distribution') ];

    package: 'Math-DistributionBeta' with: [ spec requires:
#('Math-DistributionGamma') ];

You can do this if beta really cannot work without gamma and if gamma
will keep the same dependencies.

And it is important I think because imagine Math-DisctirbutionBeta
depend on Ston. You can create a group gamma and a group beta. If you
load the group gamma, you will not get the ston dependency because it
only concern gamma.

>
>     package: 'Math-DistributionBeta' with: [ spec requires:
> #('Math-DistributionGamma' ) ];
>
> This is annoying because I have 50 packages and doing that manually is a
> pain.
>
> Stef
>
>
--
Cyril Ferlicot

http://www.synectique.eu

165 Avenue Bretagne
Lille 59000 France


signature.asc (817 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [Metacello] about required list

Dale Henrichs-3
In reply to this post by stepharo
Stef,

You don't need to repeat packages in the requires statement. Requiring
'Math-DistributionGamma' is sufficient to pick up 'Math-Core',
'Math-DHB-Numerical', 'Math-Series', and 'Math-Core-Distribution' as
requirements as well ... .

Dale

On 03/26/2016 02:00 PM, stepharo wrote:

> Hi
>
> using the dependency analyser I see that may packages have the
> following dependencies
>
> for example
>
>     package: 'Math-DistributionGamma' with: [ spec requires:
> #('Math-Core' 'Math-DHB-Numerical' 'Math-Series'
> 'Math-Core-Distribution') ];
>
>     package: 'Math-DistributionBeta' with: [ spec requires:
> #('Math-DistributionGamma' 'Math-Core' 'Math-Core-Distribution'
> 'Math-DHB-Numerical' 'Math-Series') ];
>
> so I wrote the requirement this way
>
>
> Now does it have an impact on Metacello and should I keep only the
> direct depend.
>
>
>     package: 'Math-DistributionBeta' with: [ spec requires:
> #('Math-DistributionGamma' ) ];
>
> This is annoying because I have 50 packages and doing that manually is
> a pain.
>
> Stef
>
>


Reply | Threaded
Open this post in threaded view
|

Re: [Metacello] about required list

demarey

> Le 28 mars 2016 à 22:36, Dale Henrichs <[hidden email]> a écrit :
>
> Stef,
>
> You don't need to repeat packages in the requires statement. Requiring 'Math-DistributionGamma' is sufficient to pick up 'Math-Core', 'Math-DHB-Numerical', 'Math-Series', and 'Math-Core-Distribution' as requirements as well … .

Indeed but it is a bad practice. If  'Math-DistributionBeta’ has direct dependencies to 'Math-Core', 'Math-DHB-Numerical', 'Math-Series', and 'Math-Core-Distribution’, they should be expressed. Else, you will end up with a configuration with missing requirements.
ex: if I update 'Math-DistributionGamma’  and do no depend anymore on 'Math-Series’ for example. I will remove 'Math-Series’ from  'Math-DistributionGamma’  requirements. Then, I end with a missing dependency for 'Math-DistributionBeta’.

What you could do is to define a group with 'Math-Core', 'Math-DHB-Numerical', 'Math-Series', and 'Math-Core-Distribution’ if it makes senses for your business logic. Then, both 'Math-DistributionGamma’ and  'Math-DistributionBeta’ could add this group as requirement.
Note that factorization of dependencies is not always a good idea. If dependencies you want to factorize have nothing to do all together, it’s better to avoid to group them because they will change many times.

Christophe