Re: Converting PyPI to feeds
Tim Diels <[email protected]> Fri, 10 Mar 2017 17:21:08 +0100
| Newsgroups | gmane.comp.file-systems.zero-install.devel |
|---|---|
| Message-ID | <CAMjmSuSvOQTspoZHh9_Z8ty7OBAXyvJoECvAU=h=kdPcY_n8JQ@mail.gmail.com> |
I figured out that versions are lists of lists and thus 1 < 1.0 because [1] < [1, 0]. So, I don't see a way of converting Python version specifiers to Zero Install constraints, due to the lack of zero padding in the dotted lists of versions. One workaround is to pad the versions with zeros according to the longest version of the package to convert (E.g. a package with versions 1, 2.2, 3.3.3 will zero pad versions to match num.num.num). When, later, a component (referring to a '.num') is added, all versions will need to be changed to increase padding by one component (E.g. when adding 4.4.4.4). Version contraints will need to be padded as well (e.g. ==1 becomes ==1.0.0.0), so when a component is added, all constraints need to be updated as well. A feed can be required by a feed outside the pypi_to_zi project and thus that feed would break when a version component is added. So, this workaround is not really an option. So how could we make this work? It appears it is needed to either: - change the versioning scheme to add zero padding - or support multiple versioning schemes. E.g. like one of these approaches: <implementation version='pep440:1.0> <implementation version='1.0' version_scheme='pep440'> <interface><versioning_scheme>pep440 <!-- or only at interface level, as you might not want to support using multiple versioning schemes in the same interface --> Cheers, Tim On 9 March 2017 at 18:52, Tim Diels <[email protected]> wrote: > Dear Thomas, all, > > I need input on these problems encountered while converting Python version > specifiers to ZI constraints: > > 1. in Zero Install, version 1 < 1.0 < 1.0.0. In Python, version 1 == 1.0 > == 1.0.0. E.g. the specifier '==1' would have to be converted to constraint > '1..1.0.0.0...' (infinite zeros). Also, how do 1.0.0 and 1.1 compare in > Zero Install? Should 1 be interpreted as 1.(-1) perhaps? > 2. <version after=... not-after=...> will need to be implemented. Or > `version=` should support an & operator for intersection. This is to > support '<=version' for example. > > Thanks, > Cheers, > Tim > ------------------------------------------------------------------------------ Announcing the Oxford Dictionaries API! The API offers world-renowned dictionary content that is easy and intuitive to access. Sign up for an account today to start using our lexical data to power your apps and projects. Get started today and enter our developer competition. http://sdm.link/oxford _______________________________________________ Zero-install-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/zero-install-devel