scapy icon indicating copy to clipboard operation
scapy copied to clipboard

Improper usage of `.devN`

Open ventaquil opened this issue 1 year ago • 2 comments

Brief description

Referencing the Python Packaging User Guide - Version specifiers - Developmental releases about .devN:

Developmental releases are ordered by their numerical component, immediately before the corresponding release [...]

Currently, X.Y.Z.devN releases are being published after the X.Y.Z release, leading to incorrect comparisons.

>>> from packaging import version
>>> version.parse("2.5.0.dev0") < version.parse("2.5.0.dev1") < version.parse("2.5.0") < version.parse("2.6.0.dev0") 
True

Maybe it would be more appropriate to use .postN instead of .devN when the next release is unknown.

Related resources

ventaquil avatar May 26 '24 18:05 ventaquil

Correct me if I'm wrong, but the current version is: 2.6.0rc1.dev17. We still haven't released 2.6.0 so that makes sense (?)

gpotter2 avatar May 26 '24 19:05 gpotter2

2.6.0rc1.dev17 should be before 2.6.0rc1 IMHO.

Also when you download from any commit before 2.6.0rc1 tag you will get version like 2.5.0.devN.

Checking this random commit - 1302042.

$ pip install https://github.com/secdev/scapy/archive/1302042.zip
Collecting https://github.com/secdev/scapy/archive/1302042.zip
  Downloading https://github.com/secdev/scapy/archive/1302042.zip
     \ 6.3 MB 7.8 MB/s 0:00:00
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Building wheels for collected packages: scapy
  Building wheel for scapy (pyproject.toml) ... done
  Created wheel for scapy: filename=scapy-2.5.0.dev318-py3-none-any.whl size=1620945 sha256=d2570c718968eb6f64b1aa30f604c58cebf0eeeb5e07e6279f8656cfb0affcea
  Stored in directory: /tmp/pip-ephem-wheel-cache-qhxuvmqp/wheels/02/cf/f2/9d5cee72bbceb38f848d57de2406a63f17c2de1007090a4a8e
Successfully built scapy
Installing collected packages: scapy
Successfully installed scapy-2.5.0.dev318

As you can see the version is 2.5.0.dev318. It suggest that it's dev release before 2.5.0 but it's false - this commit is after 2.5.0 release.

ventaquil avatar May 26 '24 20:05 ventaquil

So reading the doc you appear to be right.

That being said, I'm not sure it's a big deal, considering those versions are never released anyway.. I personally find the current syntax clearer, altough it might be incorrect. We also don't really know whether we'll do a minor release or a bigger one in advance (2.5.1 or 2.6.0), so it's a bit annoying for us.

WDYT @guedou @p-l- @polybassa ?

gpotter2 avatar Jul 03 '24 14:07 gpotter2

I am fine with the way it is.

guedou avatar Jul 03 '24 15:07 guedou

@gpotter2 from my point of view it's your choice, I thought that it's worth to report that issue.

You can close this issue if you like to leave it as it is (and reference in further discussions when someone asks about it 😉).

ventaquil avatar Jul 04 '24 00:07 ventaquil

Thank for raising the issue :)

gpotter2 avatar Jul 04 '24 05:07 gpotter2