Closed jxltom closed 3 months ago
Indeed, it looks like mixing git and timestamp versioning schemes can't work together.
Even if the timestamp is stored as a string, the comparisons will eventually be wrong.
We should note that in the doc and update the addversion ws to make it reject new deployments that change the version scheme. That's all for milestone 1.2
Can you use the delversion or delproject webservices for this project while the version sorting is broken?
Yes, these delversion
or delproject
are working well. There is no problem in deleting. Only listspiders
and listversions
are affected by this bug.
Ok, this means that nothing special needs to be added to the fix I describe.
Thank you for reporting this, I will write a patch when I have the time.
The solution for broken projects is exactly what you tried, use delproject (or delversion) to clean up versions with a different versioning scheme.
Yes, it will be nice if there is a clean-up when different versioning schemes are used.
@jxltom, although I can't reproduce your issue I'm sure it's https://bugs.python.org/issue14894 It seems that when python3 dropped int<>str comparisons, LooseVersion wasn't updated.
We shouldn't fix this issue by writing a workaround for a python bug. What is wrong in our side is allowing changing version schemes without purging previous deployments.
But even if scrapyd and scrapyd-client had a way to exchange the version schemes before deploying,
when LooseVersion parses different branch names or annotated tags
it splits them using the regex (\d+|[a-z]+|\.)
so it generates different versioning schemes
whose components will also not always have comparable types.
The above is something I want to reproduce but I can't. (probably for the same reason I can't reproduce the original issue)
We need more ideas and more input. I'd rather avoid letting an experimental solution in 1.2. and since this is not a critical issue, it can skip this release.
when LooseVersion parses different branch names or annotated tags it splits them using the regex (\d+|[a-z]+|.) so it generates different versioning schemes whose components will also not always have comparable types.
After fixing my virtualenv I managed to reproduce this in python 3 so the conclusion remains the same:
We need more ideas and more input. I'd rather avoid letting an experimental solution in 1.2. and since this is not a critical issue, it can skip this release.
I'm not sure why this is labelled wontfix. It is easy to reproduce, and even if the bug is upstream, we should try to fix it.
distutils.LooseVersion is gone without a replacement so it was replaced with packaging.version.Version #469 which does not have this issue.
If one uploads a project with default version schema which is timestamp using scrapyd-client, and then upload a new version of same project but with GIT version which is specified by
version = GIT
inscrapy.cfg
,listspiders.json
andlistversions.json
won't working.For
listspiders.json
, this error is raised.For
listversions.json
, this error is raised.