python-holidays
python-holidays copied to clipboard
Keep context based import sorting for `holidays.constants`.
Resolves #732
As suggested in the issue above the week day and month constants should be kept in their context order (MON, TUE, WED, ...SUN / JAN, FEB, MAR, ... DEC)
This PR adds no_inline_sort = true
to the setup.cfg in order to skip isort inline sorting. It means this kind of imports should be enforced manually on code reviews.
Coverage decreased (-0.0002%) to 99.564% when pulling 525791f81e1ad0d609668abffb121dfda2df8e5f on arkid15r:setup-isort-skip-constants-reordering into ebbfc394cf05ab99cf8f268a48b8a4cf1d2b56ce on dr-prodigy:beta.
Hi Ark, good job, thank you! A couple of notes:
- I would have hoped to see cases like this
from holidays.constants import JAN, APR, MAR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC
from holidays.constants import FRI, SAT, SUN, WEEKEND
not converted to this
from holidays.constants import (
JAN,
APR,
MAR,
MAY,
JUN,
JUL,
AUG,
SEP,
OCT,
NOV,
DEC,
FRI,
SAT,
SUN,
WEEKEND,
)
but that's fine as a first solution.
- I had to accordingly review
pyproject.toml
as well: don't forget that's the one which is used when running local tests throughtox
command.
About to merge, thank you again! 👍