Skip to content

Write order key based on total order#1989

Closed
nanonyme wants to merge 1 commit intoapache:masterfrom
nanonyme:nanonyme/sorting
Closed

Write order key based on total order#1989
nanonyme wants to merge 1 commit intoapache:masterfrom
nanonyme:nanonyme/sorting

Conversation

@nanonyme
Copy link
Contributor

@nanonyme nanonyme commented Jan 31, 2025

We follow these four rules always in order

  1. Elements that are not runtime dependencies come first
  2. Elements whose names are alphabetically earlier come first
  3. Elements which are junctioned come first
  4. Elements whose junction is alphabetically earlier come first

@nanonyme nanonyme changed the title Use alphabetical order with local elements first Use alphabetical order with local elements first and runtime last Jan 31, 2025
@nanonyme nanonyme force-pushed the nanonyme/sorting branch 2 times, most recently from 5b70ccf to 6c88e10 Compare January 31, 2025 19:36
@nanonyme nanonyme changed the title Use alphabetical order with local elements first and runtime last Write order key based on total order Jan 31, 2025
@nanonyme nanonyme force-pushed the nanonyme/sorting branch 2 times, most recently from 7a01d3a to 3bcc467 Compare January 31, 2025 19:50
We follow these four rules always in order

1. Elements that are not runtime dependencies come first
2. Elements whose names are alphabetically earlier come first
3. Elements which are junctioned come first
4. Elements whose junction is alphabetically earlier come first
@juergbi
Copy link
Contributor

juergbi commented Feb 15, 2025

We're not merging this right now as it changes staging order and cache keys with all Python versions. #1993 solves the issue with Python 3.13 without changing cache keys for Python <= 3.12.

A new algorithm, such as the one in this PR, may follow as optional alternative in the future.

@nanonyme
Copy link
Contributor Author

We're not merging this right now as it changes staging order and cache keys with all Python versions. #1993 solves the issue with Python 3.13 without changing cache keys for Python <= 3.12.

A new algorithm, such as the one in this PR, may follow as optional alternative in the future.

I agree, this solution does not seem acceptable. The more I've been reading, the nore it seems real solution needs to be topological sort. We actually want specific order from elements where dependencies are taken into account. It's not certain if Python 3.12 order is correct either. Python 3.11 changed sort function and after that all bets are off.

@nanonyme nanonyme closed this Feb 15, 2025
@nanonyme nanonyme deleted the nanonyme/sorting branch February 15, 2025 15:15
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