Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix sphinx-deploy-root-files on high minor versions #1203

Merged
merged 2 commits into from
Jan 22, 2025

Conversation

thomass-dev
Copy link
Collaborator

Currently, we compare X.Y using float casting. It will be wrong on a comparison between 0.6 and 0.10.

In [1]: history = {
   ...:     "dev": "0.0.0+dev",
   ...:     "0.15": "0.15.5",
   ...:     "0.5": "0.5.1",
   ...:     "0.4": "0.4.0",
   ...: }
   ...: 
   ...: # before
   ...: print(
   ...:     sorted(
   ...:         history.items(),
   ...:         key=lambda item: float(item[0]) if item[0] != "dev" else float('inf'),
   ...:         reverse=True
   ...:     )
   ...: )
   ...: 
   ...: # after
   ...: print(
   ...:     sorted(
   ...:         history.items(),
   ...:         key=lambda item: tuple(map(float, item[0].split("."))) if item[0] != "dev" else (float('inf'), 0),
   ...:         reverse=True
   ...:     )
   ...: )
   ...: 
[('dev', '0.0.0+dev'), ('0.5', '0.5.1'), ('0.4', '0.4.0'), ('0.15', '0.15.5')]
[('dev', '0.0.0+dev'), ('0.15', '0.15.5'), ('0.5', '0.5.1'), ('0.4', '0.4.0')]

Copy link
Contributor

github-actions bot commented Jan 22, 2025

Documentation preview @ ea4d4ae

@thomass-dev thomass-dev marked this pull request as draft January 22, 2025 14:14
@thomass-dev thomass-dev force-pushed the fix-sphinx-deploy-root-files branch 2 times, most recently from c3466b8 to 4d523c8 Compare January 22, 2025 14:21
@thomass-dev thomass-dev marked this pull request as ready for review January 22, 2025 14:22
@rouk1 rouk1 merged commit 687316d into main Jan 22, 2025
4 checks passed
@rouk1 rouk1 deleted the fix-sphinx-deploy-root-files branch January 22, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants