Skip to content

Commit 78b34e3

Browse files
committed
Use only one start_on date; add note that justice.cz doesn't have that date
1 parent 5c50bac commit 78b34e3

File tree

7 files changed

+20
-65
lines changed

7 files changed

+20
-65
lines changed

docs/operations/boards.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Výbory spolku
33

44
Historii :term:`výborů <Výbor>` si pro vlastní potřeby zaznamenáváme do `souboru boards.toml <https://github.com/pyvec/docs.pyvec.org/blob/master/src/pyvec_docs/boards.toml>`_ a z něj se generuje i tato stránka. Kdyby něco nesedělo, ověřte `historii zdrojáku této stránky <https://github.com/pyvec/docs.pyvec.org/commits/master/docs/operations/boards.rst>`_ a funkčnost :ref:`přepisů <generate_files>`.
55

6-
Kanonickým zdrojem pravdy je ale `výpis na justice.cz <https://or.justice.cz/ias/ui/rejstrik-firma.vysledky?subjektId=760829&typ=UPLNY>`_.
6+
Kanonickým zdrojem pravdy o členech výboru je výpis ze spolkového rejstříku, viz. např. `na justice.cz <https://or.justice.cz/ias/ui/rejstrik-firma.vysledky?subjektId=760829&typ=UPLNY>`_.
7+
(Rejstřík ale neobsahuje datum zvolení výboru a je aktualizován s administrativím zpožděním.)
78

89

910

@@ -12,8 +13,8 @@ Kanonickým zdrojem pravdy je ale `výpis na justice.cz <https://or.justice.cz/i
1213
1314
1415
15-
Nově zvolený výbor
16-
------------------
16+
Výbor od 7.5.2025
17+
-------------------------------------------------
1718

1819
.. list-table::
1920
:header-rows: 1
@@ -37,7 +38,7 @@ Nově zvolený výbor
3738
* `@JakubDotPy <https://github.com/JakubDotPy>`_
3839
*
3940

40-
Výbor od 1.9.2022
41+
Výbor od 9.4.2022
4142
-------------------------------------------------
4243

4344
.. list-table::
@@ -62,7 +63,7 @@ Výbor od 1.9.2022
6263
* `@sairon <https://github.com/sairon>`_
6364
* |:moneybag:|
6465

65-
Výbor od 4.5.2019
66+
Výbor od 8.4.2019
6667
-------------------------------------------------
6768

6869
.. list-table::

docs/operations/boards.rst.jinja

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ Výbory spolku
33

44
Historii :term:`výborů <Výbor>` si pro vlastní potřeby zaznamenáváme do `souboru boards.toml <https://github.com/pyvec/docs.pyvec.org/blob/master/src/pyvec_docs/boards.toml>`_ a z něj se generuje i tato stránka. Kdyby něco nesedělo, ověřte `historii zdrojáku této stránky <https://github.com/pyvec/docs.pyvec.org/commits/master/docs/operations/boards.rst>`_ a funkčnost :ref:`přepisů <generate_files>`.
55

6-
Kanonickým zdrojem pravdy je ale `výpis na justice.cz <https://or.justice.cz/ias/ui/rejstrik-firma.vysledky?subjektId=760829&typ=UPLNY>`_.
6+
Kanonickým zdrojem pravdy o členech výboru je výpis ze spolkového rejstříku, `viz justice.cz <https://or.justice.cz/ias/ui/rejstrik-firma.vysledky?subjektId=760829&typ=UPLNY>`_.
7+
(Rejstřík ale neobsahuje datum zvolení výboru a je aktualizován s administrativím zpožděním.)
78

89

910

@@ -12,13 +13,8 @@ Kanonickým zdrojem pravdy je ale `výpis na justice.cz <https://or.justice.cz/i
1213

1314

1415
{% for board in boards %}
15-
{%- if board.has_started %}
1616
Výbor od {{ board.start_on.strftime("%-d.%-m.%Y") }}
1717
-------------------------------------------------
18-
{%- else %}
19-
Nově zvolený výbor
20-
------------------
21-
{%- endif %}
2218

2319
.. list-table::
2420
:header-rows: 1

src/pyvec_docs/boards.py

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -40,26 +40,10 @@ def is_treasurer(self) -> bool:
4040

4141
class Board(BaseModel):
4242
start_on: date
43-
voted_on: date
44-
has_started: bool
4543
members: list[BoardMember]
4644

4745
model_config = {"extra": "forbid", "frozen": True}
4846

49-
@classmethod
50-
def create(cls, voted_on=None, start_on=None, **kwargs):
51-
if start_on is None:
52-
start_on = voted_on
53-
has_started = False
54-
else:
55-
has_started = True
56-
return cls(
57-
voted_on=voted_on,
58-
start_on=start_on,
59-
has_started=has_started,
60-
**kwargs,
61-
)
62-
6347
@property
6448
def years(self) -> tuple[int, int]:
6549
start_year = self.start_on.year
@@ -68,15 +52,14 @@ def years(self) -> tuple[int, int]:
6852

6953
@cache
7054
def load_boards(path: Path | str = BOARDS_CONFIG_PATH) -> list[Board]:
71-
"""Load all boards, including inactive ones"""
7255
data = tomllib.loads(Path(path).read_text())
7356
return sorted(
74-
(Board.create(**board) for board in data["board"]),
57+
(Board(**board) for board in data["board"]),
7558
key=attrgetter('start_on'),
7659
reverse=True,
7760
)
7861

7962
@cache
8063
def load_current_board(path: Path | str = BOARDS_CONFIG_PATH) -> Board:
8164
"""Load the board that is currently in power"""
82-
return next(board for board in load_boards(path) if board.has_started)
65+
return next(board for board in load_boards(path))

src/pyvec_docs/boards.toml

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
11
# The Pyvec board members in time
2-
# The most recent board is first, previous boards are listed in descending order
2+
# The current board is first, previous boards are listed in descending order
33
# Each member has a `name`, `github`, and optionally a `roles` array
44
#
5-
# "voted_on" is the day when we voted for the board. It's approximate, since
6-
# votes can take longer than a day.
7-
#
8-
# "start_on" should ideally be the date from justice.cz.
9-
# If the board doesn't officially have power yet, leave it out; "voted_on` will
10-
# be used as default.
5+
# "start_on" is the day when the board assumed power.
116

127

138
[[board]]
14-
voted_on = "2025-05-07"
9+
start_on = "2025-05-07"
1510

1611
[[board.members]]
1712
name = "Jakub Vysoký"
@@ -37,8 +32,7 @@ github = "JakubDotPy"
3732

3833

3934
[[board]]
40-
start_on = "2022-09-01"
41-
voted_on = "2022-04-09"
35+
start_on = "2022-04-09"
4236

4337
[[board.members]]
4438
name = "Barbora Drbohlavová"
@@ -65,8 +59,7 @@ roles = ["treasurer"]
6559

6660

6761
[[board]]
68-
start_on = "2019-05-04"
69-
voted_on = "2019-04-08"
62+
start_on = "2019-04-08"
7063

7164
[[board.members]]
7265
name = "Martin Bílek"
@@ -93,7 +86,6 @@ github = "whiskybar"
9386

9487
[[board]]
9588
start_on = "2012-03-27"
96-
voted_on = "2012-03-27" # approximation
9789

9890
[[board.members]]
9991
name = "Martin Bílek"

src/pyvec_docs/ext/board_dates.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
def board_dates(app: Sphinx, config: Config):
1111
board = load_boards()[0]
1212

13-
last_vote = board.voted_on
13+
last_vote = board.start_on
1414
next_vote = last_vote + timedelta(days=BOARDS_MANDATE_LENGTH * 365)
1515

1616
existing_epilog = app.config.rst_epilog or ""

src/pyvec_docs/grants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@ def remove_comments(html):
1818

1919
def get_board_member_name(username, voted_at, boards: list[Board]):
2020
for board in boards: # sorted from the most recent
21-
if not board.has_started:
22-
continue
2321
if voted_at > board.start_on:
2422
for member in board.members:
2523
if member.github == username:

tests/test_scripts_generate_grants.py

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,26 @@
1414
@pytest.fixture
1515
def boards():
1616
return [ # sorted!
17-
Board.create(
17+
Board(
1818
**{
19-
# No start_on; votes don't count
20-
"voted_on": date(2023, 1, 1),
19+
"start_on": date(2023, 1, 1),
2120
"members": [
2221
{"name": "Bob", "github": "bobby"},
2322
],
2423
}
2524
),
26-
Board.create(
25+
Board(
2726
**{
2827
"start_on": date(2020, 1, 1),
29-
"voted_on": date(2019, 12, 1),
3028
"members": [
3129
{"name": "Alice", "github": "alice"},
3230
{"name": "Doubravka", "github": "doubravka"},
3331
],
3432
}
3533
),
36-
Board.create(
34+
Board(
3735
**{
3836
"start_on": date(2019, 1, 1),
39-
"voted_on": date(2018, 12, 1),
4037
"members": [
4138
{"name": "Bob", "github": "bobby"},
4239
],
@@ -49,18 +46,6 @@ def assert_boards_sorted(boards):
4946
assert boards == sorted(boards)
5047

5148

52-
def assert_start_on_defaults(boards):
53-
assert [b.start_on for b in boards] == [
54-
date(2023, 1, 1), # from voted_on
55-
date(2020, 1, 1), # explicit
56-
date(2018, 12, 1), # explicit
57-
]
58-
59-
60-
def assert_started_values(boards):
61-
assert [b.start_on for b in boards] == [False, True, True]
62-
63-
6449
def test_to_date():
6550
assert to_date("2020-02-12T13:22:01Z") == date(2020, 2, 12)
6651

0 commit comments

Comments
 (0)