Skip to content

Instantly share code, notes, and snippets.

@skaji
Last active April 25, 2019 15:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skaji/9b90b942bdfa23202f06fa1d7e8660c7 to your computer and use it in GitHub Desktop.
Save skaji/9b90b942bdfa23202f06fa1d7e8660c7 to your computer and use it in GitHub Desktop.

I want to clarify what "distribution name" and "distribution version" are.

Let's say you have the following Perl6 distribution:

Changes
LICENSE
META6.json
README.md
lib/Your/Some-Module.pm6
lib/Your/Some-Module/Another.pm6
t/basic.t6

and

  • lib/Your/Some-Module.pm6 defines Your::Some-Module:ver<0.0.1> in it
  • lib/Your/Some-Module/Another.pm6 defines Your::Some-Module::Another:ver<0.0.2> it
  • you expect Your::Some-Module as the main module of this distribution

Then some questions:

(A) What is "distribution name"?
    (Is it arbitrary or are there some best practices?)

(B) What is "distribution version"?
    (Is it arbitrary or are there some best practices?) 

(C) What is "name" key in META6.json?
    (Is it arbitrary or are there some best practices?)

(D) What is "version" key in META6.json?
    (Is it arbitrary or are there some best practices?)

(E) Distributions are usually distributed as tarballs.
    What is the tarball name?
    (Is it arbitrary, or are there some best practices?)

According to S22, the expected answer are:

(A) Arbitrary,
    Best practice is: main module name =~ s/::/-/gr
    -> Your-Some-Module in this case
(B) Arbitrary
    Best practice is: same as main module version
    -> 0.0.1 in this case  
(C) Arbitrary
    Best practice is: main module name (NOT distribution name);
    -> Your::Some-Module in this case
(D) NOT arbitrary; It is the distribution version.
(E) Arbitrary
    Best practice is: (distribution name)-(distribution version).tar.gz
    -> Your-Some-Module-0.0.1.tar.gz in this case

I want to discuss:

  • (X) Are the above answers correct?
  • (Y) About (C): Should we really specify main module names (NOT distribution name) in META6.json?
  • (Z) ugexe said we should encode :: as -- instead of - in (LINK2).
    I agree with him about its consistency, but it is a little odd I think.
    Shold we encode :: as --?
    If we follow this, then the tarball name of the above example would be Your--Some-Module-0.0.1.tar.gz.

See:

@lizmat
Copy link

lizmat commented Apr 25, 2019

My responses:

A. "distribution name" is Arbitrary: generally is the main module name but without doing the s/::/-/g conversion
B. "distribution version" is Arbitrary: generally it is the version of the main module
C. "name" in META6.json is the name with which the distribution can be identified in the ecosystem / zef. We could consider forcing this to be the same as "distribution name".
D. "version" is not arbitrary: it is the version of this distribution
E. tarball name is Arbitrary, but for distribution systems such as PAUSE, (distribution name ~~ s:g/::/--/) would be recommended. We might consider adding any "api" version to this somehow in the future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment